Page 1 of 1

Request for tool property

Posted: Tue Apr 21, 2015 10:00 pm
by 13052810
Hello,

I'd like to add a request for a rectangle tool property.

Understanding that as rectangles are deleted, the index or rectangle number changes for all rectangles after the one that is deleted. This is probably fine for most applications, but is causing me an extreme amount of grief. So my solution is to ask for a new property.

Could you include a "Tag" property for each rectangle created, just like the one that is available on standard controls and forms?
It would be a simple string that is married to the specific rectangle.

This would allow me to assign an identifier with the newly created rectangle, that I could use to identify the specific rectangle.

Example:

Code: Select all

k = TChart1.Tools.Add(tcRectangle)
TChart1.Tools.Items(k).asRectangle.Tag = "G1R3"
Since these rectangles are created from within a module, and placed on multiple graphs/forms, keeping track becomes problematic.
In addition, the operator will add and/or delete the rectangles at his will and may or may not be placed on all of the open graphs/forms.
The management of all the rectangles is accomplished on a Master form rather than on each individual graph.

With the above addition of a "Tag" property, "G1R3" would mean the specific rectangle in question is located on Graph #1, and was the 3rd Rectangle added in the Master form. Which has no bearing on the "k" at the time of creation of the rectangle.

Then I could cycle thru all the rectangles on a graph looking for the "Tag" that is the identifier of the rectangle being modified.
The resulting change in index caused by a deletion would thereby be inconsequential.

Thanks!

Re: Request for tool property

Posted: Wed Apr 22, 2015 9:44 am
by yeray
Hello,

I've added this is the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1198

However, if you are not allowing to add&remove tools from the editor, you could maintain you own array of strings adding&removing items while you add&remove rectangle tools.