TAChart: Fix dark mode and layout issues in ChartEditor demo under Linux.

This commit is contained in:
wp_xyz 2021-08-04 21:55:47 +02:00
parent ede35b0f31
commit 2a6d558f42
16 changed files with 309 additions and 306 deletions

View File

@ -6,8 +6,8 @@ object ChartAxisFrame: TChartAxisFrame
ClientHeight = 471
ClientWidth = 646
TabOrder = 0
DesignLeft = 581
DesignTop = 248
DesignLeft = 1003
DesignTop = 204
object PanelTop: TPanel
Left = 0
Height = 25
@ -40,9 +40,9 @@ object ChartAxisFrame: TChartAxisFrame
Height = 446
Top = 25
Width = 646
ActivePage = pgLine
ActivePage = pgTitle
Align = alClient
TabIndex = 3
TabIndex = 0
TabOrder = 1
OnChanging = PageControlChanging
object pgTitle: TTabSheet
@ -252,7 +252,7 @@ object ChartAxisFrame: TChartAxisFrame
AnchorSideTop.Control = pgLabels
AnchorSideRight.Control = Bevel2
Left = 8
Height = 150
Height = 142
Top = 8
Width = 303
Anchors = [akTop, akLeft, akRight]
@ -260,7 +260,7 @@ object ChartAxisFrame: TChartAxisFrame
BorderSpacing.Left = 8
BorderSpacing.Top = 8
Caption = 'Axis limits'
ClientHeight = 130
ClientHeight = 122
ClientWidth = 299
TabOrder = 0
object lblAutomatic: TLabel
@ -346,7 +346,7 @@ object ChartAxisFrame: TChartAxisFrame
Top = 95
Width = 63
BorderSpacing.Top = 14
BorderSpacing.Bottom = 16
BorderSpacing.Bottom = 8
Caption = 'Inverted'
OnChange = cbInvertedChange
TabOrder = 4
@ -399,14 +399,14 @@ object ChartAxisFrame: TChartAxisFrame
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Bevel2
Left = 8
Height = 113
Top = 168
Height = 109
Top = 160
Width = 303
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BorderSpacing.Top = 10
Caption = 'Labels'
ClientHeight = 93
ClientHeight = 89
ClientWidth = 299
TabOrder = 1
object cbLabelsVisible: TCheckBox
@ -462,7 +462,7 @@ object ChartAxisFrame: TChartAxisFrame
Width = 130
Alignment = taRightJustify
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Bottom = 12
BorderSpacing.Bottom = 8
MaxValue = 1000
OnChange = seLabelDistanceChange
TabOrder = 2
@ -496,15 +496,15 @@ object ChartAxisFrame: TChartAxisFrame
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Side = asrBottom
Left = 8
Height = 88
Top = 291
Height = 90
Top = 279
Width = 303
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BorderSpacing.Top = 10
BorderSpacing.Bottom = 8
Caption = 'Ticks'
ClientHeight = 68
ClientHeight = 70
ClientWidth = 299
TabOrder = 2
object seTickLength: TSpinEdit
@ -513,12 +513,12 @@ object ChartAxisFrame: TChartAxisFrame
AnchorSideTop.Control = gbTicks
Left = 99
Height = 23
Top = 2
Top = 8
Width = 130
Alignment = taRightJustify
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 16
BorderSpacing.Top = 2
BorderSpacing.Top = 8
MaxValue = 1000
OnChange = seTickLengthChange
TabOrder = 0
@ -529,12 +529,12 @@ object ChartAxisFrame: TChartAxisFrame
AnchorSideTop.Side = asrBottom
Left = 99
Height = 23
Top = 33
Top = 39
Width = 130
Alignment = taRightJustify
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 8
BorderSpacing.Bottom = 12
BorderSpacing.Bottom = 8
MaxValue = 1000
OnChange = seTickInnerLengthChange
TabOrder = 1
@ -545,7 +545,7 @@ object ChartAxisFrame: TChartAxisFrame
AnchorSideTop.Side = asrCenter
Left = 16
Height = 15
Top = 6
Top = 12
Width = 67
BorderSpacing.Left = 16
Caption = 'Outer length'
@ -556,7 +556,7 @@ object ChartAxisFrame: TChartAxisFrame
AnchorSideTop.Side = asrCenter
Left = 16
Height = 15
Top = 37
Top = 43
Width = 64
Caption = 'Inner length'
end
@ -565,7 +565,7 @@ object ChartAxisFrame: TChartAxisFrame
AnchorSideRight.Side = asrBottom
Left = 247
Height = 25
Top = 20
Top = 22
Width = 32
Anchors = [akTop, akRight]
BorderSpacing.Right = 8
@ -583,24 +583,24 @@ object ChartAxisFrame: TChartAxisFrame
object gbGrid: TGroupBox
AnchorSideLeft.Control = pgGrid
AnchorSideTop.Control = pgGrid
AnchorSideRight.Control = gbFrame
AnchorSideRight.Side = asrBottom
AnchorSideRight.Control = Bevel3
Left = 8
Height = 115
Top = 8
Width = 277
Width = 303
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 8
BorderSpacing.Top = 8
Caption = 'Grid lines'
ClientHeight = 95
ClientWidth = 273
ClientWidth = 299
Constraints.MinWidth = 277
TabOrder = 0
object cbGridVisible: TCheckBox
Left = 16
Height = 19
Top = 8
Width = 241
Width = 267
Align = alTop
BorderSpacing.Left = 16
BorderSpacing.Top = 8
@ -611,6 +611,15 @@ object ChartAxisFrame: TChartAxisFrame
TabOrder = 0
end
end
object Bevel3: TBevel
AnchorSideLeft.Control = pgGrid
AnchorSideLeft.Side = asrCenter
Left = 311
Height = 50
Top = 24
Width = 16
Shape = bsSpacer
end
end
object pgLine: TTabSheet
Caption = 'Line'
@ -619,23 +628,23 @@ object ChartAxisFrame: TChartAxisFrame
object gbFrame: TGroupBox
AnchorSideLeft.Control = pgLine
AnchorSideTop.Control = pgLine
AnchorSideRight.Control = gbArrow
AnchorSideRight.Control = Bevel4
Left = 8
Height = 119
Top = 8
Width = 446
Width = 303
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 8
BorderSpacing.Top = 8
Caption = 'gbFrame'
ClientHeight = 99
ClientWidth = 442
ClientWidth = 299
TabOrder = 0
object cbFrameVisible: TCheckBox
Left = 16
Height = 19
Top = 8
Width = 410
Width = 267
Align = alTop
BorderSpacing.Left = 16
BorderSpacing.Top = 8
@ -655,18 +664,18 @@ object ChartAxisFrame: TChartAxisFrame
Left = 8
Height = 137
Top = 143
Width = 446
Width = 303
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 16
Caption = 'gbAxisLine'
ClientHeight = 117
ClientWidth = 442
ClientWidth = 299
TabOrder = 1
object cbAxisLineVisible: TCheckBox
Left = 16
Height = 19
Top = 8
Width = 410
Width = 267
Align = alTop
BorderSpacing.Left = 16
BorderSpacing.Top = 8
@ -678,21 +687,28 @@ object ChartAxisFrame: TChartAxisFrame
end
end
object gbArrow: TGroupBox
AnchorSideLeft.Control = gbFrame
AnchorSideLeft.Control = Bevel4
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = gbFrame
AnchorSideRight.Control = pgLine
AnchorSideRight.Side = asrBottom
Left = 478
Left = 327
Height = 131
Top = 8
Width = 152
Anchors = [akTop, akRight]
BorderSpacing.Left = 24
Width = 166
BorderSpacing.Right = 8
Caption = 'gbArrow'
TabOrder = 2
end
object Bevel4: TBevel
AnchorSideLeft.Control = pgLine
AnchorSideLeft.Side = asrCenter
Left = 311
Height = 50
Top = 24
Width = 16
Shape = bsSpacer
end
end
end
end

