From 3ec5921b38a22e46fbe60a3ba73fea57bd2a8035 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sun, 1 Jun 2014 23:06:19 +0000 Subject: [PATCH] fpspreadsheet: Fix fpspreadsheetchart broken in rev 3020. For the moment don't use the t1.xls in the fpschart folder - it uses a "shared formula" which does not load with the current biff machinery. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3125 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../examples/fpschart/fpschart.lpi | 7 +- .../examples/fpschart/mainform.lfm | 71 ++++++++++++++----- .../fpspreadsheet/fpspreadsheetchart.pas | 12 ++++ 3 files changed, 70 insertions(+), 20 deletions(-) diff --git a/components/fpspreadsheet/examples/fpschart/fpschart.lpi b/components/fpspreadsheet/examples/fpschart/fpschart.lpi index 78ea7da88..e74f0ba37 100644 --- a/components/fpspreadsheet/examples/fpschart/fpschart.lpi +++ b/components/fpspreadsheet/examples/fpschart/fpschart.lpi @@ -1,4 +1,4 @@ - + @@ -51,13 +51,14 @@ + - + @@ -67,7 +68,7 @@ - + diff --git a/components/fpspreadsheet/examples/fpschart/mainform.lfm b/components/fpspreadsheet/examples/fpschart/mainform.lfm index 93c778aae..fa2678af0 100644 --- a/components/fpspreadsheet/examples/fpschart/mainform.lfm +++ b/components/fpspreadsheet/examples/fpschart/mainform.lfm @@ -7,7 +7,7 @@ object FPSChartForm: TFPSChartForm ClientHeight = 382 ClientWidth = 700 OnCreate = FormCreate - LCLVersion = '0.9.31' + LCLVersion = '1.3' object MyChart: TChart Left = 352 Height = 240 @@ -15,10 +15,12 @@ object FPSChartForm: TFPSChartForm Width = 336 AxisList = < item + Minors = <> Title.LabelFont.Orientation = 900 end item Alignment = calBottom + Minors = <> end> Foot.Brush.Color = clBtnFace Foot.Font.Color = clBlue @@ -38,8 +40,43 @@ object FPSChartForm: TFPSChartForm Height = 240 Top = 136 Width = 328 + FrozenCols = 0 + FrozenRows = 0 + ReadFormulas = False + ColCount = 27 + ExtendedSelect = False Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goSmoothScroll] + RowCount = 101 TabOrder = 1 + ColWidths = ( + 42 + 64 + 64 + 64 + 64 + 64 + 64 + 64 + 64 + 64 + 64 + 64 + 64 + 64 + 64 + 64 + 64 + 64 + 64 + 64 + 64 + 64 + 64 + 64 + 64 + 64 + 64 + ) end object btnCreateGraphic: TButton Left = 464 @@ -62,22 +99,22 @@ object FPSChartForm: TFPSChartForm end object editSourceFile: TFileNameEdit Left = 152 - Height = 25 + Height = 23 Top = 48 Width = 136 DialogOptions = [] FilterIndex = 0 HideDirectories = False ButtonWidth = 23 - NumGlyphs = 0 + NumGlyphs = 1 MaxLength = 0 TabOrder = 3 end object Label2: TLabel Left = 14 - Height = 18 + Height = 15 Top = 51 - Width = 136 + Width = 106 Caption = 'Source Spreadsheet:' ParentColor = False end @@ -92,18 +129,18 @@ object FPSChartForm: TFPSChartForm end object editXAxis: TLabeledEdit Left = 64 - Height = 25 + Height = 23 Top = 80 Width = 80 - EditLabel.AnchorSideLeft.Control = editXAxis EditLabel.AnchorSideTop.Control = editXAxis EditLabel.AnchorSideTop.Side = asrCenter EditLabel.AnchorSideRight.Control = editXAxis EditLabel.AnchorSideBottom.Control = editXAxis - EditLabel.Left = 18 - EditLabel.Height = 18 - EditLabel.Top = 83 - EditLabel.Width = 43 + EditLabel.AnchorSideBottom.Side = asrBottom + EditLabel.Left = 25 + EditLabel.Height = 15 + EditLabel.Top = 84 + EditLabel.Width = 36 EditLabel.Caption = 'X-Axis:' EditLabel.ParentColor = False LabelPosition = lpLeft @@ -112,18 +149,18 @@ object FPSChartForm: TFPSChartForm end object EditYAxis: TLabeledEdit Left = 208 - Height = 25 + Height = 23 Top = 80 Width = 80 - EditLabel.AnchorSideLeft.Control = EditYAxis EditLabel.AnchorSideTop.Control = EditYAxis EditLabel.AnchorSideTop.Side = asrCenter EditLabel.AnchorSideRight.Control = EditYAxis EditLabel.AnchorSideBottom.Control = EditYAxis - EditLabel.Left = 164 - EditLabel.Height = 18 - EditLabel.Top = 83 - EditLabel.Width = 41 + EditLabel.AnchorSideBottom.Side = asrBottom + EditLabel.Left = 169 + EditLabel.Height = 15 + EditLabel.Top = 84 + EditLabel.Width = 36 EditLabel.Caption = 'Y-Axis:' EditLabel.ParentColor = False LabelPosition = lpLeft diff --git a/components/fpspreadsheet/fpspreadsheetchart.pas b/components/fpspreadsheet/fpspreadsheetchart.pas index 86346608a..38da395e4 100644 --- a/components/fpspreadsheet/fpspreadsheetchart.pas +++ b/components/fpspreadsheet/fpspreadsheetchart.pas @@ -59,6 +59,7 @@ type destructor Destroy; override; procedure LoadPropertiesFromStrings(AXInterval, AYInterval, AXTitle, AYTitle, ATitle: string); public + procedure LoadFromWorksheetGrid(const AValue: TsWorksheetGrid); published // property WorksheetGrid: TsWorksheetGrid read FWorksheetGrid write SetWorksheetGrid; property PointsNumber: Integer read FPointsNumber write SetPointsNumber default 0; @@ -193,6 +194,17 @@ begin inherited Destroy; end; +procedure TsWorksheetChartSource.LoadFromWorksheetGrid(const AValue: TsWorksheetGrid); +begin + if AValue = nil then Exit; + + FDataWorksheet := AValue.Worksheet; +// AValue.SaveToWorksheet(FDataWorksheet); + + InvalidateCaches; + Notify; +end; + procedure TsWorksheetChartSource.LoadPropertiesFromStrings(AXInterval, AYInterval, AXTitle, AYTitle, ATitle: string); var