From a43265e3af3f87b78efc852ab50574a324d3b70f Mon Sep 17 00:00:00 2001 From: wp Date: Wed, 9 Oct 2019 22:58:49 +0000 Subject: [PATCH] Improved widgetset-independent and high-dpi-aware layout in some TAChart demos (3D, axis, axisalign, axistransf). git-svn-id: trunk@62017 - --- components/tachart/demo/3d/zdemo.lpi | 10 +- components/tachart/demo/3d/zdemo.lpr | 1 + components/tachart/demo/axis/axisdemo.lpi | 14 +- components/tachart/demo/axis/axisdemo.lpr | 5 +- components/tachart/demo/axis/main.lfm | 282 ++++++++++++------ .../tachart/demo/axisalign/axisalign.lpi | 10 +- .../tachart/demo/axisalign/axisalign.lpr | 1 + components/tachart/demo/axisalign/main.lfm | 203 +++++++++---- components/tachart/demo/axisalign/main.pas | 3 +- .../demo/axistransf/axistransfdemo.lpi | 13 +- .../demo/axistransf/axistransfdemo.lpr | 1 + components/tachart/demo/axistransf/main.lfm | 8 +- 12 files changed, 383 insertions(+), 168 deletions(-) diff --git a/components/tachart/demo/3d/zdemo.lpi b/components/tachart/demo/3d/zdemo.lpi index 0bc293401d..451c535af2 100644 --- a/components/tachart/demo/3d/zdemo.lpi +++ b/components/tachart/demo/3d/zdemo.lpi @@ -1,15 +1,16 @@ - + + - + <Scaled Value="True"/> <ResourceType Value="res"/> <UseXPManifest Value="True"/> <XPManifest> @@ -23,14 +24,11 @@ <Version Value="2"/> </PublishOptions> <RunParams> - <local> - <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> - </local> <FormatVersion Value="2"/> <Modes Count="1"> <Mode0 Name="default"> <local> - <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> </local> </Mode0> </Modes> diff --git a/components/tachart/demo/3d/zdemo.lpr b/components/tachart/demo/3d/zdemo.lpr index b0784f120b..1ee62d6860 100644 --- a/components/tachart/demo/3d/zdemo.lpr +++ b/components/tachart/demo/3d/zdemo.lpr @@ -13,6 +13,7 @@ uses {$R *.res} begin + Application.Scaled:=True; Application.Title:='TAChart 3D look demo'; Application.Initialize; Application.CreateForm(TForm1, Form1); diff --git a/components/tachart/demo/axis/axisdemo.lpi b/components/tachart/demo/axis/axisdemo.lpi index bf5e75ae76..0cc61b259f 100644 --- a/components/tachart/demo/axis/axisdemo.lpi +++ b/components/tachart/demo/axis/axisdemo.lpi @@ -1,17 +1,22 @@ <?xml version="1.0" encoding="UTF-8"?> <CONFIG> <ProjectOptions> - <Version Value="11"/> + <Version Value="12"/> <PathDelim Value="\"/> <General> <Flags> <SaveClosedFiles Value="False"/> <LRSInOutputDirectory Value="False"/> + <CompatibilityMode Value="True"/> </Flags> <SessionStorage Value="InProjectDir"/> - <MainUnit Value="0"/> <Title Value="TAChart axis demo"/> + <Scaled Value="True"/> <ResourceType Value="res"/> + <UseXPManifest Value="True"/> + <XPManifest> + <DpiAware Value="True"/> + </XPManifest> </General> <BuildModes Count="1"> <Item1 Name="default" Default="True"/> @@ -20,14 +25,11 @@ <Version Value="2"/> </PublishOptions> <RunParams> - <local> - <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> - </local> <FormatVersion Value="2"/> <Modes Count="1"> <Mode0 Name="default"> <local> - <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> </local> </Mode0> </Modes> diff --git a/components/tachart/demo/axis/axisdemo.lpr b/components/tachart/demo/axis/axisdemo.lpr index eba27d9d64..a3141774de 100644 --- a/components/tachart/demo/axis/axisdemo.lpr +++ b/components/tachart/demo/axis/axisdemo.lpr @@ -9,8 +9,11 @@ uses Interfaces, // this includes the LCL widgetset Forms, Main, TAChartLazarusPkg; +{$R *.res} + begin - Application.Title := 'TAChart axis demo'; + Application.Scaled:=True; + Application.Title:='TAChart axis demo'; Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; diff --git a/components/tachart/demo/axis/main.lfm b/components/tachart/demo/axis/main.lfm index fd530c39a3..95f90313f2 100644 --- a/components/tachart/demo/axis/main.lfm +++ b/components/tachart/demo/axis/main.lfm @@ -8,7 +8,7 @@ object Form1: TForm1 ClientWidth = 533 OnCreate = FormCreate Position = poScreenCenter - LCLVersion = '1.7' + LCLVersion = '2.1.0.0' object PageControl1: TPageControl Left = 0 Height = 430 @@ -35,11 +35,11 @@ object Form1: TForm1 Marks.Format = '$%0:.9g' Marks.Frame.Style = psSolid Marks.LabelBrush.Color = clMoneyGreen - Marks.LabelBrush.Style = bsSolid Marks.Source = lcsMarks Marks.Style = smsCustom Minors = <> Title.LabelFont.Orientation = 900 + Title.LabelBrush.Style = bsClear end item Grid.Visible = False @@ -48,9 +48,9 @@ object Form1: TForm1 AxisPen.Color = clGreen AxisPen.Width = 3 AxisPen.Visible = True - Marks.LabelFont.Height = -13 Marks.LabelFont.Style = [fsBold] Marks.Format = '%2:s' + Marks.LabelBrush.Style = bsClear Marks.Source = lcsMarks Marks.Style = smsLabel Minors = < @@ -61,7 +61,9 @@ object Form1: TForm1 Intervals.Options = [aipUseCount] TickColor = clGreen TickLength = 10 + Marks.LabelBrush.Style = bsClear end> + Title.LabelBrush.Style = bsClear OnMarkToText = ChartCustomMarksAxisList1MarkToText end> Foot.Brush.Color = clBtnFace @@ -79,22 +81,22 @@ object Form1: TForm1 ) Align = alClient object ChartCustomMarksBarSeries1: TBarSeries - Marks.Frame.Visible = False - Marks.LabelBrush.Style = bsClear BarBrush.Color = clGreen BarPen.Color = clLime BarPen.Width = 2 + Marks.Frame.Visible = False + Marks.LabelBrush.Style = bsClear Source = lcsMarks end end end object tsAxisGroup: TTabSheet Caption = 'Axis groups' - ClientHeight = 404 + ClientHeight = 402 ClientWidth = 525 object ChartAxisGroup: TChart Left = 0 - Height = 404 + Height = 402 Top = 0 Width = 525 AxisList = < @@ -102,12 +104,16 @@ object Form1: TForm1 Grid.Visible = False TickLength = 0 Group = 2 + Marks.LabelBrush.Style = bsClear Minors = <> Title.LabelFont.Orientation = 900 + Title.LabelBrush.Style = bsClear end item Alignment = calBottom + Marks.LabelBrush.Style = bsClear Minors = <> + Title.LabelBrush.Style = bsClear end> Foot.Brush.Color = clBtnFace Foot.Font.Color = clBlue @@ -121,20 +127,22 @@ object Form1: TForm1 end object tsSubmarks: TTabSheet Caption = 'Submarks' - ClientHeight = 404 + ClientHeight = 402 ClientWidth = 525 object ChartSubmarks: TChart Left = 0 - Height = 404 + Height = 402 Top = 0 Width = 525 AxisList = < item TickLength = 6 Group = 1 + Marks.LabelBrush.Style = bsClear Marks.Source = udcsMain Minors = <> Title.LabelFont.Orientation = 900 + Title.LabelBrush.Style = bsClear end item Intervals.MaxLength = 100 @@ -144,6 +152,7 @@ object Form1: TForm1 Alignment = calBottom Group = 2 Marks.LabelFont.Style = [fsBold] + Marks.LabelBrush.Style = bsClear Minors = < item Grid.Color = clGray @@ -155,16 +164,20 @@ object Form1: TForm1 Marks.LabelFont.Height = -9 Marks.LabelFont.Orientation = 900 Marks.Format = '%0:.9g' + Marks.LabelBrush.Style = bsClear Marks.Style = smsValue end> + Title.LabelBrush.Style = bsClear end item Grid.Visible = False TickLength = 2 Group = 1 + Marks.LabelBrush.Style = bsClear Marks.Source = udcsSub Marks.Style = smsNone Minors = <> + Title.LabelBrush.Style = bsClear end> BackColor = clWhite Foot.Brush.Color = clBtnFace @@ -191,16 +204,20 @@ object Form1: TForm1 Width = 525 AxisList = < item + Marks.LabelBrush.Style = bsClear Minors = <> Title.LabelFont.Orientation = 900 + Title.LabelBrush.Style = bsClear end item Alignment = calBottom Marks.Format = '%2:s' + Marks.LabelBrush.Style = bsClear Marks.OverlapPolicy = opHideNeighbour Marks.Source = DateTimeIntervalChartSource1 Marks.Style = smsLabel Minors = <> + Title.LabelBrush.Style = bsClear end> Foot.Brush.Color = clBtnFace Foot.Font.Color = clBlue @@ -259,11 +276,11 @@ object Form1: TForm1 end object tsIntervals: TTabSheet Caption = 'Intervals' - ClientHeight = 404 + ClientHeight = 402 ClientWidth = 525 object ChartIntervals: TChart Left = 0 - Height = 404 + Height = 402 Top = 0 Width = 525 AxisList = < @@ -275,11 +292,13 @@ object Form1: TForm1 AxisPen.Color = clMaroon AxisPen.Visible = True Marks.LabelFont.Color = clMaroon + Marks.LabelBrush.Style = bsClear Minors = <> Title.LabelFont.Color = clMaroon Title.LabelFont.Orientation = 900 Title.Visible = True Title.Caption = 'NiceSteps = 0.25' + Title.LabelBrush.Style = bsClear end item Grid.Visible = False @@ -288,6 +307,7 @@ object Form1: TForm1 Alignment = calBottom AxisPen.Visible = True Marks.Format = '%0:.6g' + Marks.LabelBrush.Style = bsClear Marks.Range.Max = 0.6 Marks.Range.Min = -0.3 Marks.Range.UseMax = True @@ -296,6 +316,7 @@ object Form1: TForm1 Minors = <> Title.Visible = True Title.Caption = 'Marks.Range = -0.3 .. 0.6' + Title.LabelBrush.Style = bsClear end item Grid.Visible = False @@ -308,11 +329,13 @@ object Form1: TForm1 AxisPen.Visible = True Margin = 8 Marks.LabelFont.Color = clGreen + Marks.LabelBrush.Style = bsClear Minors = <> Title.LabelFont.Color = clGreen Title.LabelFont.Orientation = 900 Title.Visible = True Title.Caption = 'MinLength = 4' + Title.LabelBrush.Style = bsClear end item Grid.Visible = False @@ -324,11 +347,13 @@ object Form1: TForm1 AxisPen.Visible = True Margin = 8 Marks.LabelFont.Color = clNavy + Marks.LabelBrush.Style = bsClear Minors = <> Title.LabelFont.Color = clNavy Title.LabelFont.Orientation = 900 Title.Visible = True Title.Caption = 'MaxLength = 200' + Title.LabelBrush.Style = bsClear end item Grid.Visible = False @@ -337,11 +362,13 @@ object Form1: TForm1 AxisPen.Visible = True Margin = 8 Marks.Format = '%0:.4g' + Marks.LabelBrush.Style = bsClear Marks.Style = smsCustom Minors = <> Title.LabelFont.Orientation = 900 Title.Visible = True Title.Caption = 'No nice steps' + Title.LabelBrush.Style = bsClear end> BackColor = clSilver Foot.Brush.Color = clBtnFace @@ -357,44 +384,48 @@ object Form1: TForm1 end object tsPosition: TTabSheet Caption = 'Position' - ClientHeight = 404 + ClientHeight = 402 ClientWidth = 525 object ChartPosition: TChart Left = 0 - Height = 404 + Height = 402 Top = 0 - Width = 395 + Width = 384 AxisList = < item Grid.Visible = False Intervals.Tolerance = 1 AxisPen.Visible = True - Marks.LabelBrush.Style = bsSolid Minors = <> Position = 50 + Title.LabelBrush.Style = bsClear end item Grid.Visible = False Intervals.Tolerance = 1 Alignment = calBottom AxisPen.Visible = True - Marks.LabelBrush.Style = bsSolid Minors = <> Position = 50 + Title.LabelBrush.Style = bsClear end item Grid.Color = clGray Intervals.Tolerance = 1 Visible = False + Marks.LabelBrush.Style = bsClear Minors = <> Title.LabelFont.Orientation = 900 + Title.LabelBrush.Style = bsClear end item Grid.Color = clGray Intervals.Tolerance = 1 Visible = False Alignment = calBottom + Marks.LabelBrush.Style = bsClear Minors = <> + Title.LabelBrush.Style = bsClear end> BackColor = clWhite Foot.Brush.Color = clBtnFace @@ -415,61 +446,83 @@ object Form1: TForm1 Extent.XMin = -100 Extent.YMax = 30 Extent.YMin = -30 - OnCalculate = ChartPositionFuncSeries1Calculate Pen.Color = clTeal Pen.Width = 2 + OnCalculate = ChartPositionFuncSeries1Calculate end end object pnlPosition: TPanel - Left = 395 - Height = 404 + Left = 384 + Height = 402 Top = 0 - Width = 130 + Width = 141 Align = alRight - ClientHeight = 404 - ClientWidth = 130 + ClientHeight = 402 + ClientWidth = 141 TabOrder = 1 object gbPositionX: TGroupBox Left = 1 - Height = 121 + Height = 124 Top = 1 - Width = 128 + Width = 139 Align = alTop + AutoSize = True Caption = ' X axis ' - ClientHeight = 101 - ClientWidth = 124 + ClientHeight = 104 + ClientWidth = 135 TabOrder = 0 object seXPosition: TSpinEdit - Left = 57 - Height = 21 - Top = 1 - Width = 58 + AnchorSideLeft.Control = lblPositionX + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = gbPositionX + AnchorSideRight.Control = gbPositionX + AnchorSideRight.Side = asrBottom + Left = 62 + Height = 23 + Top = 0 + Width = 65 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Left = 8 + BorderSpacing.Right = 8 OnChange = seXPositionChange TabOrder = 0 Value = 50 end object lblPositionX: TLabel - Left = 6 - Height = 13 - Top = 5 - Width = 41 + AnchorSideLeft.Control = gbPositionX + AnchorSideTop.Control = seXPosition + AnchorSideTop.Side = asrCenter + Left = 8 + Height = 15 + Top = 4 + Width = 46 + BorderSpacing.Left = 8 Caption = 'Position:' ParentColor = False end object cbStaticX: TCheckBox - Left = 6 - Height = 17 - Top = 53 - Width = 97 + AnchorSideLeft.Control = lblPositionX + AnchorSideTop.Control = cbUnitsX + AnchorSideTop.Side = asrBottom + Left = 8 + Height = 19 + Top = 54 + Width = 103 + BorderSpacing.Top = 4 Caption = 'Show static axis' OnChange = cbStaticXChange TabOrder = 1 end object rbPositionBottom: TRadioButton - Left = 6 - Height = 17 + AnchorSideLeft.Control = lblPositionX + AnchorSideTop.Control = cbStaticX + AnchorSideTop.Side = asrBottom + Left = 8 + Height = 19 Top = 77 - Width = 54 + Width = 60 + BorderSpacing.Top = 4 + BorderSpacing.Bottom = 8 Caption = 'Bottom' Checked = True OnChange = rbPositionBottomChange @@ -477,26 +530,40 @@ object Form1: TForm1 TabStop = True end object rbPositionTop: TRadioButton - Left = 70 - Height = 17 + AnchorSideLeft.Control = rbPositionBottom + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = rbPositionBottom + Left = 76 + Height = 19 Top = 77 - Width = 38 + Width = 40 + BorderSpacing.Left = 8 Caption = 'Top' TabOrder = 2 end object lblUnitsX: TLabel - Left = 6 - Height = 13 - Top = 33 - Width = 28 + AnchorSideLeft.Control = lblPositionX + AnchorSideTop.Control = cbUnitsX + AnchorSideTop.Side = asrCenter + Left = 8 + Height = 15 + Top = 31 + Width = 30 Caption = 'Units:' ParentColor = False end object cbUnitsX: TComboBox - Left = 54 + AnchorSideLeft.Control = seXPosition + AnchorSideTop.Control = seXPosition + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = seXPosition + AnchorSideRight.Side = asrBottom + Left = 62 Height = 23 - Top = 29 - Width = 60 + Top = 27 + Width = 65 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Top = 4 ItemHeight = 15 ItemIndex = 0 Items.Strings = ( @@ -514,52 +581,79 @@ object Form1: TForm1 object gbPositionY: TGroupBox Left = 1 Height = 124 - Top = 122 - Width = 128 + Top = 133 + Width = 139 Align = alTop + AutoSize = True + BorderSpacing.Top = 8 Caption = ' Y axis ' ClientHeight = 104 - ClientWidth = 124 + ClientWidth = 135 TabOrder = 1 object lblPositionY: TLabel - Left = 6 - Height = 13 + AnchorSideLeft.Control = gbPositionY + AnchorSideTop.Control = seYPosition + AnchorSideTop.Side = asrCenter + Left = 8 + Height = 15 Top = 4 - Width = 41 + Width = 46 + BorderSpacing.Left = 8 Caption = 'Position:' ParentColor = False end object cbStaticY: TCheckBox - Left = 6 - Height = 17 - Top = 56 - Width = 97 + AnchorSideLeft.Control = lblPositionY + AnchorSideTop.Control = cbUnitsY + AnchorSideTop.Side = asrBottom + Left = 8 + Height = 19 + Top = 54 + Width = 103 + BorderSpacing.Top = 4 Caption = 'Show static axis' OnChange = cbStaticYChange TabOrder = 0 end object seYPosition: TSpinEdit - Left = 57 - Height = 21 + AnchorSideLeft.Control = lblPositionY + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = gbPositionY + AnchorSideRight.Control = gbPositionY + AnchorSideRight.Side = asrBottom + Left = 62 + Height = 23 Top = 0 - Width = 58 + Width = 65 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Left = 8 + BorderSpacing.Right = 8 OnChange = seYPositionChange TabOrder = 1 Value = 50 end object rbPositionRight: TRadioButton - Left = 70 - Height = 17 - Top = 84 - Width = 45 + AnchorSideLeft.Control = rbPositionLeft + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = rbPositionLeft + Left = 64 + Height = 19 + Top = 77 + Width = 48 + BorderSpacing.Left = 16 Caption = 'Right' TabOrder = 2 end object rbPositionLeft: TRadioButton - Left = 6 - Height = 17 - Top = 84 - Width = 39 + AnchorSideLeft.Control = lblPositionY + AnchorSideTop.Control = cbStaticY + AnchorSideTop.Side = asrBottom + Left = 8 + Height = 19 + Top = 77 + Width = 40 + BorderSpacing.Top = 4 + BorderSpacing.Bottom = 8 Caption = 'Left' Checked = True OnChange = rbPositionLeftChange @@ -567,10 +661,17 @@ object Form1: TForm1 TabStop = True end object cbUnitsY: TComboBox - Left = 54 + AnchorSideLeft.Control = seYPosition + AnchorSideTop.Control = seYPosition + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = seYPosition + AnchorSideRight.Side = asrBottom + Left = 62 Height = 23 - Top = 29 - Width = 60 + Top = 27 + Width = 65 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Top = 4 ItemHeight = 15 ItemIndex = 0 Items.Strings = ( @@ -584,10 +685,13 @@ object Form1: TForm1 Text = 'percent' end object lblUnitsY: TLabel - Left = 6 - Height = 13 - Top = 33 - Width = 28 + AnchorSideLeft.Control = lblPositionY + AnchorSideTop.Control = cbUnitsY + AnchorSideTop.Side = asrCenter + Left = 8 + Height = 15 + Top = 31 + Width = 30 Caption = 'Units:' ParentColor = False end @@ -622,12 +726,12 @@ object Form1: TForm1 Params.MinLength = 20 Params.Options = [aipUseCount, aipUseMaxLength, aipUseMinLength, aipUseNiceSteps] OnDateTimeStepChange = DateTimeIntervalChartSource1DateTimeStepChange - left = 352 - top = 232 + left = 248 + top = 320 end object ChartToolsetDateTime: TChartToolset - left = 440 - top = 232 + left = 448 + top = 320 object ChartToolset1ZoomIn: TZoomClickTool Shift = [ssLeft] ZoomFactor = 4 @@ -642,20 +746,20 @@ object Form1: TForm1 object udcsMain: TUserDefinedChartSource OnGetChartDataItem = udcsMainGetChartDataItem PointsNumber = 10 - left = 440 - top = 60 + left = 344 + top = 72 end object udcsSub: TUserDefinedChartSource OnGetChartDataItem = udcsSubGetChartDataItem PointsNumber = 50 - left = 440 + left = 344 top = 116 end object udcsGraph: TUserDefinedChartSource OnGetChartDataItem = udcsGraphGetChartDataItem PointsNumber = 100 - left = 440 - top = 172 + left = 352 + top = 184 end object csStripes: TChartStyles Styles = < @@ -667,7 +771,7 @@ object Form1: TForm1 Brush.Color = 12319483 UsePen = False end> - left = 352 + left = 304 top = 176 end end diff --git a/components/tachart/demo/axisalign/axisalign.lpi b/components/tachart/demo/axisalign/axisalign.lpi index 41e11a75e6..ac0a2adda7 100644 --- a/components/tachart/demo/axisalign/axisalign.lpi +++ b/components/tachart/demo/axisalign/axisalign.lpi @@ -1,14 +1,20 @@ <?xml version="1.0" encoding="UTF-8"?> <CONFIG> <ProjectOptions> - <Version Value="11"/> + <Version Value="12"/> <PathDelim Value="\"/> <General> + <Flags> + <CompatibilityMode Value="True"/> + </Flags> <SessionStorage Value="InProjectDir"/> - <MainUnit Value="0"/> <Title Value="axisalign"/> + <Scaled Value="True"/> <ResourceType Value="res"/> <UseXPManifest Value="True"/> + <XPManifest> + <DpiAware Value="True"/> + </XPManifest> </General> <i18n> <EnableI18N LFM="False"/> diff --git a/components/tachart/demo/axisalign/axisalign.lpr b/components/tachart/demo/axisalign/axisalign.lpr index fd3394152a..77af02769c 100644 --- a/components/tachart/demo/axisalign/axisalign.lpr +++ b/components/tachart/demo/axisalign/axisalign.lpr @@ -14,6 +14,7 @@ uses begin RequireDerivedFormResource := True; + Application.Scaled:=True; Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; diff --git a/components/tachart/demo/axisalign/main.lfm b/components/tachart/demo/axisalign/main.lfm index 6bdf97eea2..d5c48820d2 100644 --- a/components/tachart/demo/axisalign/main.lfm +++ b/components/tachart/demo/axisalign/main.lfm @@ -3,14 +3,14 @@ object Form1: TForm1 Height = 500 Top = 262 Width = 674 - Caption = 'Form1' + Caption = 'Axis Align Demo' ClientHeight = 500 ClientWidth = 674 OnCreate = FormCreate - LCLVersion = '1.3' + LCLVersion = '2.1.0.0' object PageControl1: TPageControl Left = 0 - Height = 472 + Height = 471 Top = 0 Width = 674 ActivePage = TabSheet1 @@ -20,70 +20,97 @@ object Form1: TForm1 OnChange = PageControl1Change object TabSheet1: TTabSheet Caption = 'stacked' - ClientHeight = 444 + ClientHeight = 443 ClientWidth = 666 object Panel1: TPanel Left = 0 - Height = 64 + Height = 62 Top = 0 Width = 666 Align = alTop + AutoSize = True BevelOuter = bvNone - ClientHeight = 64 + ClientHeight = 62 ClientWidth = 666 TabOrder = 0 object EdLabelSizeLeft: TSpinEdit - Left = 96 + AnchorSideLeft.Control = Label1 + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = Panel1 + Left = 91 Height = 23 - Top = 8 + Top = 6 Width = 74 + BorderSpacing.Left = 24 + BorderSpacing.Top = 6 OnChange = EdLabelSizeLeftChange TabOrder = 0 end object Label1: TLabel - Left = 19 + AnchorSideLeft.Control = Panel1 + AnchorSideTop.Control = EdLabelSizeLeft + AnchorSideTop.Side = asrCenter + Left = 16 Height = 15 - Top = 14 + Top = 10 Width = 51 + BorderSpacing.Left = 16 Caption = 'LabelSize:' ParentColor = False end object EdLabelSizeRight: TSpinEdit - Left = 536 + AnchorSideTop.Control = EdLabelSizeLeft + AnchorSideRight.Control = Panel1 + AnchorSideRight.Side = asrBottom + Left = 576 Height = 23 - Top = 8 + Top = 6 Width = 66 + Anchors = [akTop, akRight] + BorderSpacing.Right = 24 OnChange = EdLabelSizeRightChange TabOrder = 1 end object Label2: TLabel - Left = 19 + AnchorSideLeft.Control = Label1 + AnchorSideTop.Control = EdPositionLeft + AnchorSideTop.Side = asrCenter + Left = 16 Height = 15 - Top = 38 + Top = 37 Width = 46 Caption = 'Position:' ParentColor = False end object EdPositionLeft: TSpinEdit - Left = 96 + AnchorSideLeft.Control = EdLabelSizeLeft + AnchorSideTop.Control = EdLabelSizeLeft + AnchorSideTop.Side = asrBottom + Left = 91 Height = 23 - Top = 32 + Top = 33 Width = 74 + BorderSpacing.Top = 4 + BorderSpacing.Bottom = 6 OnChange = EdPositionLeftChange TabOrder = 2 end object Label6: TLabel - Left = 464 + AnchorSideTop.Control = Label1 + AnchorSideRight.Control = EdLabelSizeRight + Left = 501 Height = 15 - Top = 14 + Top = 10 Width = 51 + Anchors = [akTop, akRight] + BorderSpacing.Right = 24 Caption = 'LabelSize:' ParentColor = False end object Bevel2: TBevel Left = 0 Height = 3 - Top = 61 + Top = 59 Width = 666 Align = alBottom Shape = bsBottomLine @@ -92,26 +119,32 @@ object Form1: TForm1 object ChartBottom: TChart Left = 0 Height = 176 - Top = 268 + Top = 267 Width = 666 AxisList = < item Grid.Color = clSilver AxisPen.Visible = True + Marks.LabelBrush.Style = bsClear Minors = <> Title.LabelFont.Orientation = 900 Title.Visible = True Title.Caption = 'Y axis title' + Title.LabelBrush.Style = bsClear end item Grid.Color = clSilver Alignment = calBottom + Marks.LabelBrush.Style = bsClear Minors = <> + Title.LabelBrush.Style = bsClear end item Alignment = calRight Marks.Visible = False + Marks.LabelBrush.Style = bsClear Minors = <> + Title.LabelBrush.Style = bsClear end> BackColor = clWhite Foot.Brush.Color = clBtnFace @@ -124,37 +157,42 @@ object Form1: TForm1 ) Align = alBottom Color = clWhite - ParentColor = False object ChartBottomLineSeries1: TLineSeries Source = RandomChartSource2 end end object ChartTop: TChart Left = 0 - Height = 204 - Top = 64 + Height = 205 + Top = 62 Width = 666 AntialiasingMode = amOn AxisList = < item Grid.Color = clSilver AxisPen.Visible = True + Marks.LabelBrush.Style = bsClear Minors = <> Title.LabelFont.Orientation = 900 Title.Visible = True Title.Caption = 'Y axis title' + Title.LabelBrush.Style = bsClear end item Grid.Color = clSilver Alignment = calBottom + Marks.LabelBrush.Style = bsClear Minors = <> Title.Visible = True Title.Caption = 'x' + Title.LabelBrush.Style = bsClear end item Alignment = calRight Marks.Visible = False + Marks.LabelBrush.Style = bsClear Minors = <> + Title.LabelBrush.Style = bsClear end> BackColor = clWhite Foot.Brush.Color = clBtnFace @@ -167,7 +205,6 @@ object Form1: TForm1 ) Align = alClient Color = clWhite - ParentColor = False object ChartTopLineSeries1: TLineSeries Source = RandomChartSource1 end @@ -175,69 +212,100 @@ object Form1: TForm1 end object TabSheet2: TTabSheet Caption = 'side-by-side' - ClientHeight = 422 + ClientHeight = 443 ClientWidth = 666 object Panel2: TPanel Left = 0 - Height = 422 + Height = 443 Top = 0 - Width = 104 + Width = 88 Align = alLeft + AutoSize = True BevelOuter = bvNone - ClientHeight = 422 - ClientWidth = 104 + ClientHeight = 443 + ClientWidth = 88 TabOrder = 0 object EdLabelSizeBottom: TSpinEdit - Left = 16 + AnchorSideLeft.Control = Label5 + AnchorSideRight.Control = EdLabelSizeTop + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = Panel2 + AnchorSideBottom.Side = asrBottom + Left = 10 Height = 23 - Top = 392 - Width = 74 + Top = 396 + Width = 66 + Anchors = [akLeft, akRight, akBottom] + BorderSpacing.Bottom = 24 OnChange = EdLabelSizeBottomChange TabOrder = 0 end object Label3: TLabel - Left = 16 + AnchorSideLeft.Control = Label5 + AnchorSideBottom.Control = EdLabelSizeBottom + Left = 10 Height = 15 - Top = 368 + Top = 377 Width = 51 + Anchors = [akLeft, akBottom] + BorderSpacing.Bottom = 4 Caption = 'LabelSize:' ParentColor = False end object EdLabelSizeTop: TSpinEdit - Left = 16 + AnchorSideLeft.Control = Panel2 + AnchorSideTop.Control = Label5 + AnchorSideTop.Side = asrBottom + Left = 10 Height = 23 - Top = 32 + Top = 27 Width = 66 + BorderSpacing.Left = 10 + BorderSpacing.Top = 4 + BorderSpacing.Right = 12 OnChange = EdLabelSizeTopChange TabOrder = 1 end object Label4: TLabel - Left = 16 + AnchorSideLeft.Control = Label5 + AnchorSideBottom.Control = EdPositionBottom + Left = 10 Height = 15 - Top = 304 + Top = 303 Width = 46 + Anchors = [akLeft, akBottom] + BorderSpacing.Bottom = 4 Caption = 'Position:' ParentColor = False end object EdPositionBottom: TSpinEdit - Left = 16 + AnchorSideLeft.Control = Label5 + AnchorSideRight.Control = EdLabelSizeTop + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = Label3 + Left = 10 Height = 23 - Top = 328 - Width = 74 + Top = 322 + Width = 66 + Anchors = [akLeft, akRight, akBottom] + BorderSpacing.Bottom = 32 OnChange = EdPositionBottomChange TabOrder = 2 end object Label5: TLabel - Left = 16 + AnchorSideLeft.Control = EdLabelSizeTop + AnchorSideTop.Control = Panel2 + Left = 10 Height = 15 Top = 8 Width = 51 + BorderSpacing.Top = 8 Caption = 'LabelSize:' ParentColor = False end object Bevel1: TBevel - Left = 96 - Height = 422 + Left = 80 + Height = 443 Top = 0 Width = 8 Align = alRight @@ -246,31 +314,37 @@ object Form1: TForm1 end object ChartRight: TChart Left = 384 - Height = 422 + Height = 443 Top = 0 Width = 282 AxisList = < item Grid.Color = clSilver AxisPen.Visible = True + Marks.LabelBrush.Style = bsClear Minors = <> Title.LabelFont.Orientation = 900 Title.Visible = True Title.Caption = 'Y axis' + Title.LabelBrush.Style = bsClear end item Grid.Color = clSilver Alignment = calBottom AxisPen.Visible = True Marks.LabelFont.Orientation = 900 + Marks.LabelBrush.Style = bsClear Minors = <> Title.Visible = True Title.Caption = 'X axis' + Title.LabelBrush.Style = bsClear end item Alignment = calTop Marks.Visible = False + Marks.LabelBrush.Style = bsClear Minors = <> + Title.LabelBrush.Style = bsClear end> BackColor = clWhite Foot.Brush.Color = clBtnFace @@ -283,39 +357,44 @@ object Form1: TForm1 ) Align = alRight Color = clWhite - ParentColor = False object Chart2LineSeries2: TLineSeries Source = RandomChartSource2 end end object ChartLeft: TChart - Left = 104 - Height = 422 + Left = 88 + Height = 443 Top = 0 - Width = 280 + Width = 296 AntialiasingMode = amOn AxisList = < item Grid.Color = clSilver AxisPen.Visible = True + Marks.LabelBrush.Style = bsClear Minors = <> Title.LabelFont.Orientation = 900 Title.Visible = True Title.Caption = 'Y axis' + Title.LabelBrush.Style = bsClear end item Grid.Color = clSilver Alignment = calBottom AxisPen.Visible = True Marks.LabelFont.Orientation = 900 + Marks.LabelBrush.Style = bsClear Minors = <> Title.Visible = True Title.Caption = 'X axis' + Title.LabelBrush.Style = bsClear end item Alignment = calTop Marks.Visible = False + Marks.LabelBrush.Style = bsClear Minors = <> + Title.LabelBrush.Style = bsClear end> BackColor = clWhite Foot.Brush.Color = clBtnFace @@ -328,7 +407,6 @@ object Form1: TForm1 ) Align = alClient Color = clWhite - ParentColor = False object Chart1LineSeries2: TLineSeries Source = RandomChartSource1 end @@ -336,13 +414,32 @@ object Form1: TForm1 end end object Panel3: TPanel + AnchorSideTop.Side = asrCenter Left = 0 - Height = 28 - Top = 472 + Height = 29 + Top = 471 Width = 674 Align = alBottom - Caption = 'Panel3' + AutoSize = True + ClientHeight = 29 + ClientWidth = 674 TabOrder = 1 + object lblInfo: TLabel + AnchorSideLeft.Control = Panel3 + AnchorSideTop.Control = Panel3 + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = Panel3 + AnchorSideRight.Side = asrBottom + Left = 7 + Height = 15 + Top = 7 + Width = 660 + Alignment = taCenter + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Around = 6 + Caption = 'lblInfo' + ParentColor = False + end end object RandomChartSource1: TRandomChartSource PointsNumber = 10 diff --git a/components/tachart/demo/axisalign/main.pas b/components/tachart/demo/axisalign/main.pas index cc368ba9b9..e88f39b7b8 100644 --- a/components/tachart/demo/axisalign/main.pas +++ b/components/tachart/demo/axisalign/main.pas @@ -29,6 +29,7 @@ type Label4: TLabel; Label5: TLabel; Label6: TLabel; + lblInfo: TLabel; PageControl1: TPageControl; Panel1: TPanel; Panel2: TPanel; @@ -75,7 +76,7 @@ procedure TForm1.PageControl1Change(Sender: TObject); const AXIS_NAMES: array[0..1] of String = ('left and right', 'top and bottom'); begin - Panel3.Caption := Format('The %s axis lines are at different ' + + lblInfo.Caption := Format('The %s axis lines are at different ' + 'positions. Increase "LabelSize" to align them.', [AXIS_NAMES[PageControl1.PageIndex]]); end; diff --git a/components/tachart/demo/axistransf/axistransfdemo.lpi b/components/tachart/demo/axistransf/axistransfdemo.lpi index bb3b589b1b..a74b205272 100644 --- a/components/tachart/demo/axistransf/axistransfdemo.lpi +++ b/components/tachart/demo/axistransf/axistransfdemo.lpi @@ -1,18 +1,22 @@ <?xml version="1.0" encoding="UTF-8"?> <CONFIG> <ProjectOptions> - <Version Value="11"/> + <Version Value="12"/> <PathDelim Value="\"/> <General> <Flags> <SaveClosedFiles Value="False"/> <LRSInOutputDirectory Value="False"/> + <CompatibilityMode Value="True"/> </Flags> <SessionStorage Value="InProjectDir"/> - <MainUnit Value="0"/> <Title Value="TAChart axis transformation demo"/> + <Scaled Value="True"/> <ResourceType Value="res"/> <UseXPManifest Value="True"/> + <XPManifest> + <DpiAware Value="True"/> + </XPManifest> </General> <BuildModes Count="1"> <Item1 Name="default" Default="True"/> @@ -21,14 +25,11 @@ <Version Value="2"/> </PublishOptions> <RunParams> - <local> - <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> - </local> <FormatVersion Value="2"/> <Modes Count="1"> <Mode0 Name="default"> <local> - <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> </local> </Mode0> </Modes> diff --git a/components/tachart/demo/axistransf/axistransfdemo.lpr b/components/tachart/demo/axistransf/axistransfdemo.lpr index c553c42b21..33b9bdff70 100644 --- a/components/tachart/demo/axistransf/axistransfdemo.lpr +++ b/components/tachart/demo/axistransf/axistransfdemo.lpr @@ -12,6 +12,7 @@ uses {$R *.res} begin + Application.Scaled:=True; Application.Title:='TAChart axis transformation demo'; Application.Initialize; Application.CreateForm(TForm1, Form1); diff --git a/components/tachart/demo/axistransf/main.lfm b/components/tachart/demo/axistransf/main.lfm index b1334a236d..59126efe6d 100644 --- a/components/tachart/demo/axistransf/main.lfm +++ b/components/tachart/demo/axistransf/main.lfm @@ -14,9 +14,9 @@ object Form1: TForm1 Height = 434 Top = 0 Width = 533 - ActivePage = tsLinear + ActivePage = tsUser Align = alClient - TabIndex = 0 + TabIndex = 4 TabOrder = 0 object tsLinear: TTabSheet Caption = 'Linear' @@ -414,7 +414,7 @@ object Form1: TForm1 AnchorSideLeft.Control = lblTolerance AnchorSideLeft.Side = asrBottom AnchorSideTop.Control = pnlLogControls - Left = 144 + Left = 143 Height = 23 Top = 0 Width = 50 @@ -430,7 +430,7 @@ object Form1: TForm1 Left = 85 Height = 15 Top = 4 - Width = 51 + Width = 50 BorderSpacing.Left = 16 Caption = 'Tolerance' ParentColor = False