From f8a92e54e01efafad75af5530dcb522b64da22a8 Mon Sep 17 00:00:00 2001 From: wp Date: Fri, 12 Feb 2016 15:43:10 +0000 Subject: [PATCH] TAChart: Clean up. git-svn-id: trunk@51601 - --- components/tachart/demo/chartsource/main.lfm | 54 +++++++++---------- .../tachart/editors/tadatapointseditor.pas | 1 + components/tachart/taanimatedsource.pas | 4 +- components/tachart/tacustomsource.pas | 16 ------ 4 files changed, 28 insertions(+), 47 deletions(-) diff --git a/components/tachart/demo/chartsource/main.lfm b/components/tachart/demo/chartsource/main.lfm index 9f41594afe..7e45c4c752 100644 --- a/components/tachart/demo/chartsource/main.lfm +++ b/components/tachart/demo/chartsource/main.lfm @@ -7,7 +7,7 @@ object Form1: TForm1 ClientHeight = 438 ClientWidth = 637 OnCreate = FormCreate - LCLVersion = '0.9.31' + LCLVersion = '1.7' object Splitter1: TSplitter Left = 632 Height = 438 @@ -28,7 +28,7 @@ object Form1: TForm1 TabOrder = 1 object tsBasic: TTabSheet Caption = 'Basic' - ClientHeight = 412 + ClientHeight = 410 ClientWidth = 624 object Memo1: TMemo Left = 0 @@ -44,7 +44,7 @@ object Form1: TForm1 end object Chart2: TChart Left = 0 - Height = 378 + Height = 376 Top = 34 Width = 333 AxisList = < @@ -64,7 +64,6 @@ object Form1: TForm1 'TAChart' ) Align = alClient - ParentColor = False object Chart2LineSeries1: TLineSeries LinePen.Color = clRed Pointer.Brush.Color = clRed @@ -79,7 +78,7 @@ object Form1: TForm1 end object Chart1: TChart Left = 333 - Height = 378 + Height = 376 Top = 34 Width = 291 AxisList = < @@ -99,7 +98,6 @@ object Form1: TForm1 'TAChart' ) Align = alRight - ParentColor = False object Chart1BarSeries1: TBarSeries BarBrush.Color = clRed Source = RandomChartSource1 @@ -115,11 +113,11 @@ object Form1: TForm1 end object tsStatistics: TTabSheet Caption = 'Statistics' - ClientHeight = 412 + ClientHeight = 410 ClientWidth = 624 object chCalc: TChart Left = 0 - Height = 378 + Height = 376 Top = 0 Width = 624 AxisList = < @@ -144,7 +142,6 @@ object Form1: TForm1 'TAChart' ) Align = alClient - ParentColor = False object chCalcLineSeries1: TLineSeries Title = 'Data' LineType = ltNone @@ -168,7 +165,7 @@ object Form1: TForm1 object Panel2: TPanel Left = 0 Height = 34 - Top = 378 + Top = 376 Width = 624 Align = alBottom ClientHeight = 34 @@ -176,9 +173,9 @@ object Form1: TForm1 TabOrder = 1 object cbCumulative: TCheckBox Left = 8 - Height = 17 + Height = 19 Top = 7 - Width = 73 + Width = 81 Caption = 'Cumulative' Checked = True OnChange = cbCumulativeChange @@ -187,10 +184,10 @@ object Form1: TForm1 end object cbAccDirStatistics: TComboBox Left = 108 - Height = 21 + Height = 23 Top = 7 Width = 100 - ItemHeight = 13 + ItemHeight = 15 ItemIndex = 0 Items.Strings = ( 'Backward' @@ -206,11 +203,11 @@ object Form1: TForm1 end object tsDerivative: TTabSheet Caption = 'Derivative' - ClientHeight = 412 + ClientHeight = 410 ClientWidth = 624 object chDerivative: TChart Left = 0 - Height = 327 + Height = 325 Top = 0 Width = 624 AxisList = < @@ -241,7 +238,6 @@ object Form1: TForm1 ) Align = alClient DoubleBuffered = True - ParentColor = False object chDerivativeLineOrig: TLineSeries Title = 'y' Source = lcsDerivative @@ -255,7 +251,7 @@ object Form1: TForm1 object rgDataShape: TRadioGroup Left = 0 Height = 54 - Top = 327 + Top = 325 Width = 624 Align = alBottom AutoFill = True @@ -268,7 +264,7 @@ object Form1: TForm1 ChildSizing.ShrinkVertical = crsScaleChilds ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 7 - ClientHeight = 36 + ClientHeight = 34 ClientWidth = 620 Columns = 7 ItemIndex = 0 @@ -288,7 +284,7 @@ object Form1: TForm1 object Panel1: TPanel Left = 0 Height = 31 - Top = 381 + Top = 379 Width = 624 Align = alBottom BevelOuter = bvNone @@ -297,27 +293,27 @@ object Form1: TForm1 TabOrder = 2 object lblAccumulationRange: TLabel Left = 8 - Height = 14 + Height = 15 Top = 9 - Width = 95 + Width = 108 Caption = 'AccumulationRange' ParentColor = False end object seAccumulationRange: TSpinEdit - Left = 116 - Height = 21 + Left = 124 + Height = 23 Top = 4 - Width = 82 + Width = 74 OnChange = seAccumulationRangeChange TabOrder = 0 Value = 2 end object cbAccDirDerivative: TComboBox Left = 216 - Height = 21 + Height = 23 Top = 4 Width = 100 - ItemHeight = 13 + ItemHeight = 15 ItemIndex = 0 Items.Strings = ( 'Backward' @@ -331,9 +327,9 @@ object Form1: TForm1 end object cbSmooth: TCheckBox Left = 332 - Height = 17 + Height = 19 Top = 5 - Width = 56 + Width = 62 Caption = 'Smooth' OnChange = cbSmoothChange TabOrder = 2 diff --git a/components/tachart/editors/tadatapointseditor.pas b/components/tachart/editors/tadatapointseditor.pas index f070871e2b..bab1b510b9 100644 --- a/components/tachart/editors/tadatapointseditor.pas +++ b/components/tachart/editors/tadatapointseditor.pas @@ -184,6 +184,7 @@ procedure TDataPointsEditorForm.sgDataPrepareCanvas(sender: TObject; aCol, var ts: TTextStyle; begin + Unused(aRow, aState); if ACol = 0 then begin ts := TStringGrid(Sender).Canvas.TextStyle; ts.Alignment := taRightJustify; diff --git a/components/tachart/taanimatedsource.pas b/components/tachart/taanimatedsource.pas index 17645e3a0d..90c37cf07a 100644 --- a/components/tachart/taanimatedsource.pas +++ b/components/tachart/taanimatedsource.pas @@ -158,7 +158,7 @@ var d, s: Cardinal; begin Unused(ASender); - d := GetTickCount - FStartTime; + d := GetTickCount64 - FStartTime; if d >= AnimationTime then Stop(true); s := Round(d * ProjectedSteps / AnimationTime); @@ -200,7 +200,7 @@ begin FSkippedFramesCount := 0; if (AnimationInterval = 0) or (AnimationTime <= AnimationInterval) then exit; FProjectedSteps := Round(AnimationTime / AnimationInterval); - FStartTime := GetTickCount; + FStartTime := GetTickCount64; FTimer.Interval := AnimationInterval; FTimer.Enabled := true; end; diff --git a/components/tachart/tacustomsource.pas b/components/tachart/tacustomsource.pas index 196ce85133..59ff9e3f00 100644 --- a/components/tachart/tacustomsource.pas +++ b/components/tachart/tacustomsource.pas @@ -95,19 +95,6 @@ type end; PChartDataItem = ^TChartDataItem; - TChartLinkKind = (lkStraight, lkAngled); - - TChartLinkItem = packed record - FromIndex: Integer; - ToIndex: Integer; - case Kind: TChartLinkKind of - lkStraight: (); - lkAngled : (ForwardAnglePos: Double; - BackwardAnglePos: array[0..2] of Double); - end; - - PChartLinkItem = ^TChartLinkItem; - TGraphToImageFunc = function (AX: Double): Integer of object; TIntegerTransformFunc = function (AX: Integer): Integer of object; @@ -171,8 +158,6 @@ type function GetCount: Integer; virtual; abstract; function GetItem(AIndex: Integer): PChartDataItem; virtual; abstract; - function GetLink(AIndex: Integer): PChartLinkItem; virtual; abstract; - function GetLinkCount: Integer; virtual; abstract; procedure InvalidateCaches; procedure SetYCount(AValue: Cardinal); virtual; abstract; public @@ -201,7 +186,6 @@ type property Count: Integer read GetCount; property Item[AIndex: Integer]: PChartDataItem read GetItem; default; - property Link[AIndex: Integer]: PChartLinkItem read GetLink; property YCount: Cardinal read FYCount write SetYCount default 1; end;