TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
-
realtracksystems
- Newbie
- Posts: 11
- Joined: Fri Sep 18, 2009 12:00 am
Post
by realtracksystems » Tue Nov 15, 2011 4:59 pm
Hello. I have TeeChart 8.08. I have a cahrt with a TColorBandTool. I have assigned OnDragLine events to StartLine and EndLine of TColorBandTool. If I assign these events, then the colorBand is not repainted while dragging. If I remove the events, everything works again. this is mi code:
Code: Select all
TColorBandTool* band = new TColorBandTool(...);
band->Axis = Chart1->BottomAxis;
band->OnClick = BandaSelecClick;
band->OnResized = rectResized;
band->StartLine->OnDragLine = SelectDrag; /******** If you remove this line then everything works ***********/
band->StartLine->Active = true;
band->StartLine->AllowDrag = true;
...
Am I doing something wrong?
-
Yeray
- Site Admin
- Posts: 9612
- Joined: Tue Dec 05, 2006 12:00 am
- Location: Girona, Catalonia
-
Contact:
Post
by Yeray » Thu Nov 17, 2011 11:36 am
Hello,
I could reproduce the problem here. It seems that the StartValue of the TColorBandTool isn't updated when its StartLine TColorLineTool has the OnDragLine event assigned. However, it can be simply achieved assigning it yourself in that event:
Code: Select all
procedure TForm1.SelectDrag(Sender:TColorLineTool);
begin
with Chart1.Tools[0] as TColorBandTool do
if Sender = StartLine then
StartValue:=Sender.Value;
end;
This is Delphi code but should be the same in C++Builder.
In the example above I assume the first tool is the TColorBandTool. If you don't know where it is, you will have to loop into the chart tools to find it.
-
realtracksystems
- Newbie
- Posts: 11
- Joined: Fri Sep 18, 2009 12:00 am
Post
by realtracksystems » Thu Nov 17, 2011 4:40 pm
I thought this could be happening. I've done what you've said. In order to avoid loop into the tools, I have assigned ColorBand pointer to the Tag property of the StartLine and EndLine.
Best Regards.