View File

@ -17,6 +17,8 @@ type
TChartAxisFrame = class(TFrame)
Bevel1: TBevel;
Bevel2: TBevel;
Bevel3: TBevel;
Bevel4: TBevel;
cbAutoMax: TCheckBox;
cbAutoMin: TCheckBox;
cbAxisLineVisible: TCheckBox;
@ -138,8 +140,8 @@ begin
FTitleFontFrame := TChartFontFrame.Create(self);
FTitleFontFrame.Name := '';
FTitleFontFrame.Align := alClient;
FTitleFontFrame.BorderSpacing.Left := 8;
FTitleFontFrame.BorderSpacing.Right := 8;
FTitleFontFrame.BorderSpacing.Around := 8;
FTitleFontFrame.AutoSize := true;
FTitleFontFrame.Parent := gbTitleFont;
gbTitleFont.AutoSize := true;
gbTitleFont.Caption := 'Font';
@ -147,9 +149,7 @@ begin
FTitleShapeBrushPenMarginsFrame := TChartShapeBrushPenMarginsFrame.Create(self);
FTitleShapeBrushPenMarginsFrame.Name := '';
FTitleShapeBrushPenMarginsFrame.Align := alClient;
FTitleShapeBrushPenMarginsFrame.BorderSpacing.Left := 8;
FTitleShapeBrushPenMarginsFrame.BorderSpacing.Right := 8;
FTitleShapeBrushPenMarginsFrame.BorderSpacing.Bottom := 8;
FTitleShapeBrushPenMarginsFrame.BorderSpacing.Around := 8;
FTitleShapeBrushPenMarginsFrame.OnShapeChange := @TitleShapeChangedHandler;
FTitleShapeBrushPenMarginsFrame.AutoSize := true;
FTitleShapeBrushPenMarginsFrame.Parent := gbTitleShapeBrushPenMargins;
@ -159,8 +159,7 @@ begin
FLabelFontFrame := TChartFontFrame.Create(self);
FLabelFontFrame.Name := '';
FLabelFontFrame.Align := alClient;
FLabelFontFrame.BorderSpacing.Left := 8;
FLabelFontFrame.BorderSpacing.Right := 8;
FLabelFontFrame.BorderSpacing.Around := 8;
FLabelFontFrame.Parent := gbLabelFont;
FLabelFontFrame.OnChange := @LabelFontChangedHandler;
gbLabelFont.AutoSize := true;
@ -169,9 +168,7 @@ begin
FLabelShapeBrushPenMarginsFrame := TChartShapeBrushPenMarginsFrame.Create(self);
FLabelShapeBrushPenMarginsFrame.Name := '';
FLabelShapeBrushPenMarginsFrame.Align := alClient;
FLabelShapeBrushPenMarginsFrame.BorderSpacing.Left := 8;
FLabelShapeBrushPenMarginsFrame.BorderSpacing.Right := 8;
FLabelShapeBrushPenMarginsFrame.BorderSpacing.Bottom := 8;
FLabelShapeBrushPenMarginsFrame.BorderSpacing.Around := 8;
FLabelShapeBrushPenMarginsFrame.OnShapeChange := @LabelShapeChangedHandler;
FLabelShapeBrushPenMarginsFrame.AutoSize := true;
FLabelShapeBrushPenMarginsFrame.Parent := gbShapeFillBorder;
@ -182,9 +179,7 @@ begin
FGridPenFrame.Name := '';
FGridPenFrame.Align := alTop;
FGridPenFrame.Top := 1000;
FGridPenFrame.BorderSpacing.Left := 16;
FGridPenFrame.BorderSpacing.Right := 16;
FGridPenFrame.BorderSpacing.Bottom := 16;
FGridPenFrame.BorderSpacing.Around := 8;
FGridPenFrame.Parent := gbGrid;
FGridPenFrame.OnChange := @ChangedHandler;
gbGrid.AutoSize := true;
@ -194,9 +189,7 @@ begin
FFramePenFrame.Name := '';
FFramePenFrame.Align := alTop;
FFramePenFrame.Top := 1000;
FFramePenFrame.BorderSpacing.Left := 16;
FFramePenFrame.BorderSpacing.Right := 16;
FFramePenFrame.BorderSpacing.Bottom := 16;
FFramePenFrame.BorderSpacing.Around := 8;
FFramePenFrame.Parent := gbFrame;
// FFramePenFrame.OnChange := @ChangedHandler;
gbFrame.AutoSize := true;
@ -206,9 +199,7 @@ begin
FAxisLinePenFrame.Name := '';
FAxisLinePenFrame.Align := alTop;
FAxisLinePenFrame.Top := 1000;
FAxisLinePenFrame.BorderSpacing.Left := 16;
FAxisLinePenFrame.BorderSpacing.Right := 16;
FAxisLinePenFrame.BorderSpacing.Bottom := 16;
FAxisLinePenFrame.BorderSpacing.Around := 8;
FAxisLinePenFrame.Parent := gbAxisLine;
// FAxisLinePenFrame.OnChange := @ChangedHandler;
gbAxisLine.AutoSize := true;
@ -217,10 +208,7 @@ begin
FArrowFrame := TChartArrowFrame.Create(self);
FArrowFrame.Name := '';
FArrowFrame.Align := alClient;
FArrowFrame.BorderSpacing.Top := 8;
FArrowFrame.BorderSpacing.Left := 16;
FArrowFrame.BorderSpacing.Right := 16;
FArrowFrame.BorderSpacing.Bottom := 16;
FArrowFrame.BorderSpacing.Around := 8;
FArrowFrame.AutoSize := true;
FArrowFrame.Parent := gbArrow;
gbArrow.AutoSize := true;
@ -239,9 +227,9 @@ var
h: Integer = 0;
begin
gbTitleShapeBrushPenMargins.GetPreferredsize(w, h);
inc(w, FTitleShapeBrushPenMarginsFrame.BorderSpacing.Left);
PreferredWidth :=
Max(w, gbTitleFont.Width) * 2 +
// inc(w, FTitleShapeBrushPenMarginsFrame.BorderSpacing.Around);
PreferredWidth := w*2 +
// Max(w, gbTitleFont.Width) * 2 +
Bevel1.Width +
TitleMemoPanel.BorderSpacing.Around * 2;

