mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 19:59:14 +02:00
TAChart: Replace deprecated Reticule in demo/basic by a DataPointCrosshairTool.
git-svn-id: branches/fixes_2_0@60192 -
This commit is contained in:
parent
9790b72f61
commit
a07eef42b0
@ -47,6 +47,7 @@ object Form1: TForm1
|
|||||||
'Centered Chart Title'
|
'Centered Chart Title'
|
||||||
)
|
)
|
||||||
Title.Visible = True
|
Title.Visible = True
|
||||||
|
Toolset = ChartToolset1
|
||||||
Align = alClient
|
Align = alClient
|
||||||
object Chart1LineHor: TConstantLine
|
object Chart1LineHor: TConstantLine
|
||||||
Legend.Visible = False
|
Legend.Visible = False
|
||||||
@ -118,19 +119,6 @@ object Form1: TForm1
|
|||||||
Caption = 'Add with marks:'
|
Caption = 'Add with marks:'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object lblReticule: TLabel
|
|
||||||
AnchorSideTop.Control = cbReticule
|
|
||||||
AnchorSideTop.Side = asrCenter
|
|
||||||
AnchorSideRight.Control = cbReticule
|
|
||||||
Left = 371
|
|
||||||
Height = 15
|
|
||||||
Top = 92
|
|
||||||
Width = 45
|
|
||||||
Anchors = [akTop, akRight]
|
|
||||||
BorderSpacing.Right = 8
|
|
||||||
Caption = 'Reticule:'
|
|
||||||
ParentColor = False
|
|
||||||
end
|
|
||||||
object btnAddPie: TButton
|
object btnAddPie: TButton
|
||||||
AnchorSideLeft.Control = btnClearPie
|
AnchorSideLeft.Control = btnClearPie
|
||||||
AnchorSideTop.Control = Panel1
|
AnchorSideTop.Control = Panel1
|
||||||
@ -366,7 +354,6 @@ object Form1: TForm1
|
|||||||
object cbMarkStyle: TComboBox
|
object cbMarkStyle: TComboBox
|
||||||
AnchorSideLeft.Control = lblMarkStyle
|
AnchorSideLeft.Control = lblMarkStyle
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = cbReticule
|
|
||||||
Left = 141
|
Left = 141
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 88
|
Top = 88
|
||||||
@ -392,30 +379,6 @@ object Form1: TForm1
|
|||||||
TabOrder = 17
|
TabOrder = 17
|
||||||
Text = 'smsLabelPercent'
|
Text = 'smsLabelPercent'
|
||||||
end
|
end
|
||||||
object cbReticule: TComboBox
|
|
||||||
AnchorSideLeft.Control = cbLegend
|
|
||||||
AnchorSideTop.Control = cbShowGridCheckBox
|
|
||||||
AnchorSideTop.Side = asrBottom
|
|
||||||
Left = 424
|
|
||||||
Height = 23
|
|
||||||
Top = 88
|
|
||||||
Width = 156
|
|
||||||
BorderSpacing.Top = 4
|
|
||||||
BorderSpacing.Right = 8
|
|
||||||
BorderSpacing.Bottom = 8
|
|
||||||
ItemHeight = 15
|
|
||||||
ItemIndex = 0
|
|
||||||
Items.Strings = (
|
|
||||||
'rmNone'
|
|
||||||
'rmVertical'
|
|
||||||
'rmHorizontal'
|
|
||||||
'rmCross'
|
|
||||||
)
|
|
||||||
OnChange = cbReticuleChange
|
|
||||||
Style = csDropDownList
|
|
||||||
TabOrder = 18
|
|
||||||
Text = 'rmNone'
|
|
||||||
end
|
|
||||||
object btnClearAll: TButton
|
object btnClearAll: TButton
|
||||||
AnchorSideLeft.Control = btnClearLine
|
AnchorSideLeft.Control = btnClearLine
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
@ -428,7 +391,45 @@ object Form1: TForm1
|
|||||||
BorderSpacing.Left = 8
|
BorderSpacing.Left = 8
|
||||||
Caption = 'All'
|
Caption = 'All'
|
||||||
OnClick = btnClearAllClick
|
OnClick = btnClearAllClick
|
||||||
|
TabOrder = 18
|
||||||
|
end
|
||||||
|
object lblCrossHairTool: TLabel
|
||||||
|
AnchorSideTop.Control = lblMarkStyle
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
AnchorSideRight.Control = cbCrosshairTool
|
||||||
|
Left = 340
|
||||||
|
Height = 15
|
||||||
|
Top = 92
|
||||||
|
Width = 76
|
||||||
|
Anchors = [akTop, akRight]
|
||||||
|
BorderSpacing.Right = 8
|
||||||
|
Caption = 'Crosshair tool:'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object cbCrosshairTool: TComboBox
|
||||||
|
AnchorSideLeft.Control = cbShowGridCheckBox
|
||||||
|
Left = 424
|
||||||
|
Height = 23
|
||||||
|
Top = 88
|
||||||
|
Width = 155
|
||||||
|
ItemHeight = 15
|
||||||
|
ItemIndex = 0
|
||||||
|
Items.Strings = (
|
||||||
|
'none'
|
||||||
|
'Vertical'
|
||||||
|
'Horizontal'
|
||||||
|
'Both'
|
||||||
|
)
|
||||||
|
OnChange = cbCrosshairToolChange
|
||||||
|
Style = csDropDownList
|
||||||
TabOrder = 19
|
TabOrder = 19
|
||||||
|
Text = 'none'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object ChartToolset1: TChartToolset
|
||||||
|
left = 240
|
||||||
|
top = 115
|
||||||
|
object DataPointCrosshairTool: TDataPointCrosshairTool
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -6,7 +6,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
SysUtils, Forms, Graphics, ExtCtrls,
|
SysUtils, Forms, Graphics, ExtCtrls,
|
||||||
TAGraph, TASeries, Buttons, StdCtrls, Spin;
|
TAGraph, TASeries, TATools, Buttons, StdCtrls, Spin, Classes;
|
||||||
|
|
||||||
type
|
type
|
||||||
{ TForm1 }
|
{ TForm1 }
|
||||||
@ -21,7 +21,6 @@ type
|
|||||||
btnAddPie: TButton;
|
btnAddPie: TButton;
|
||||||
btnAddLine: TButton;
|
btnAddLine: TButton;
|
||||||
btnAddArea: TButton;
|
btnAddArea: TButton;
|
||||||
cbReticule: TComboBox;
|
|
||||||
cbShowAxisTitles: TCheckBox;
|
cbShowAxisTitles: TCheckBox;
|
||||||
Chart1: TChart;
|
Chart1: TChart;
|
||||||
cbBottomAxis: TCheckBox;
|
cbBottomAxis: TCheckBox;
|
||||||
@ -34,11 +33,14 @@ type
|
|||||||
Chart1LineHor: TConstantLine;
|
Chart1LineHor: TConstantLine;
|
||||||
Chart1LineVert: TConstantLine;
|
Chart1LineVert: TConstantLine;
|
||||||
cbMarkStyle: TComboBox;
|
cbMarkStyle: TComboBox;
|
||||||
|
ChartToolset1: TChartToolset;
|
||||||
|
DataPointCrosshairTool: TDataPointCrosshairTool;
|
||||||
|
cbCrosshairTool: TComboBox;
|
||||||
|
lblCrossHairTool: TLabel;
|
||||||
lblAddCount: TLabel;
|
lblAddCount: TLabel;
|
||||||
lblAdd: TLabel;
|
lblAdd: TLabel;
|
||||||
lblMarkStyle: TLabel;
|
lblMarkStyle: TLabel;
|
||||||
lblClear: TLabel;
|
lblClear: TLabel;
|
||||||
lblReticule: TLabel;
|
|
||||||
Panel1: TPanel;
|
Panel1: TPanel;
|
||||||
edAddCount: TSpinEdit;
|
edAddCount: TSpinEdit;
|
||||||
procedure btnClearAllClick(Sender: TObject);
|
procedure btnClearAllClick(Sender: TObject);
|
||||||
@ -46,6 +48,7 @@ type
|
|||||||
procedure btnClearBarClick(Sender: TObject);
|
procedure btnClearBarClick(Sender: TObject);
|
||||||
procedure btnClearLineClick(Sender: TObject);
|
procedure btnClearLineClick(Sender: TObject);
|
||||||
procedure btnClearPieClick(Sender: TObject);
|
procedure btnClearPieClick(Sender: TObject);
|
||||||
|
procedure cbCrosshairToolChange(Sender: TObject);
|
||||||
procedure cbInvertedChange(Sender: TObject);
|
procedure cbInvertedChange(Sender: TObject);
|
||||||
procedure btnAddAreaClick(Sender: TObject);
|
procedure btnAddAreaClick(Sender: TObject);
|
||||||
procedure btnAddBarClick(Sender: TObject);
|
procedure btnAddBarClick(Sender: TObject);
|
||||||
@ -53,7 +56,6 @@ type
|
|||||||
procedure btnAddPieClick(Sender: TObject);
|
procedure btnAddPieClick(Sender: TObject);
|
||||||
procedure cbBottomAxisChange(Sender: TObject);
|
procedure cbBottomAxisChange(Sender: TObject);
|
||||||
procedure cbLeftAxisChange(Sender: TObject);
|
procedure cbLeftAxisChange(Sender: TObject);
|
||||||
procedure cbReticuleChange(Sender: TObject);
|
|
||||||
procedure cbShowAxisTitlesChange(Sender: TObject);
|
procedure cbShowAxisTitlesChange(Sender: TObject);
|
||||||
procedure cbTitleChange(Sender: TObject);
|
procedure cbTitleChange(Sender: TObject);
|
||||||
procedure cbFooterChange(Sender: TObject);
|
procedure cbFooterChange(Sender: TObject);
|
||||||
@ -184,6 +186,25 @@ begin
|
|||||||
FreeAndNil(FPie);
|
FreeAndNil(FPie);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.cbCrosshairToolChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
DataPointCrosshairTool.Enabled := CbCrosshairTool.ItemIndex > 0;
|
||||||
|
case cbCrosshairTool.ItemIndex of
|
||||||
|
1: begin
|
||||||
|
DatapointCrosshairTool.Shape := ccsVertical;
|
||||||
|
DatapointCrosshairTool.DistanceMode := cdmOnlyX;
|
||||||
|
end;
|
||||||
|
2: begin
|
||||||
|
DatapointCrosshairTool.Shape := ccsHorizontal;
|
||||||
|
DatapointCrosshairTool.DistanceMode := cdmOnlyY;
|
||||||
|
end;
|
||||||
|
3: begin
|
||||||
|
DatapointCrosshairTool.Shape := ccsCross;
|
||||||
|
DatapointCrosshairTool.DistanceMode := cdmXY;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TForm1.cbBottomAxisChange(Sender: TObject);
|
procedure TForm1.cbBottomAxisChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
Chart1.BottomAxis.Visible := cbBottomAxis.Checked;
|
Chart1.BottomAxis.Visible := cbBottomAxis.Checked;
|
||||||
@ -205,11 +226,6 @@ begin
|
|||||||
Chart1.Legend.Visible := cbLegend.Checked;
|
Chart1.Legend.Visible := cbLegend.Checked;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.cbReticuleChange(Sender: TObject);
|
|
||||||
begin
|
|
||||||
Chart1.ReticuleMode := TReticuleMode(cbReticule.ItemIndex);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TForm1.cbShowAxisTitlesChange(Sender: TObject);
|
procedure TForm1.cbShowAxisTitlesChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
with Chart1.BottomAxis.Title do
|
with Chart1.BottomAxis.Title do
|
||||||
|
Loading…
Reference in New Issue
Block a user