mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-02 20:27:24 +01:00
TAChart/ChartEditorDemo: Move controls from SeriesDlg to a new SeriesFrame.
git-svn-id: trunk@65041 -
This commit is contained in:
parent
70d114b0fc
commit
b692a8c4d4
@ -1,18 +1,17 @@
|
||||
object SeriesEditor: TChartSeriesEditor
|
||||
object ChartSeriesEditor: TChartSeriesEditor
|
||||
Left = 509
|
||||
Height = 450
|
||||
Top = 284
|
||||
Width = 600
|
||||
ActiveControl = cbShowSeries
|
||||
Caption = 'SeriesEditor'
|
||||
ClientHeight = 450
|
||||
ClientWidth = 600
|
||||
Constraints.MinHeight = 450
|
||||
Constraints.MinWidth = 600
|
||||
OnActivate = FormActivate
|
||||
OnCloseQuery = FormCloseQuery
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '2.1.0.0'
|
||||
object ButtonPanel: TButtonPanel
|
||||
@ -29,482 +28,7 @@ object SeriesEditor: TChartSeriesEditor
|
||||
CloseButton.DefaultCaption = True
|
||||
CancelButton.Name = 'CancelButton'
|
||||
CancelButton.DefaultCaption = True
|
||||
TabOrder = 2
|
||||
TabOrder = 0
|
||||
ShowButtons = [pbOK, pbCancel]
|
||||
end
|
||||
object nbSeriesTypes: TNotebook
|
||||
Left = 0
|
||||
Height = 254
|
||||
Top = 150
|
||||
Width = 600
|
||||
PageIndex = 0
|
||||
Align = alClient
|
||||
TabOrder = 1
|
||||
object pgLineSeries: TPage
|
||||
object gbLineSeriesLineStyle: TGroupBox
|
||||
AnchorSideLeft.Control = pgLineSeries
|
||||
AnchorSideTop.Control = pgLineSeries
|
||||
AnchorSideRight.Control = Bevel1
|
||||
Left = 8
|
||||
Height = 88
|
||||
Top = 8
|
||||
Width = 284
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
Caption = 'gbLineSeriesLineStyle'
|
||||
ClientHeight = 68
|
||||
ClientWidth = 280
|
||||
TabOrder = 0
|
||||
object cbLineSeriesShowLines: TCheckBox
|
||||
Left = 8
|
||||
Height = 19
|
||||
Top = 6
|
||||
Width = 272
|
||||
Align = alTop
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Visible'
|
||||
OnChange = cbLineSeriesShowLinesChange
|
||||
TabOrder = 0
|
||||
end
|
||||
end
|
||||
object gbLineSeriesPointer: TGroupBox
|
||||
AnchorSideLeft.Control = Bevel1
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = gbLineSeriesLineStyle
|
||||
AnchorSideRight.Control = pgLineSeries
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 308
|
||||
Height = 240
|
||||
Top = 8
|
||||
Width = 284
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Right = 8
|
||||
Caption = 'gbLineSeriesPointer'
|
||||
ClientHeight = 220
|
||||
ClientWidth = 280
|
||||
TabOrder = 1
|
||||
object cbLineSeriesShowPoints: TCheckBox
|
||||
Left = 8
|
||||
Height = 19
|
||||
Top = 6
|
||||
Width = 272
|
||||
Align = alTop
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Visible'
|
||||
OnChange = cbLineSeriesShowPointsChange
|
||||
TabOrder = 0
|
||||
end
|
||||
end
|
||||
object Bevel1: TBevel
|
||||
AnchorSideLeft.Control = pgLineSeries
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
Left = 292
|
||||
Height = 104
|
||||
Top = 120
|
||||
Width = 16
|
||||
Shape = bsSpacer
|
||||
end
|
||||
end
|
||||
object pgBarSeries: TPage
|
||||
object gbBarSeriesBorder: TGroupBox
|
||||
AnchorSideLeft.Control = pgBarSeries
|
||||
AnchorSideTop.Control = gbBarSeriesBrush
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Bevel2
|
||||
Left = 8
|
||||
Height = 92
|
||||
Top = 60
|
||||
Width = 284
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
Caption = 'gbBarSeriesBorder'
|
||||
TabOrder = 2
|
||||
end
|
||||
object gbBarSeriesBrush: TGroupBox
|
||||
AnchorSideLeft.Control = pgBarSeries
|
||||
AnchorSideTop.Control = pgBarSeries
|
||||
AnchorSideRight.Control = Bevel2
|
||||
Left = 8
|
||||
Height = 52
|
||||
Top = 0
|
||||
Width = 284
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 8
|
||||
Caption = 'gbBarSeriesBrush'
|
||||
TabOrder = 0
|
||||
end
|
||||
object gbBarShape: TGroupBox
|
||||
AnchorSideLeft.Control = Bevel2
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = gbBarSeriesBrush
|
||||
AnchorSideRight.Control = pgBarSeries
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = gbBarSeriesBrush
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 308
|
||||
Height = 52
|
||||
Top = 0
|
||||
Width = 284
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Right = 8
|
||||
Caption = 'Bar shape'
|
||||
ClientHeight = 32
|
||||
ClientWidth = 280
|
||||
TabOrder = 1
|
||||
object cbBarShape: TComboBox
|
||||
AnchorSideLeft.Control = gbBarShape
|
||||
AnchorSideTop.Control = gbBarShape
|
||||
AnchorSideRight.Control = gbBarShape
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 8
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 264
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Right = 8
|
||||
BorderSpacing.Bottom = 8
|
||||
ItemHeight = 15
|
||||
ItemIndex = 0
|
||||
Items.Strings = (
|
||||
'Rectangular'
|
||||
'Cylindrical'
|
||||
'Hexagonal prism'
|
||||
'Pyramid'
|
||||
'Conical'
|
||||
)
|
||||
OnChange = cbBarShapeChange
|
||||
Style = csDropDownList
|
||||
TabOrder = 0
|
||||
Text = 'Rectangular'
|
||||
end
|
||||
end
|
||||
object Bevel2: TBevel
|
||||
AnchorSideLeft.Control = pgBarSeries
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
Left = 292
|
||||
Height = 11
|
||||
Top = 208
|
||||
Width = 16
|
||||
Shape = bsSpacer
|
||||
end
|
||||
end
|
||||
object pgAreaSeries: TPage
|
||||
object gbAreaSeriesBrush: TGroupBox
|
||||
AnchorSideLeft.Control = pgAreaSeries
|
||||
AnchorSideTop.Control = pgAreaSeries
|
||||
AnchorSideRight.Control = Bevel3
|
||||
Left = 8
|
||||
Height = 57
|
||||
Top = 0
|
||||
Width = 284
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 8
|
||||
Caption = 'gbAreaSeriesBrush'
|
||||
TabOrder = 0
|
||||
end
|
||||
object gbAreaContourPen: TGroupBox
|
||||
AnchorSideLeft.Control = gbAreaSeriesBrush
|
||||
AnchorSideTop.Control = gbAreaSeriesBrush
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Bevel3
|
||||
Left = 8
|
||||
Height = 115
|
||||
Top = 65
|
||||
Width = 284
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Top = 8
|
||||
Caption = 'gbAreaContourPen'
|
||||
ClientHeight = 95
|
||||
ClientWidth = 280
|
||||
TabOrder = 1
|
||||
object cbAreaShowContourLines: TCheckBox
|
||||
Left = 8
|
||||
Height = 19
|
||||
Top = 8
|
||||
Width = 272
|
||||
Align = alTop
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
BorderSpacing.Bottom = 8
|
||||
Caption = 'Visible'
|
||||
OnChange = cbAreaShowContourLinesChange
|
||||
TabOrder = 0
|
||||
end
|
||||
end
|
||||
object Bevel3: TBevel
|
||||
AnchorSideLeft.Control = pgAreaSeries
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
Left = 292
|
||||
Height = 104
|
||||
Top = 72
|
||||
Width = 16
|
||||
Shape = bsSpacer
|
||||
end
|
||||
object gbAreaDropLinePen: TGroupBox
|
||||
AnchorSideLeft.Control = Bevel3
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = gbAreaSeriesBrush
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = pgAreaSeries
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 308
|
||||
Height = 115
|
||||
Top = 65
|
||||
Width = 284
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Top = 8
|
||||
BorderSpacing.Right = 8
|
||||
Caption = 'gbAreaDropLinePen'
|
||||
ClientHeight = 95
|
||||
ClientWidth = 280
|
||||
TabOrder = 2
|
||||
object cbAreaShowDropLines: TCheckBox
|
||||
Left = 8
|
||||
Height = 19
|
||||
Top = 8
|
||||
Width = 272
|
||||
Align = alTop
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
BorderSpacing.Bottom = 8
|
||||
Caption = 'Visible'
|
||||
OnChange = cbAreaShowDropLinesChange
|
||||
TabOrder = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
object PanelTop: TPanel
|
||||
Left = 0
|
||||
Height = 150
|
||||
Top = 0
|
||||
Width = 600
|
||||
Align = alTop
|
||||
AutoSize = True
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 150
|
||||
ClientWidth = 600
|
||||
TabOrder = 0
|
||||
object cbShowSeries: TCheckBox
|
||||
Left = 8
|
||||
Height = 19
|
||||
Top = 8
|
||||
Width = 49
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
BorderSpacing.Bottom = 6
|
||||
Caption = 'Show'
|
||||
Checked = True
|
||||
OnChange = cbShowSeriesChange
|
||||
State = cbChecked
|
||||
TabOrder = 0
|
||||
end
|
||||
object gbLegendText: TGroupBox
|
||||
AnchorSideLeft.Control = PanelTop
|
||||
AnchorSideTop.Control = cbShowSeries
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Bevel4
|
||||
Left = 8
|
||||
Height = 109
|
||||
Top = 33
|
||||
Width = 284
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Bottom = 8
|
||||
Caption = 'Legend text'
|
||||
ClientHeight = 89
|
||||
ClientWidth = 280
|
||||
TabOrder = 1
|
||||
object edSeriesTitle: TEdit
|
||||
AnchorSideLeft.Control = gbLegendText
|
||||
AnchorSideTop.Control = gbLegendText
|
||||
AnchorSideRight.Control = gbLegendText
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 8
|
||||
Height = 23
|
||||
Top = 4
|
||||
Width = 264
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 4
|
||||
BorderSpacing.Right = 8
|
||||
OnChange = edSeriesTitleChange
|
||||
TabOrder = 0
|
||||
Text = 'edSeriesTitle'
|
||||
end
|
||||
object cbShowInLegend: TCheckBox
|
||||
AnchorSideLeft.Control = edSeriesTitle
|
||||
AnchorSideTop.Control = edSeriesTitle
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 8
|
||||
Height = 19
|
||||
Top = 33
|
||||
Width = 101
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Show in legend'
|
||||
OnChange = cbShowInLegendChange
|
||||
TabOrder = 1
|
||||
end
|
||||
object cbLegendMultiplicity: TComboBox
|
||||
AnchorSideLeft.Control = Label1
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = cbShowInLegend
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = edSeriesTitle
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 87
|
||||
Height = 23
|
||||
Top = 58
|
||||
Width = 185
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Bottom = 8
|
||||
ItemHeight = 15
|
||||
ItemIndex = 0
|
||||
Items.Strings = (
|
||||
'single item per series'
|
||||
'marks text per data point'
|
||||
)
|
||||
OnChange = cbLegendMultiplicityChange
|
||||
Style = csDropDownList
|
||||
TabOrder = 2
|
||||
Text = 'single item per series'
|
||||
end
|
||||
object Label1: TLabel
|
||||
AnchorSideLeft.Control = edSeriesTitle
|
||||
AnchorSideTop.Control = cbLegendMultiplicity
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 8
|
||||
Height = 15
|
||||
Top = 62
|
||||
Width = 71
|
||||
Caption = 'Legend items'
|
||||
ParentColor = False
|
||||
end
|
||||
end
|
||||
object gbMarks: TGroupBox
|
||||
AnchorSideLeft.Control = Bevel4
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = gbLegendText
|
||||
AnchorSideRight.Control = PanelTop
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = gbLegendText
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 308
|
||||
Height = 109
|
||||
Top = 33
|
||||
Width = 284
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Right = 8
|
||||
Caption = 'Marks'
|
||||
ClientHeight = 89
|
||||
ClientWidth = 280
|
||||
TabOrder = 2
|
||||
object lblSeriesMarksStyle: TLabel
|
||||
AnchorSideLeft.Control = gbMarks
|
||||
AnchorSideTop.Control = cbMarksStyle
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 8
|
||||
Height = 15
|
||||
Top = 8
|
||||
Width = 25
|
||||
BorderSpacing.Left = 8
|
||||
Caption = 'Style'
|
||||
ParentColor = False
|
||||
end
|
||||
object cbMarksStyle: TComboBox
|
||||
AnchorSideLeft.Control = edMarksFormat
|
||||
AnchorSideTop.Control = gbMarks
|
||||
AnchorSideRight.Control = gbMarks
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 54
|
||||
Height = 23
|
||||
Top = 4
|
||||
Width = 218
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Top = 4
|
||||
BorderSpacing.Right = 8
|
||||
ItemHeight = 15
|
||||
ItemIndex = 1
|
||||
Items.Strings = (
|
||||
'User-defined'
|
||||
'No labels'
|
||||
'Value'
|
||||
'Percent'
|
||||
'Label'
|
||||
'Label and percent'
|
||||
'Label and value'
|
||||
'Legend'
|
||||
'Percent and total'
|
||||
'Label, percent, and total'
|
||||
'X value'
|
||||
)
|
||||
OnChange = cbMarksStyleChange
|
||||
Style = csDropDownList
|
||||
TabOrder = 0
|
||||
Text = 'No labels'
|
||||
end
|
||||
object Label2: TLabel
|
||||
AnchorSideLeft.Control = lblSeriesMarksStyle
|
||||
AnchorSideTop.Control = edMarksFormat
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 8
|
||||
Height = 15
|
||||
Top = 37
|
||||
Width = 38
|
||||
Caption = 'Format'
|
||||
ParentColor = False
|
||||
end
|
||||
object edMarksFormat: TEdit
|
||||
AnchorSideLeft.Control = Label2
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = cbMarksStyle
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = gbMarks
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 54
|
||||
Height = 23
|
||||
Top = 33
|
||||
Width = 218
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 8
|
||||
OnEditingDone = edMarksFormatEditingDone
|
||||
TabOrder = 1
|
||||
Text = 'edMarksFormat'
|
||||
end
|
||||
object cbShowMarks: TCheckBox
|
||||
AnchorSideLeft.Control = edMarksFormat
|
||||
AnchorSideTop.Control = edMarksFormat
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 54
|
||||
Height = 19
|
||||
Top = 62
|
||||
Width = 156
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Show at series data points'
|
||||
OnChange = cbShowMarksChange
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
||||
object Bevel4: TBevel
|
||||
AnchorSideLeft.Control = PanelTop
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
Left = 292
|
||||
Height = 94
|
||||
Top = 48
|
||||
Width = 16
|
||||
Shape = bsSpacer
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -8,83 +8,30 @@ uses
|
||||
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ButtonPanel, ExtCtrls,
|
||||
StdCtrls,
|
||||
TACustomSeries, TASeries, TAGraph, TAChartCombos,
|
||||
cePenFrame, ceBrushFrame, cePointerFrame;
|
||||
ceSeriesFrame;
|
||||
|
||||
type
|
||||
|
||||
{ TChartSeriesEditor }
|
||||
|
||||
TChartSeriesEditor = class(TForm)
|
||||
Bevel1: TBevel;
|
||||
Bevel2: TBevel;
|
||||
Bevel3: TBevel;
|
||||
Bevel4: TBevel;
|
||||
ButtonPanel: TButtonPanel;
|
||||
cbAreaShowDropLines: TCheckBox;
|
||||
cbLineSeriesShowPoints: TCheckBox;
|
||||
cbPenColor: TColorButton;
|
||||
cbPenStyle: TChartComboBox;
|
||||
cbPenWidth: TChartComboBox;
|
||||
cbShowSeries: TCheckBox;
|
||||
cbLineSeriesShowLines: TCheckBox;
|
||||
cbBarShape: TComboBox;
|
||||
cbAreaShowContourLines: TCheckBox;
|
||||
cbShowInLegend: TCheckBox;
|
||||
cbLegendMultiplicity: TComboBox;
|
||||
cbMarksStyle: TComboBox;
|
||||
cbShowMarks: TCheckBox;
|
||||
edMarksFormat: TEdit;
|
||||
edSeriesTitle: TEdit;
|
||||
gbAreaDropLinePen: TGroupBox;
|
||||
gbLineSeriesLineStyle: TGroupBox;
|
||||
gbBarSeriesBorder: TGroupBox;
|
||||
gbBarSeriesBrush: TGroupBox;
|
||||
gbBarShape: TGroupBox;
|
||||
gbLineSeriesPointer: TGroupBox;
|
||||
gbAreaSeriesBrush: TGroupBox;
|
||||
gbAreaContourPen: TGroupBox;
|
||||
gbLegendText: TGroupBox;
|
||||
gbMarks: TGroupBox;
|
||||
Label1: TLabel;
|
||||
Label2: TLabel;
|
||||
lblSeriesMarksStyle: TLabel;
|
||||
lblPenStyle: TLabel;
|
||||
lblPenWidth: TLabel;
|
||||
nbSeriesTypes: TNotebook;
|
||||
pgAreaSeries: TPage;
|
||||
pgBarSeries: TPage;
|
||||
pgLineSeries: TPage;
|
||||
PanelTop: TPanel;
|
||||
procedure cbAreaShowContourLinesChange(Sender: TObject);
|
||||
procedure cbAreaShowDropLinesChange(Sender: TObject);
|
||||
procedure cbBarShapeChange(Sender: TObject);
|
||||
procedure cbLegendMultiplicityChange(Sender: TObject);
|
||||
procedure cbLineSeriesShowLinesChange(Sender: TObject);
|
||||
procedure cbLineSeriesShowPointsChange(Sender: TObject);
|
||||
procedure cbMarksStyleChange(Sender: TObject);
|
||||
procedure cbShowInLegendChange(Sender: TObject);
|
||||
procedure cbShowMarksChange(Sender: TObject);
|
||||
procedure cbShowSeriesChange(Sender: TObject);
|
||||
procedure edMarksFormatEditingDone(Sender: TObject);
|
||||
procedure edSeriesTitleChange(Sender: TObject);
|
||||
procedure FormActivate(Sender: TObject);
|
||||
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure OKButtonClick(Sender: TObject);
|
||||
private
|
||||
FSeries: TBasicChartSeries;
|
||||
FSeriesFrame: TChartSeriesFrame;
|
||||
FSavedSeries: TBasicChartSeries;
|
||||
FSavedActive: Boolean;
|
||||
FOKClicked: Boolean;
|
||||
FLineSeriesPenFrame: TChartPenFrame;
|
||||
FLineSeriesPointerFrame: TChartPointerFrame;
|
||||
FBarSeriesBrushFrame: TChartBrushFrame;
|
||||
FBarSeriesPenFrame: TChartPenFrame;
|
||||
FAreaSeriesBrushFrame: TChartBrushFrame;
|
||||
FAreaSeriesContourPenFrame: TChartPenFrame;
|
||||
FAreaSeriesDropLinesPenFrame: TChartPenFrame;
|
||||
procedure ChangedHandler(Sender: TObject);
|
||||
protected
|
||||
function GetChart: TChart;
|
||||
|
||||
@ -100,27 +47,15 @@ implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
uses
|
||||
TAChartUtils, TATextElements, TALegend,
|
||||
ceUtils;
|
||||
|
||||
procedure TChartSeriesEditor.cbShowSeriesChange(Sender: TObject);
|
||||
procedure TChartSeriesEditor.FormActivate(Sender: TObject);
|
||||
var
|
||||
w: Integer = 0;
|
||||
h: Integer = 0;
|
||||
begin
|
||||
FSeries.Active := cbShowSeries.Checked;
|
||||
end;
|
||||
|
||||
procedure TChartSeriesEditor.edMarksFormatEditingDone(Sender: TObject);
|
||||
begin
|
||||
if (FSeries is TChartSeries) then
|
||||
try
|
||||
TChartSeries(FSeries).Marks.Format := edMarksFormat.Text;
|
||||
except
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TChartSeriesEditor.edSeriesTitleChange(Sender: TObject);
|
||||
begin
|
||||
(FSeries as TCustomChartSeries).Title := edSeriesTitle.Text;
|
||||
FSeriesFrame.GetPreferredSize(w, h);
|
||||
inc(w, FSeriesFrame.BorderSpacing.Around*2);
|
||||
inc(h, FSeriesFrame.BorderSpacing.Around*2);
|
||||
Constraints.MinHeight := h + ButtonPanel.Height + ButtonPanel.BorderSpacing.Around;
|
||||
end;
|
||||
|
||||
procedure TChartSeriesEditor.FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||
@ -135,94 +70,14 @@ end;
|
||||
|
||||
procedure TChartSeriesEditor.FormCreate(Sender: TObject);
|
||||
begin
|
||||
{ Line series page }
|
||||
FLineSeriesPenFrame := TChartPenFrame.Create(self);
|
||||
FLineSeriesPenFrame.Parent := gbLineSeriesLineStyle;
|
||||
FLineSeriesPenFrame.Name := '';
|
||||
FLineSeriesPenFrame.Align := alTop;
|
||||
FLineseriesPenFrame.Top := 1000;
|
||||
FLineSeriesPenFrame.BorderSpacing.Around := 8;
|
||||
FLineSeriesPenFrame.OnChange := @ChangedHandler;
|
||||
gbLineSeriesLineStyle.Caption := 'Connecting lines';
|
||||
gbLineSeriesLineStyle.AutoSize := true;
|
||||
FSeriesFrame := TChartSeriesFrame.Create(self);
|
||||
FSeriesFrame.Parent := Self;
|
||||
FSeriesFrame.Name := '';
|
||||
FSeriesFrame.Align := alClient;
|
||||
FSeriesFrame.BorderSpacing.Around := 8;
|
||||
FSeriesFrame.AutoSize := true;
|
||||
|
||||
FLineSeriesPointerFrame := TChartPointerFrame.Create(self);
|
||||
FLineSeriesPointerFrame.Parent := gbLineSeriesPointer;
|
||||
FLineSeriesPointerFrame.Name := '';
|
||||
FLineSeriesPointerFrame.Align := alTop;
|
||||
FLineseriesPointerFrame.Top := 1000;
|
||||
FLineSeriesPointerFrame.BorderSpacing.Around := 8;
|
||||
FLineSeriesPointerFrame.OnChange := @ChangedHandler;
|
||||
gbLineSeriesPointer.Caption := 'Series pointer';
|
||||
gbLineSeriesPointer.AutoSize := true;
|
||||
|
||||
{ Bar series page }
|
||||
FBarSeriesBrushFrame := TChartBrushFrame.Create(self);
|
||||
FBarSeriesBrushFrame.Parent := gbBarSeriesBrush;
|
||||
FBarSeriesBrushFrame.Name := '';
|
||||
FBarSeriesBrushFrame.Align := alTop;
|
||||
FBarSeriesBrushFrame.BorderSpacing.Left := 8;
|
||||
FBarSeriesBrushFrame.BorderSpacing.Right := 8;
|
||||
FBarSeriesBrushFrame.BorderSpacing.Bottom := 8;
|
||||
FBarSeriesBrushFrame.OnChange := @ChangedHandler;
|
||||
gbBarSeriesBrush.Caption := 'Bar brush';
|
||||
gbBarSeriesBrush.AutoSize := true;
|
||||
|
||||
FBarSeriesPenFrame := TChartPenFrame.Create(self);
|
||||
FBarSeriesPenFrame.Parent := gbBarSeriesBorder;
|
||||
FBarSeriesPenFrame.Name := '';
|
||||
FBarSeriesPenFrame.Align := alTop;
|
||||
FBarSeriesPenFrame.BorderSpacing.Left := 8;
|
||||
FBarSeriesPenFrame.BorderSpacing.Right := 8;
|
||||
FBarSeriesPenFrame.BorderSpacing.Bottom := 8;
|
||||
FBarSeriesPenFrame.OnChange := @ChangedHandler;
|
||||
gbBarSeriesBorder.Caption := 'Bar borders';
|
||||
gbBarSeriesBorder.AutoSize := true;
|
||||
|
||||
cbBarShape.DropdownCount := DEFAULT_DROPDOWN_COUNT;
|
||||
|
||||
{ Area series page }
|
||||
FAreaSeriesBrushFrame := TChartBrushFrame.Create(self);
|
||||
FAreaSeriesBrushFrame.Parent := gbAreaSeriesBrush;
|
||||
FAreaSeriesBrushFrame.Name := '';
|
||||
FAreaSeriesBrushFrame.Align := alTop;
|
||||
FAreaSeriesBrushFrame.BorderSpacing.Left := 8;
|
||||
FAreaSeriesBrushFrame.BorderSpacing.Right := 8;
|
||||
FAreaSeriesBrushFrame.BorderSpacing.Bottom := 8;
|
||||
FAreaSeriesBrushFrame.OnChange := @ChangedHandler;
|
||||
gbAreaSeriesBrush.Caption := 'Area fill';
|
||||
gbAreaSeriesBrush.AutoSize := true;
|
||||
|
||||
FAreaSeriesContourPenFrame := TChartPenFrame.Create(self);
|
||||
FAreaSeriesContourPenFrame.Parent := gbAreaContourPen;
|
||||
FAreaSeriesContourPenFrame.Name := '';
|
||||
FAreaSeriesContourPenFrame.Align := alTop;
|
||||
FAreaSeriesContourPenFrame.Top := 1000;
|
||||
FAreaSeriesContourPenFrame.BorderSpacing.Left := 8;
|
||||
FAreaSeriesContourPenFrame.BorderSpacing.Right := 8;
|
||||
FAreaSeriesContourPenFrame.BorderSpacing.Bottom := 8;
|
||||
FAreaSeriesContourPenFrame.OnChange := @ChangedHandler;
|
||||
gbAreaContourPen.Caption := 'Border';
|
||||
gbAreaContourPen.AutoSize := true;
|
||||
|
||||
FAreaSeriesDropLinesPenFrame := TChartPenFrame.Create(self);
|
||||
FAreaSeriesDropLinesPenFrame.Parent := gbAreaDropLinePen;
|
||||
FAreaSeriesDropLinesPenFrame.Name := '';
|
||||
FAreaSeriesDropLinesPenFrame.Align := alTop;
|
||||
FAreaSeriesDropLinesPenFrame.Top := 1000;
|
||||
FAreaSeriesDropLinesPenFrame.BorderSpacing.Left := 8;
|
||||
FAreaSeriesDropLinesPenFrame.BorderSpacing.Right := 8;
|
||||
FAreaSeriesDropLinesPenFrame.BorderSpacing.Bottom := 8;
|
||||
FAreaSeriesDropLinesPenFrame.OnChange := @ChangedHandler;
|
||||
gbAreaDropLinePen.Caption := 'Drop lines';
|
||||
gbAreaDropLinePen.AutoSize := true;
|
||||
|
||||
|
||||
{ for all }
|
||||
BoldHeaders(self);
|
||||
|
||||
cbLegendMultiplicity.DropdownCount := DEFAULT_DROPDOWN_COUNT;
|
||||
cbMarksStyle.DropdownCount := DEFAULT_DROPDOWN_COUNT;
|
||||
AutoSize := true;
|
||||
end;
|
||||
|
||||
procedure TChartSeriesEditor.FormDestroy(Sender: TObject);
|
||||
@ -230,12 +85,9 @@ begin
|
||||
FSavedSeries.Free;
|
||||
end;
|
||||
|
||||
procedure TChartSeriesEditor.FormShow(Sender: TObject);
|
||||
function TChartSeriesEditor.GetChart: TChart;
|
||||
begin
|
||||
AutoSize := true;
|
||||
Constraints.MinWidth := Width;
|
||||
Constraints.MinHeight := Height;
|
||||
AutoSize := false;
|
||||
Result := FSeries.ParentChart;
|
||||
end;
|
||||
|
||||
procedure TChartSeriesEditor.OKButtonClick(Sender: TObject);
|
||||
@ -243,85 +95,9 @@ begin
|
||||
FOKClicked := true;
|
||||
end;
|
||||
|
||||
procedure TChartSeriesEditor.cbBarShapeChange(Sender: TObject);
|
||||
begin
|
||||
if FSeries is TBarSeries then
|
||||
TBarSeries(FSeries).BarShape := TBarShape(cbBarShape.ItemIndex);
|
||||
end;
|
||||
|
||||
procedure TChartSeriesEditor.cbLegendMultiplicityChange(Sender: TObject);
|
||||
begin
|
||||
(FSeries as TCustomChartSeries).Legend.Multiplicity := TLegendMultiplicity(cbLegendMultiplicity.ItemIndex);
|
||||
end;
|
||||
|
||||
procedure TChartSeriesEditor.cbAreaShowContourLinesChange(Sender: TObject);
|
||||
begin
|
||||
if FSeries is TAreaSeries then begin
|
||||
if cbAreaShowContourLines.Checked then
|
||||
TAreaSeries(FSeries).AreaContourPen.Style := FAreaSeriesContourPenFrame.cbPenStyle.PenStyle
|
||||
else
|
||||
TAreaSeries(FSeries).AreaContourPen.Style := psClear;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TChartSeriesEditor.cbAreaShowDropLinesChange(Sender: TObject);
|
||||
begin
|
||||
if FSeries is TAreaSeries then begin
|
||||
if cbAreaShowDropLines.Checked then
|
||||
TAreaSeries(FSeries).AreaLinesPen.Style := FAreaSeriesDropLinesPenFrame.cbPenStyle.PenStyle
|
||||
else
|
||||
TAreaSeries(FSeries).AreaLinesPen.Style := psClear;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TChartSeriesEditor.cbLineSeriesShowLinesChange(Sender: TObject);
|
||||
begin
|
||||
if FSeries is TLineSeries then
|
||||
TLineSeries(FSeries).ShowLines := cbLineSeriesShowLines.Checked;
|
||||
end;
|
||||
|
||||
procedure TChartSeriesEditor.cbLineSeriesShowPointsChange(Sender: TObject);
|
||||
begin
|
||||
if FSeries is TLineSeries then
|
||||
TLineSeries(FSeries).ShowPoints := cbLineSeriesShowPoints.Checked;
|
||||
end;
|
||||
|
||||
procedure TChartSeriesEditor.cbMarksStyleChange(Sender: TObject);
|
||||
var
|
||||
series: TChartSeries;
|
||||
begin
|
||||
if (FSeries is TChartSeries) then begin
|
||||
series := TChartSeries(FSeries);
|
||||
series.Marks.Style := TSeriesMarksStyle(cbMarksStyle.ItemIndex);
|
||||
edMarksFormat.Text := series.Marks.Format;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TChartSeriesEditor.cbShowInLegendChange(Sender: TObject);
|
||||
begin
|
||||
(FSeries as TCustomChartSeries).Legend.Visible := cbShowInLegend.Checked;
|
||||
end;
|
||||
|
||||
procedure TChartSeriesEditor.cbShowMarksChange(Sender: TObject);
|
||||
begin
|
||||
if (FSeries is TChartSeries) then
|
||||
TChartSeries(FSeries).Marks.Visible := cbShowMarks.Checked;
|
||||
end;
|
||||
|
||||
procedure TChartSeriesEditor.ChangedHandler(Sender: TObject);
|
||||
begin
|
||||
GetChart.Invalidate;
|
||||
end;
|
||||
|
||||
function TChartSeriesEditor.GetChart: TChart;
|
||||
begin
|
||||
Result := FSeries.ParentChart;
|
||||
end;
|
||||
|
||||
procedure TChartSeriesEditor.Prepare(ASeries: TBasicChartSeries; ACaptionMask: String);
|
||||
var
|
||||
seriesClass: TSeriesClass;
|
||||
series: TCustomChartSeries;
|
||||
begin
|
||||
FSeries := ASeries;
|
||||
FSavedSeries.Free;
|
||||
@ -337,44 +113,8 @@ begin
|
||||
Caption := 'SERIES NOT SUPPORTED';
|
||||
exit;
|
||||
end;
|
||||
series := TCustomChartSeries(FSeries);
|
||||
|
||||
cbShowSeries.Checked := series.Active;
|
||||
cbShowInLegend.Checked := series.Legend.Visible;
|
||||
edSeriesTitle.Text := series.Title;
|
||||
cbLegendMultiplicity.ItemIndex := ord(series.Legend.Multiplicity);
|
||||
|
||||
gbMarks.Visible := (FSeries is TChartSeries);
|
||||
if (FSeries is TChartSeries) then begin
|
||||
cbMarksStyle.ItemIndex := ord(TChartSeries(FSeries).Marks.Style);
|
||||
edMarksFormat.Text := TChartSeries(FSeries).Marks.Format;
|
||||
cbShowMarks.Checked := TChartSeries(FSeries).Marks.Visible;
|
||||
end;
|
||||
|
||||
if ASeries is TLineSeries then begin
|
||||
nbSeriesTypes.PageIndex := 0;
|
||||
cbLineSeriesShowLines.Checked := TLineSeries(ASeries).ShowLines;
|
||||
cbLineSeriesShowPoints.Checked := TLineSeries(ASeries).ShowPoints;
|
||||
FLineSeriesPenFrame.Prepare(TLineSeries(ASeries).LinePen);
|
||||
FLineSeriesPointerFrame.Prepare(TLineSeries(ASeries).Pointer);
|
||||
end;
|
||||
|
||||
if ASeries is TBarSeries then begin
|
||||
nbSeriesTypes.PageIndex := 1;
|
||||
FBarSeriesPenFrame.Prepare(TBarSeries(ASeries).BarPen);
|
||||
FBarSeriesBrushFrame.Prepare(TBarSeries(ASeries).BarBrush);
|
||||
cbBarShape.ItemIndex := ord(TBarSeries(ASeries).BarShape);
|
||||
end;
|
||||
|
||||
if ASeries is TAreaSeries then begin
|
||||
nbSeriesTypes.PageIndex := 2;
|
||||
cbAreaShowContourLines.Checked := TAreaSeries(ASeries).AreaContourPen.Style <> psClear;
|
||||
cbAreaShowDropLines.Checked := TAreaSeries(ASeries).AreaLinesPen.Style <> psClear;
|
||||
FAreaSeriesBrushFrame.Prepare(TAreaSeries(ASeries).AreaBrush);
|
||||
FAreaSeriesContourPenFrame.Prepare(TAreaSeries(ASeries).AreaContourPen);
|
||||
FAreaSeriesDropLinesPenFrame.Prepare(TAreaSeries(ASeries).AreaLinesPen);
|
||||
end;
|
||||
|
||||
FSeriesFrame.Prepare(ASeries);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
unit ceTitleFootFrame;
|
||||
|
||||
{$mode ObjFPC}{$H+}
|
||||
{.$DEFINE WYSIWYG_TITLE}
|
||||
|
||||
interface
|
||||
|
||||
@ -105,8 +106,10 @@ end;
|
||||
procedure TChartTitleFootFrame.ChangedHandler(Sender: TObject);
|
||||
begin
|
||||
GetChart.Invalidate;
|
||||
{$IFDEF WYSIWYG_TITLE}
|
||||
mmoText.Font.Assign(FTitle.Font);
|
||||
mmoText.Color := FTitle.Brush.Color;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
function TChartTitleFootFrame.GetAlignment: TAlignment;
|
||||
@ -137,8 +140,10 @@ begin
|
||||
|
||||
cbShow.Checked := ATitle.Visible;
|
||||
mmoText.Lines.Assign(ATitle.Text);
|
||||
{$IFDEF WYSIWYG_TITLE}
|
||||
mmoText.Font.Assign(ATitle.Font);
|
||||
mmoText.Font.Orientation := 0;
|
||||
{$ENDIF}
|
||||
|
||||
SetAlignment(ATitle.Alignment);
|
||||
|
||||
|
||||
@ -142,9 +142,17 @@
|
||||
<Filename Value="ceaxisframe.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="ChartAxisFrame"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Frame"/>
|
||||
<UnitName Value="ceAxisFrame"/>
|
||||
</Unit>
|
||||
<Unit>
|
||||
<Filename Value="ceseriesframe.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="ChartSeriesFrame"/>
|
||||
<ResourceBaseClass Value="Frame"/>
|
||||
<UnitName Value="ceSeriesFrame"/>
|
||||
</Unit>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
|
||||
@ -7,7 +7,8 @@ uses
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms, ceMain, ceSeriesDlg, cePointerFrame, ceTitleFootFrame, ceAxisFrame;
|
||||
Forms, ceMain, ceSeriesDlg, cePointerFrame, ceTitleFootFrame, ceAxisFrame,
|
||||
ceSeriesFrame;
|
||||
|
||||
{$R *.res}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user