View File

@ -13,19 +13,18 @@ object ChartBrushFrame: TChartBrushFrame
AnchorSideLeft.Control = lblBrushStyle
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Owner
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = cbBrushColor
Left = 49
Height = 22
Top = 1
Top = 0
Width = 142
Mode = ccmBrushStyle
Options = [ccoNames, ccoPatternPen]
PenPattern = '1|1'
PointerStyle = psNone
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 24
ItemHeight = 16
ItemIndex = 0
TabOrder = 0
OnChange = cbBrushStyleChange
end
@ -35,7 +34,7 @@ object ChartBrushFrame: TChartBrushFrame
AnchorSideTop.Side = asrCenter
Left = 0
Height = 15
Top = 5
Top = 4
Width = 25
Caption = 'Style'
end
@ -47,7 +46,7 @@ object ChartBrushFrame: TChartBrushFrame
AnchorSideRight.Side = asrBottom
Left = 197
Height = 25
Top = 0
Top = -1
Width = 31
Anchors = [akTop, akRight]
BorderSpacing.Left = 6

View File

@ -80,8 +80,8 @@ object ChartLegendFrame: TChartLegendFrame
AnchorSideBottom.Side = asrBottom
Left = 0
Height = 72
Top = 128
Width = 127
Top = 136
Width = 130
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 16
BorderSpacing.Right = 16
@ -95,10 +95,10 @@ object ChartLegendFrame: TChartLegendFrame
AnchorSideRight.Control = gbAlignment
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Side = asrBottom
Left = 143
Left = 146
Height = 88
Top = 128
Width = 153
Top = 136
Width = 156
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 16
Caption = 'gbBorder'
@ -110,8 +110,8 @@ object ChartLegendFrame: TChartLegendFrame
AnchorSideTop.Control = gbAlignment
AnchorSideBottom.Control = gbAlignment
AnchorSideBottom.Side = asrBottom
Left = 316
Height = 112
Left = 322
Height = 120
Top = 0
Width = 216
Anchors = [akTop, akLeft, akBottom]
@ -125,46 +125,48 @@ object ChartLegendFrame: TChartLegendFrame
AnchorSideBottom.Control = gbFont
AnchorSideBottom.Side = asrBottom
Left = 0
Height = 112
Height = 120
Top = 0
Width = 296
Width = 302
AutoSize = True
Caption = 'Position'
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
ChildSizing.HorizontalSpacing = 8
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 3
ClientHeight = 92
ClientWidth = 292
ClientHeight = 100
ClientWidth = 298
TabOrder = 0
object rbTopLeft: TRadioButton
Left = 6
Height = 17
Height = 19
Top = 6
Width = 86
Width = 82
Caption = 'top/left'
OnClick = gbAlignmentClick
TabOrder = 0
end
object rbTopCenter: TRadioButton
Tag = 3
Left = 92
Height = 17
Left = 96
Height = 19
Top = 6
Width = 102
Width = 98
Caption = 'top/center'
OnClick = gbAlignmentClick
TabOrder = 1
end
object rbTopRight: TRadioButton
Tag = 5
Left = 194
Height = 17
Left = 202
Height = 19
Top = 6
Width = 92
Width = 90
Caption = 'top/right'
Checked = True
OnClick = gbAlignmentClick
@ -174,27 +176,27 @@ object ChartLegendFrame: TChartLegendFrame
object rbCenterLeft: TRadioButton
Tag = 1
Left = 6
Height = 46
Top = 23
Width = 86
Height = 50
Top = 25
Width = 82
Caption = 'center/left'
OnClick = gbAlignmentClick
TabOrder = 3
end
object Bevel1: TBevel
Tag = 999
Left = 92
Height = 46
Top = 23
Width = 102
Left = 96
Height = 50
Top = 25
Width = 98
Shape = bsSpacer
end
object rbCenterRight: TRadioButton
Tag = 6
Left = 194
Height = 46
Top = 23
Width = 92
Left = 202
Height = 50
Top = 25
Width = 90
Caption = 'center/right'
OnClick = gbAlignmentClick
TabOrder = 4
@ -202,29 +204,29 @@ object ChartLegendFrame: TChartLegendFrame
object rbBottomLeft: TRadioButton
Tag = 2
Left = 6
Height = 17
Top = 69
Width = 86
Height = 19
Top = 75
Width = 82
Caption = 'bottom/left'
OnClick = gbAlignmentClick
TabOrder = 5
end
object rbBottomCenter: TRadioButton
Tag = 4
Left = 92
Height = 17
Top = 69
Width = 102
Left = 96
Height = 19
Top = 75
Width = 98
Caption = 'bottom/center'
OnClick = gbAlignmentClick
TabOrder = 6
end
object rbBottomRight: TRadioButton
Tag = 7
Left = 194
Height = 17
Top = 69
Width = 92
Left = 202
Height = 19
Top = 75
Width = 90
Caption = 'bottom/right'
OnClick = gbAlignmentClick
TabOrder = 7
@ -237,14 +239,15 @@ object ChartLegendFrame: TChartLegendFrame
AnchorSideRight.Control = gbBackground
AnchorSideRight.Side = asrBottom
Left = 0
Height = 83
Top = 216
Width = 127
Height = 84
Top = 224
Width = 130
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BorderSpacing.Top = 16
Caption = 'Margins'
ClientHeight = 63
ClientWidth = 123
ClientHeight = 64
ClientWidth = 126
TabOrder = 4
object lblMarginX: TLabel
AnchorSideLeft.Control = gbMargins
@ -268,7 +271,7 @@ object ChartLegendFrame: TChartLegendFrame
Left = 31
Height = 23
Top = 4
Width = 76
Width = 79
Alignment = taRightJustify
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 4
@ -301,7 +304,7 @@ object ChartLegendFrame: TChartLegendFrame
Left = 31
Height = 23
Top = 33
Width = 76
Width = 79
Alignment = taRightJustify
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
@ -318,9 +321,9 @@ object ChartLegendFrame: TChartLegendFrame
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = gbFont
AnchorSideRight.Side = asrBottom
Left = 316
Left = 322
Height = 165
Top = 128
Top = 136
Width = 216
Anchors = [akTop, akLeft, akRight]
AutoSize = True
@ -480,9 +483,9 @@ object ChartLegendFrame: TChartLegendFrame
AnchorSideLeft.Control = gbAlignment
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = gbBorder
Left = 143
Left = 146
Height = 42
Top = 128
Top = 136
Width = 10
Shape = bsSpacer
end

