mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 12:00:18 +02:00
TAChart: Auto-rename tools when the toolset name changes
git-svn-id: trunk@29332 -
This commit is contained in:
parent
c25cf46ae6
commit
ba99b14873
@ -55,7 +55,6 @@ object Form1: TForm1
|
||||
Pen.Style = psDash
|
||||
Pen.Width = 2
|
||||
Position = -1.5
|
||||
SeriesColor = clLime
|
||||
end
|
||||
object ChartLine2: TConstantLine
|
||||
LineStyle = lsVertical
|
||||
@ -63,7 +62,6 @@ object Form1: TForm1
|
||||
Pen.Style = psDash
|
||||
Pen.Width = 2
|
||||
Position = 1.5
|
||||
SeriesColor = clFuchsia
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
|
@ -95,7 +95,7 @@ type
|
||||
|
||||
TChartToolClass = class of TChartTool;
|
||||
|
||||
TChartTools = class(TFPList)
|
||||
TChartTools = class(TIndexedComponentList)
|
||||
end;
|
||||
|
||||
{ TChartToolset }
|
||||
@ -105,6 +105,8 @@ type
|
||||
FIsHandled: Boolean;
|
||||
FTools: TChartTools;
|
||||
function GetItem(AIndex: Integer): TChartTool;
|
||||
protected
|
||||
procedure SetName(const AValue: TComponentName); override;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
@ -659,6 +661,17 @@ begin
|
||||
Tools.Move(i, Order);
|
||||
end;
|
||||
|
||||
procedure TChartToolset.SetName(const AValue: TComponentName);
|
||||
var
|
||||
oldName: String;
|
||||
begin
|
||||
if Name = AValue then exit;
|
||||
oldName := Name;
|
||||
inherited SetName(AValue);
|
||||
if csDesigning in ComponentState then
|
||||
Tools.ChangeNamePrefix(oldName, AValue);
|
||||
end;
|
||||
|
||||
{ TBasicZoomTool }
|
||||
|
||||
constructor TBasicZoomTool.Create(AOwner: TComponent);
|
||||
|
Loading…
Reference in New Issue
Block a user