![]() | Steema Issues DatabaseNote: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;otherwise you can use StackOverflow. Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy. |
| Summary: | TColorBandTool Annotation without Allow drag | ||
|---|---|---|---|
| Product: | VCL TeeChart | Reporter: | Bert Kreisel <bert.kreisel> |
| Component: | Tools | Assignee: | Steema Issue Manager <issuemanager> |
| Status: | RESOLVED FIXED | ||
| Severity: | enhancement | CC: | david, sandra |
| Priority: | Normal | ||
| Version: | 131119 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows | ||
| Chart Series: | --- | Delphi / C++ Builder RAD IDE Version: | RAD XE3 |
|
Description
Bert Kreisel
2013-12-10 10:03:47 EST
To reproduce the problem, you can use next code: uses Series, TeeTools; procedure TForm1.FormCreate(Sender: TObject); var Series1:TLineSeries; Tool1:TColorBandTool; begin Chart1.View3D:=False; Series1 := TLineSeries.Create(Self); Tool1 := TColorBandTool.Create(self); Chart1.AddSeries(Series1); Chart1.Tools.Add(Tool1); Series1.FillSampleValues(10); Tool1.Axis:= Chart1.Axes.Left; Tool1.StartValue := Series1.YValues[3]; Tool1.EndValue := Series1.YValues[9]; Tool1.AllowDrag:=False; Tool1.StartLine.Active:=True; Tool1.StartLine.Annotation.Visible:=True; Tool1.StartLine.Annotation.Text := 'StartLine'; Tool1.EndLine.Active:=True; Tool1.EndLine.Annotation.Visible:=True; Tool1.EndLine.Annotation.Text := 'EndLine'; end; At the moment, you can use Annotation.Shape.Visible as a workaround. See next code: uses Series, TeeTools; procedure TForm1.FormCreate(Sender: TObject); var Series1:TLineSeries; Tool1:TColorBandTool; begin Chart1.View3D:=False; Series1 := TLineSeries.Create(Self); Tool1 := TColorBandTool.Create(self); Chart1.AddSeries(Series1); Chart1.Tools.Add(Tool1); Series1.FillSampleValues(10); Tool1.Axis:= Chart1.Axes.Left; Tool1.StartValue := Series1.YValues[3]; Tool1.EndValue := Series1.YValues[9]; Tool1.AllowDrag:=False; Tool1.StartLine.Active:=True; //Tool1.StartLine.Annotation.Visible:=True; Tool1.StartLine.Annotation.Shape.Visible:=True; Tool1.StartLine.Annotation.Text := 'StartLine'; Tool1.EndLine.Active:=True; // Tool1.EndLine.Annotation.Visible:=True; Tool1.EndLine.Annotation.Shape.Visible:=True; Tool1.EndLine.Annotation.Text := 'EndLine'; end; Can we achieve this with TColorBandToolEditor? (In reply to Bert Kreisel from comment #2) > Can we achieve this with TColorBandToolEditor? Also, the problem occurs when you active the Annotation in design time editor, but ColorBandTool works correctly if you open the Editor in run time and active Annotation. I am afraid I cannot provide you a workaround to solve the problem by editor, sorry. We are using the editor in run time. But active annotation does Allow drag, but we do not want to allow drag. Sorry, I was a little confused when I first looked at this because I hadn't understood that you had disabled whole to reproduce the problem and when I originally ran the test with Editor (design-time and run time) I didn't disable the ColorLines tool (start and end) AllowDrag property. I've retried and can confirm that if I disable the AllowDrag of ColorLine tool (end and Start) I can reproduce your problem via code at runtime or by Editor. Therefore, the bug has three parts are all related 1.- The annotation isn't visible if you use the Annotation.Visible property (rather than the Annotation.Shape.Visible) property. 2.- The annotation isn't visible if you add Annotation via the design-time editor and AllowDrag of ColorBandTool is false. 3.- The annotation isn't visible if you disable in the editor(design-time or run-time) the AllowDrag of ColorLine tool. The problem doesn't occur if you have previously set the Allowdrag property in code. Whilst we look at this I'd like to inform you that the following workaround could be used: uses Series, TeeTools; procedure TForm1.FormCreate(Sender: TObject); var Series1:TLineSeries; Tool1:TColorBandTool; begin Chart1.View3D:=False; Series1 := TLineSeries.Create(Self); Tool1 := TColorBandTool.Create(self); Chart1.AddSeries(Series1); Chart1.Tools.Add(Tool1); Series1.FillSampleValues(10); Tool1.Axis:= Chart1.Axes.Left; Tool1.StartValue := Series1.YValues[3]; Tool1.EndValue := Series1.YValues[9]; Tool1.AllowDrag:=False; Tool1.StartLine.Active:=True; Tool1.StartLine.AllowDrag := False; //Tool1.StartLine.Annotation.Visible:=True; Tool1.StartLine.Annotation.Shape.Visible:=True; Tool1.StartLine.Annotation.Text := 'StartLine'; Tool1.EndLine.Active:=True; Tool1.EndLine.AllowDrag:=False; // Tool1.EndLine.Annotation.Visible:=True; Tool1.EndLine.Annotation.Shape.Visible:=True; Tool1.EndLine.Annotation.Text := 'EndLine'; end; The visibility problems are fixed now. The AllowDrag problem is not a bug. ColorBand1.AllowDrag:=False means to disable dragging of the color band itself (to move it without resizing it), not to disable dragging of the start/end lines. To disable lines dragging: ColorBand1.StartLine.AllowDrag:=False; ColorBand1.EndLine.AllowDrag:=False; This is made in this way so you can enable or disable dragging for the band and the two lines independently. The next problem to fix is to try to make the Annotation properties to persist at the DFM/FMX. As Annotation are TComponent properties, just making them "published" does not persist them. Fixed. The ColorBand properties: ResizeEnd and ResizeStart now correctly enable or disable dragging of the start/end lines. The editor dialog has also been corrected. ColorBand1.StartLine.Active:=True; ColorBand1.ResizeStart:=False; ColorBand1.EndLine.Active:=True; ColorBand1.ResizeEnd:=False; |