View File

@ -36,17 +36,14 @@ object MainForm: TMainForm
Title.Caption = 'x axis'
Title.LabelBrush.Style = bsClear
end>
BackColor = clWhite
Foot.Alignment = taLeftJustify
Foot.Brush.Color = clBtnFace
Foot.Font.Color = clBlue
Foot.Brush.Color = clForm
Foot.Text.Strings = (
'Created by Lazarus and TAChart'
)
Foot.Visible = True
Legend.Visible = True
Title.Brush.Color = clBtnFace
Title.Font.Color = clBlue
Title.Brush.Color = clForm
Title.Text.Strings = (
'TAChart'
)

View File

@ -7,22 +7,8 @@ object ChartPointerFrame: TChartPointerFrame
ClientHeight = 194
ClientWidth = 320
TabOrder = 0
DesignLeft = 658
DesignTop = 295
object Label1: TLabel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
Left = 12
Height = 15
Top = 0
Width = 70
BorderSpacing.Left = 12
Caption = 'Pointer style'
Color = clForm
Font.Style = [fsBold]
ParentFont = False
Transparent = False
end
DesignLeft = 822
DesignTop = 312
object GroupBox1: TGroupBox
Left = 0
Height = 56

View File

@ -18,7 +18,6 @@ type
GroupBox1: TGroupBox;
gbPointerBrush: TGroupBox;
gbPointerPen: TGroupBox;
Label1: TLabel;
lblPointerSize: TLabel;
sePointerSize: TSpinEdit;
procedure cbPointerStyleChange(Sender: TObject);
@ -51,24 +50,22 @@ begin
cbPointerStyle.DropdownCount := DEFAULT_DROPDOWN_COUNT;
FPointerBrushFrame := TChartBrushFrame.Create(Self);
FPointerBrushFrame.Parent := gbPointerBrush;
FPointerBrushFrame.Name := '';
FPointerBrushFrame.Align := alClient;
FPointerBrushFrame.BorderSpacing.Left := 8;
FPointerBrushFrame.BorderSpacing.Right := 8;
FPointerBrushFrame.BorderSpacing.Bottom := 8;
FPointerBrushFrame.AutoSize := true;
FPointerBrushFrame.BorderSpacing.Around := 8;
FPointerBrushFrame.OnChange := @ChangedHandler;
FPointerBrushFrame.Parent := gbPointerBrush;
gbPointerBrush.Caption := 'Fill';
gbPointerBrush.AutoSize := true;
FPointerPenFrame := TChartPenFrame.Create(self);
FPointerPenFrame.Parent := gbPointerPen;
FPointerPenFrame.Name := '';
FPointerPenFrame.Align := alClient;
FPointerPenFrame.borderspacing.Left := 8;
FPointerPenFrame.BorderSpacing.Right := 8;
FPointerPenFrame.BorderSpacing.Bottom := 8;
FPointerPenFrame.AutoSize := true;
FPointerPenFrame.borderspacing.Around := 8;
FPointerPenFrame.OnChange := @ChangedHandler;
FPointerPenFrame.Parent := gbPointerPen;
gbPointerPen.caption := 'Border';
gbPointerPen.AutoSize := true;

View File

