Steema Issues Database

Note: 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.



Bug 610

Summary: Adding a TColorBandTool at design time and viewing the form "as text" duplicates the TColorLineTool over and over
Product: VCL TeeChart Reporter: yeray alonso <yeray>
Component: ToolsAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED FIXED    
Severity: normal CC: david
Priority: ---    
Version: 140220   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:

Description yeray alonso 2014-02-27 09:41:46 EST
At design time:

- Drop a TChart into the form.
- Add a TLineSeries to the chart.
- Add a TColorBandTool to the chart.
- Go to "View as Text".

You'll see this:

    object ChartTool1: TColorBandTool
      ResizeEnd = True
      ResizeStart = True
      AxisID = 2
      object TColorLineTool
        Active = False
        DragRepaint = True
        AxisID = 2
        object TAnnotationTool
          Shape.Alignment = taCenter
          Shape.Shadow.Visible = False
          Shape.TextAlignment = taCenter
          TextAlignment = taCenter
        end
      end
      object TColorLineTool
        Active = False
        DragRepaint = True
        AxisID = 2
        object TAnnotationTool
          Shape.Alignment = taCenter
          Shape.Shadow.Visible = False
          Shape.TextAlignment = taCenter
          TextAlignment = taCenter
        end
      end
    end

Then, if you go to "View as Form" and you open the editor again, now in the tools section you'll see the TColorBandTool and two TColorLineTools?!

If you close the editor and you go to "View as Text" again, you'll see another TColorLineTool into both into the TColorBandTool and outside:

    object ChartTool1: TColorBandTool
      ResizeEnd = True
      ResizeStart = True
      AxisID = 2
      object TColorLineTool
        Active = False
        DragRepaint = True
        AxisID = 2
        object TAnnotationTool
          Shape.Alignment = taCenter
          Shape.Shadow.Visible = False
          Shape.TextAlignment = taCenter
          TextAlignment = taCenter
        end
      end
      object TColorLineTool
        Active = False
        DragRepaint = True
        AxisID = 2
        object TAnnotationTool
          Shape.Alignment = taCenter
          Shape.Shadow.Visible = False
          Shape.TextAlignment = taCenter
          TextAlignment = taCenter
        end
      end
    end
    object TColorLineTool
      Active = False
      DragRepaint = True
      AxisID = 2
      object TAnnotationTool
        Shape.Alignment = taCenter
        Shape.Shadow.Visible = False
        Shape.TextAlignment = taCenter
        TextAlignment = taCenter
      end
    end
    object TColorLineTool
      Active = False
      DragRepaint = True
      AxisID = 2
      object TAnnotationTool
        Shape.Alignment = taCenter
        Shape.Shadow.Visible = False
        Shape.TextAlignment = taCenter
        TextAlignment = taCenter
      end
    end
  end
Comment 1 david berneda 2014-02-28 06:01:29 EST
Fixed. The problem was at TColorBandTool.ReadState, Start and End lines Axis property was set in a ways that it was adding the lines inside the Chart.Tools list, thus duplicating them every time.

Start and End lines are private to ColorBand and should never appear inside Chart1.Tools list, but, internally Start and End lines need a valid ParentChart to paint.
Comment 2 david berneda 2014-03-05 13:51:19 EST
Re-fixed.