@ -10,14 +10,14 @@ object ChartSeriesFrame: TChartSeriesFrame
DesignTop = 344
object PanelTop: TPanel
Left = 0
Height = 142
Height = 146
Top = 0
Width = 589
Align = alTop
AutoSize = True
BorderSpacing.Bottom = 12
BevelOuter = bvNone
ClientHeight = 142
ClientHeight = 146
ClientWidth = 589
TabOrder = 0
object cbShowSeries: TCheckBox
@ -40,13 +40,13 @@ object ChartSeriesFrame: TChartSeriesFrame
AnchorSideBottom.Control = gbMarks
AnchorSideBottom.Side = asrBottom
Left = 0
Height = 117
Height = 121
Top = 25
Width = 286
Anchors = [akTop, akLeft, akRight, akBottom]
AutoSize = True
Caption = 'Legend text (Series title)'
ClientHeight = 97
ClientHeight = 101
ClientWidth = 282
TabOrder = 1
object edSeriesTitle: TEdit
@ -56,11 +56,11 @@ object ChartSeriesFrame: TChartSeriesFrame
AnchorSideRight.Side = asrBottom
Left = 8
Height = 23
Top = 4
Top = 8
Width = 266
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 8
BorderSpacing.Top = 4
BorderSpacing.Top = 8
BorderSpacing.Right = 8
OnChange = edSeriesTitleChange
TabOrder = 0
@ -72,7 +72,7 @@ object ChartSeriesFrame: TChartSeriesFrame
AnchorSideTop.Side = asrBottom
Left = 8
Height = 19
Top = 33
Top = 37
Width = 133
BorderSpacing.Top = 6
Caption = 'Show series in legend'
@ -88,7 +88,7 @@ object ChartSeriesFrame: TChartSeriesFrame
AnchorSideRight.Side = asrBottom
Left = 87
Height = 23
Top = 58
Top = 62
Width = 187
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 8
@ -111,7 +111,7 @@ object ChartSeriesFrame: TChartSeriesFrame
AnchorSideTop.Side = asrCenter
Left = 8
Height = 15
Top = 62
Top = 66
Width = 71
Caption = 'Legend items'
end
@ -126,13 +126,13 @@ object ChartSeriesFrame: TChartSeriesFrame
AnchorSideBottom.Control = gbLegendText
AnchorSideBottom.Side = asrBottom
Left = 302
Height = 117
Height = 121
Top = 25
Width = 287
Anchors = [akTop, akLeft, akRight]
AutoSize = True
Caption = 'Marks'
ClientHeight = 97
ClientHeight = 101
ClientWidth = 283
TabOrder = 2
object lblSeriesMarksStyle: TLabel
@ -141,7 +141,7 @@ object ChartSeriesFrame: TChartSeriesFrame
AnchorSideTop.Side = asrCenter
Left = 8
Height = 15
Top = 8
Top = 12
Width = 25
BorderSpacing.Left = 8
Caption = 'Style'
@ -153,10 +153,10 @@ object ChartSeriesFrame: TChartSeriesFrame
AnchorSideRight.Side = asrBottom
Left = 54
Height = 23
Top = 4
Top = 8
Width = 221
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 4
BorderSpacing.Top = 8
BorderSpacing.Right = 8
ItemHeight = 15
ItemIndex = 1
@ -184,7 +184,7 @@ object ChartSeriesFrame: TChartSeriesFrame
AnchorSideTop.Side = asrCenter
Left = 8
Height = 15
Top = 37
Top = 41
Width = 38
Caption = 'Format'
end
@ -197,7 +197,7 @@ object ChartSeriesFrame: TChartSeriesFrame
AnchorSideRight.Side = asrBottom
Left = 54
Height = 23
Top = 33
Top = 37
Width = 221
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 8
@ -213,7 +213,7 @@ object ChartSeriesFrame: TChartSeriesFrame
AnchorSideTop.Side = asrCenter
Left = 8
Height = 19
Top = 67
Top = 71
Width = 156
BorderSpacing.Top = 6
Caption = 'Show at series data points'
@ -227,7 +227,7 @@ object ChartSeriesFrame: TChartSeriesFrame
AnchorSideRight.Side = asrBottom
Left = 212
Height = 25
Top = 64
Top = 68
Width = 63
Anchors = [akTop, akRight]
AutoSize = True
@ -250,10 +250,10 @@ object ChartSeriesFrame: TChartSeriesFrame
end
object nbSeriesTypes: TNotebook
Left = 0
Height = 305
Top = 154
Height = 301
Top = 158
Width = 589
PageIndex = 0
PageIndex = 2
Align = alClient
TabOrder = 1
object pgLineSeries: TPage
@ -273,11 +273,11 @@ object ChartSeriesFrame: TChartSeriesFrame
object cbLineSeriesShowLines: TCheckBox
Left = 8
Height = 19
Top = 6
Top = 8
Width = 274
Align = alTop
BorderSpacing.Left = 8
BorderSpacing.Top = 6
BorderSpacing.Top = 8
Caption = 'Visible'
OnChange = cbLineSeriesShowLinesChange
TabOrder = 0
@ -301,11 +301,11 @@ object ChartSeriesFrame: TChartSeriesFrame
object cbLineSeriesShowPoints: TCheckBox
Left = 8
Height = 19
Top = 6
Top = 8
Width = 275
Align = alTop
BorderSpacing.Left = 8
BorderSpacing.Top = 6
BorderSpacing.Top = 8
Caption = 'Visible'
OnChange = cbLineSeriesShowPointsChange
TabOrder = 0
@ -357,13 +357,13 @@ object ChartSeriesFrame: TChartSeriesFrame
AnchorSideBottom.Control = gbBarSeriesBrush
AnchorSideBottom.Side = asrBottom
Left = 302
Height = 52
Height = 59
Top = 0
Width = 287
Anchors = [akTop, akLeft, akRight, akBottom]
Anchors = [akTop, akLeft, akRight]
AutoSize = True
Caption = 'Bar shape'
ClientHeight = 32
ClientHeight = 39
ClientWidth = 283
TabOrder = 1
object cbBarShape: TComboBox
@ -373,12 +373,10 @@ object ChartSeriesFrame: TChartSeriesFrame
AnchorSideRight.Side = asrBottom
Left = 8
Height = 23
Top = 0
Top = 8
Width = 267
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
BorderSpacing.Around = 8
ItemHeight = 15
ItemIndex = 0
Items.Strings = (
@ -436,11 +434,9 @@ object ChartSeriesFrame: TChartSeriesFrame
Left = 8
Height = 19
Top = 8
Width = 274
Width = 266
Align = alTop
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Bottom = 8
BorderSpacing.Around = 8
Caption = 'Visible'
OnChange = cbAreaShowContourLinesChange
TabOrder = 0
@ -476,11 +472,9 @@ object ChartSeriesFrame: TChartSeriesFrame
Left = 8
Height = 19
Top = 8
Width = 275
Width = 267
Align = alTop
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Bottom = 8
BorderSpacing.Around = 8
Caption = 'Visible'
OnChange = cbAreaShowDropLinesChange
TabOrder = 0

View File

@ -97,8 +97,7 @@ begin
FLineSeriesPenFrame := TChartPenFrame.Create(self);
FLineSeriesPenFrame.Parent := gbLineSeriesLineStyle;
FLineSeriesPenFrame.Name := '';
FLineSeriesPenFrame.Align := alTop;
FLineseriesPenFrame.Top := 1000;
FLineSeriesPenFrame.Align := alClient;
FLineSeriesPenFrame.BorderSpacing.Around := 8;
FLineSeriesPenFrame.OnChange := @ChangedHandler;
gbLineSeriesLineStyle.Caption := 'Connecting lines';
@ -107,8 +106,8 @@ begin
FLineSeriesPointerFrame := TChartPointerFrame.Create(self);
FLineSeriesPointerFrame.Parent := gbLineSeriesPointer;
FLineSeriesPointerFrame.Name := '';
FLineSeriesPointerFrame.Align := alTop;
FLineseriesPointerFrame.Top := 1000;
FLineSeriesPointerFrame.AutoSize := true;
FLineSeriesPointerFrame.Align := alClient;
FLineSeriesPointerFrame.BorderSpacing.Around := 8;
FLineSeriesPointerFrame.OnChange := @ChangedHandler;
gbLineSeriesPointer.Caption := 'Series pointer';
@ -118,10 +117,8 @@ begin
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.Align := alClient;
FBarSeriesBrushFrame.BorderSpacing.Around := 8;
FBarSeriesBrushFrame.OnChange := @ChangedHandler;
gbBarSeriesBrush.Caption := 'Bar brush';
gbBarSeriesBrush.AutoSize := true;
@ -129,10 +126,8 @@ begin
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.Align := alClient;
FBarSeriesPenFrame.BorderSpacing.Around := 8;
FBarSeriesPenFrame.OnChange := @ChangedHandler;
gbBarSeriesBorder.Caption := 'Bar borders';
gbBarSeriesBorder.AutoSize := true;
@ -143,10 +138,8 @@ begin
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.Align := alClient;
FAreaSeriesBrushFrame.BorderSpacing.Around := 8;
FAreaSeriesBrushFrame.OnChange := @ChangedHandler;
gbAreaSeriesBrush.Caption := 'Area fill';
gbAreaSeriesBrush.AutoSize := true;
@ -154,11 +147,8 @@ begin
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.Align := alClient;
FAreaSeriesContourPenFrame.BorderSpacing.Around := 8;
FAreaSeriesContourPenFrame.OnChange := @ChangedHandler;
gbAreaContourPen.Caption := 'Border';
gbAreaContourPen.AutoSize := true;
@ -166,11 +156,8 @@ begin
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.Align := alClient;
FAreaSeriesDropLinesPenFrame.BorderSpacing.Around := 8;
FAreaSeriesDropLinesPenFrame.OnChange := @ChangedHandler;
gbAreaDropLinePen.Caption := 'Drop lines';
gbAreaDropLinePen.AutoSize := true;

View File

@ -6,8 +6,8 @@ object ChartShapeBrushPenMarginsFrame: TChartShapeBrushPenMarginsFrame
ClientHeight = 237
ClientWidth = 276
TabOrder = 0
DesignLeft = 1498
DesignTop = 388
DesignLeft = 1026
DesignTop = 386
object cmbShape: TComboBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
@ -33,70 +33,35 @@ object ChartShapeBrushPenMarginsFrame: TChartShapeBrushPenMarginsFrame
TabOrder = 0
Text = 'Rectangle'
end
object gbBackground: TGroupBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = cmbShape
AnchorSideTop.Side = asrBottom
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = gbBorder
AnchorSideBottom.Side = asrBottom
Left = 0
Height = 73
Top = 31
Width = 83
Anchors = [akTop, akLeft, akBottom]
AutoSize = True
BorderSpacing.Top = 8
BorderSpacing.Right = 8
Caption = 'Background'
TabOrder = 1
end
object gbBorder: TGroupBox
AnchorSideLeft.Control = gbBackground
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = cmbShape
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = gbBackground
AnchorSideBottom.Side = asrBottom
Left = 91
Height = 73
Top = 31
Width = 185
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 8
BorderSpacing.Top = 8
Caption = 'Border'
TabOrder = 2
end
object gbMargins: TGroupBox
AnchorSideLeft.Control = gbBackground
AnchorSideTop.Control = gbBackground
AnchorSideTop.Control = gbBorder
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 0
Height = 97
Top = 112
Height = 105
Top = 114
Width = 276
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BorderSpacing.Top = 8
Caption = 'Margins'
ClientHeight = 77
ClientHeight = 85
ClientWidth = 272
TabOrder = 3
TabOrder = 1
object seTopMargin: TSpinEdit
AnchorSideLeft.Control = gbMargins
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = gbMargins
Left = 111
Height = 23
Top = 0
Top = 8
Width = 50
Alignment = taRightJustify
BorderSpacing.Top = 8
MaxValue = 1000
OnChange = seTopMarginChange
TabOrder = 0
@ -107,11 +72,11 @@ object ChartShapeBrushPenMarginsFrame: TChartShapeBrushPenMarginsFrame
AnchorSideRight.Control = seTopMargin
Left = 53
Height = 23
Top = 23
Top = 31
Width = 50
Alignment = taRightJustify
Anchors = [akTop, akRight]
BorderSpacing.Left = 28
BorderSpacing.Left = 32
BorderSpacing.Right = 8
MaxValue = 1000
OnChange = seLeftMarginChange
@ -124,11 +89,11 @@ object ChartShapeBrushPenMarginsFrame: TChartShapeBrushPenMarginsFrame
AnchorSideTop.Side = asrBottom
Left = 169
Height = 23
Top = 23
Top = 31
Width = 50
Alignment = taRightJustify
BorderSpacing.Left = 8
BorderSpacing.Right = 28
BorderSpacing.Right = 32
MaxValue = 1000
OnChange = seRightMarginChange
TabOrder = 2
@ -142,7 +107,7 @@ object ChartShapeBrushPenMarginsFrame: TChartShapeBrushPenMarginsFrame
AnchorSideBottom.Side = asrBottom
Left = 111
Height = 23
Top = 46
Top = 54
Width = 50
Alignment = taRightJustify
BorderSpacing.Bottom = 8
@ -151,4 +116,51 @@ object ChartShapeBrushPenMarginsFrame: TChartShapeBrushPenMarginsFrame
TabOrder = 3
end
end
object Panel1: TPanel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = cmbShape
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 59
Top = 31
Width = 276
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 8
BevelOuter = bvNone
TabOrder = 2
end
object gbBackground: TGroupBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = cmbShape
AnchorSideTop.Side = asrBottom
AnchorSideBottom.Control = gbBorder
AnchorSideBottom.Side = asrBottom
Left = 0
Height = 75
Top = 31
Width = 97
Anchors = [akTop, akLeft, akBottom]
BorderSpacing.Top = 8
Caption = 'gbBackground'
TabOrder = 3
end
object gbBorder: TGroupBox
AnchorSideLeft.Control = gbBackground
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = cmbShape
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 113
Height = 75
Top = 31
Width = 163
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 16
BorderSpacing.Top = 8
Caption = 'gbBorder'
TabOrder = 4
end
end

View File

@ -20,6 +20,7 @@ type
gbBackground: TGroupBox;
gbBorder: TGroupBox;
gbMargins: TGroupBox;
Panel1: TPanel;
seBottomMargin: TSpinEdit;
seLeftMargin: TSpinEdit;
seRightMargin: TSpinEdit;
@ -73,37 +74,41 @@ begin
FBrushFrame := TSimpleChartBrushFrame.Create(self);
FBrushFrame.Name := '';
FBrushFrame.BorderSpacing.Left := 8;
FBrushFrame.BorderSpacing.Right := 8;
FBrushFrame.BorderSpacing.Bottom := 8;
FBrushFrame.BorderSpacing.Around := 8;
FBrushFrame.Align := alClient;
FBrushFrame.OnChange := @ChangeHandler;
FBrushFrame.AutoSize := true;
gbBackground.AutoSize := true;
FBrushFrame.Parent := gbBackground;
gbBackground.AutoSize := true;
gbBackground.Caption := 'Background';
FPenFrame := TSimpleChartPenFrame.Create(self);
FPenFrame.Name := '';
FPenFrame.BorderSpacing.Left := 8;
FPenFrame.BorderSpacing.Right := 8;
FPenFrame.BorderSpacing.Bottom := 8;
FPenFrame.BorderSpacing.Around := 8;
FPenFrame.Align := alClient;
FPenFrame.OnChange := @ChangeHandler;
FPenFrame.AutoSize := true;
gbBorder.AutoSize := true;
FPenFrame.Parent := gbBorder;
gbBorder.AutoSize := true;
gbBorder.Caption := 'Border';
Panel1.AutoSize := true;
end;
procedure TChartShapeBrushPenMarginsFrame.CalculatePreferredSize(
var PreferredWidth, PreferredHeight: integer;
WithThemeSpace: Boolean);
var
w: Integer;
h: Integer;
begin
PreferredHeight := cmbShape.Height +
gbBorder.BorderSpacing.Top + gbBorder.Height +
gbMargins.BorderSpacing.Top + gbMargins.Height;
gbBorder.GetPreferredSize(w, h);
PreferredWidth :=
gbBackground.Width + gbBorder.Width +
gbBackground.Width + w + FPenFrame.BorderSpacing.Around*2 +
Max(gbBackground.BorderSpacing.Right, gbBorder.BorderSpacing.Left);
end;

View File

@ -1,9 +1,9 @@
object SimpleChartBrushFrame: TSimpleChartBrushFrame
Left = 0
Height = 151
Height = 38
Top = 0
Width = 120
ClientHeight = 151
ClientHeight = 38
ClientWidth = 120
TabOrder = 0
DesignLeft = 275
@ -12,27 +12,25 @@ object SimpleChartBrushFrame: TSimpleChartBrushFrame
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = cbFillColor
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = cbFillColor
Left = 0
Height = 19
Top = 3
Width = 80
Anchors = [akTop, akLeft, akRight]
Width = 48
BorderSpacing.Top = 6
BorderSpacing.Right = 8
Caption = 'Filled'
OnChange = cbFilledChange
TabOrder = 0
end
object cbFillColor: TColorButton
AnchorSideLeft.Control = cbFilled
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 88
Left = 56
Height = 25
Top = 0
Width = 32
Anchors = [akTop, akRight]
BorderSpacing.Left = 8
BorderWidth = 2
ButtonColorSize = 16

View File

@ -2,9 +2,9 @@ object SimpleChartPenFrame: TSimpleChartPenFrame
Left = 0
Height = 62
Top = 0
Width = 120
Width = 124
ClientHeight = 62
ClientWidth = 120
ClientWidth = 124
OnResize = FrameResize
TabOrder = 0
DesignLeft = 620
@ -28,11 +28,11 @@ object SimpleChartPenFrame: TSimpleChartPenFrame
AnchorSideTop.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 70
Left = 62
Height = 25
Top = 0
Width = 30
BorderSpacing.Left = 16
BorderSpacing.Left = 8
BorderSpacing.Bottom = 6
BorderWidth = 2
ButtonColorSize = 16
@ -51,7 +51,7 @@ object SimpleChartPenFrame: TSimpleChartPenFrame
Left = 40
Height = 22
Top = 33
Width = 80
Width = 84
Mode = ccmPenWidth
Options = [ccoPatternBrush, ccoPatternPen]
PenPattern = '1|1'
@ -59,9 +59,9 @@ object SimpleChartPenFrame: TSimpleChartPenFrame
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 8
BorderSpacing.Top = 8
Constraints.MinWidth = 80
Enabled = False
ItemHeight = 16
ItemIndex = 0
TabOrder = 1
OnChange = cbPenWidthChange
end

View File

@ -28,6 +28,10 @@ type
procedure DoChange;
function GetWidthLeft: Integer;
procedure SetWidthLeft(const AValue: Integer);
protected
procedure CalculatePreferredSize(
var PreferredWidth, PreferredHeight: integer;
WithThemeSpace: Boolean); override;
public
constructor Create(AOwner: TComponent); override;
procedure GetData(APen: TChartPen);
@ -41,7 +45,7 @@ implementation
{$R *.lfm}
uses
LCLIntf, LCLType;
LCLIntf, LCLType, Math;
{ TSimpleChartPenFrame }
@ -52,6 +56,17 @@ begin
cbPenColor.Width := cbPenColor.Height;
end;
procedure TSimpleChartPenFrame.CalculatePreferredSize(
var PreferredWidth, PreferredHeight: integer;
WithThemeSpace: Boolean);
begin
PreferredWidth := Max(
cbPenColor.Left + cbPenColor.Width,
cbPenWidth.Left + cbPenWidth.Constraints.MinWidth
);
PreferredHeight := cbPenWidth.Top + cbPenWidth.Height;
end;
procedure TSimpleChartPenFrame.cbPenColorColorChanged(Sender: TObject);
begin
FPen.Color := cbPenColor.ButtonColor;

View File

@ -1,9 +1,9 @@
object ChartTitleFootFrame: TChartTitleFootFrame
Left = 0
Height = 394
Height = 410
Top = 0
Width = 429
ClientHeight = 394
ClientHeight = 410
ClientWidth = 429
TabOrder = 0
DesignLeft = 500
@ -60,14 +60,15 @@ object ChartTitleFootFrame: TChartTitleFootFrame
end
object ParamsPanel: TPanel
Left = 0
Height = 187
Height = 203
Top = 199
Width = 429
Align = alBottom
AutoSize = True
BorderSpacing.Top = 16
BorderSpacing.Bottom = 8
BevelOuter = bvNone
ClientHeight = 187
ClientHeight = 203
ClientWidth = 429
TabOrder = 2
object rgAlignment: TRadioGroup
@ -150,21 +151,21 @@ object ChartTitleFootFrame: TChartTitleFootFrame
AnchorSideRight.Control = gbFont
AnchorSideRight.Side = asrBottom
Left = 0
Height = 51
Height = 59
Top = 144
Width = 202
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BorderSpacing.Top = 16
Caption = 'Distance to chart'
ClientHeight = 31
ClientHeight = 39
ClientWidth = 198
TabOrder = 2
object lblMargin: TLabel
AnchorSideLeft.Control = gbMargin
Left = 16
Height = 15
Top = 5
Top = 13
Width = 38
BorderSpacing.Left = 16
Caption = 'Margin'
@ -177,10 +178,11 @@ object ChartTitleFootFrame: TChartTitleFootFrame
AnchorSideRight.Side = asrBottom
Left = 70
Height = 23
Top = 0
Top = 8
Width = 72
Alignment = taRightJustify
BorderSpacing.Left = 16
BorderSpacing.Top = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
MaxValue = 1000

View File

@ -67,9 +67,9 @@ begin
FFontFrame := TChartFontFrame.Create(self);
FFontFrame.Name := '';
FFontFrame.Align := alClient;
FFontFrame.BorderSpacing.Left := 8;
FFontFrame.BorderSpacing.Right := 8;
FFontFrame.BorderSpacing.Around := 8;
FFontFrame.OnChange := @ChangedHandler;
FFontFrame.AutoSize := true;
FFontFrame.Parent := gbFont;
gbFont.AutoSize := true;
gbFont.Caption := 'Font';
@ -77,9 +77,7 @@ begin
FShapeBrushPenMarginsFrame := TChartShapeBrushPenMarginsFrame.Create(self);
FShapeBrushPenMarginsFrame.Name := '';
FShapeBrushPenMarginsFrame.Align := alClient;
FShapeBrushPenMarginsFrame.BorderSpacing.Left := 8;
FShapeBrushPenMarginsFrame.BorderSpacing.Right := 8;
FShapeBrushPenMarginsFrame.BorderSpacing.Bottom := 8;
FShapeBrushPenMarginsFrame.BorderSpacing.Around := 8;
FShapeBrushPenMarginsFrame.OnChange := @ChangedHandler;
FShapeBrushPenMarginsFrame.OnShapeChange := @ShapeChangedHandler;
FShapeBrushPenMarginsFrame.AutoSize := true;
@ -95,13 +93,19 @@ end;
procedure TChartTitleFootFrame.CalculatePreferredSize(
var PreferredWidth, PreferredHeight: integer;
WithThemeSpace: Boolean);
var
w: Integer = 0;
h: Integer = 0;
begin
PreferredHeight := PanelTop.Height +
MemoPanel.Constraints.MinHeight +
ParamsPanel.Height + ParamsPanel.BorderSpacing.Top + ParamsPanel.BorderSpacing.Bottom;
PreferredWidth := Max(gbFont.Width, rgAlignment.Width) +
gbShapeBrushPenMargins.Width + gbShapeBrushPenMargins.BorderSpacing.Left;
// w := 100;
gbShapeBrushPenMargins.GetPreferredSize(w, h);
PreferredWidth :=
Max(w, Max(gbFont.Width, rgAlignment.Width)) * 2 +
Bevel1.Width;
end;
procedure TChartTitleFootFrame.cbShowChange(Sender: TObject);