From 9f5674152fc6775c130c664c58379fd15170a7f2 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sat, 24 Jun 2023 20:11:57 +0000 Subject: [PATCH] NiceChart: Remove dependence on Windows. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8848 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../nicechart/demo/Delphi/Project1.dproj | 2 +- components/nicechart/demo/Delphi/Project1.res | Bin 876 -> 3320 bytes components/nicechart/demo/common/Unit1.dfm | 16 +++++++-------- components/nicechart/demo/common/Unit1.pas | 1 + .../NiceChartDXE11.dproj | 9 +++++++++ components/nicechart/source/NiceChart.pas | 19 ++++++++++++++---- 6 files changed, 33 insertions(+), 14 deletions(-) diff --git a/components/nicechart/demo/Delphi/Project1.dproj b/components/nicechart/demo/Delphi/Project1.dproj index e19d169ec..5eef4c6aa 100644 --- a/components/nicechart/demo/Delphi/Project1.dproj +++ b/components/nicechart/demo/Delphi/Project1.dproj @@ -3,7 +3,7 @@ {534D51BE-D1B2-47D2-AD6E-AF9159060EBD} Project1.dpr True - Release + Debug 1 Application VCL diff --git a/components/nicechart/demo/Delphi/Project1.res b/components/nicechart/demo/Delphi/Project1.res index 1e4099ba3d5b244035f1f4e2788cda692b773db3..4f16aba1d085b75f9fc1c12fd637ec86b8cbedce 100644 GIT binary patch literal 3320 zcmbtX-EZ4e6hCPz(XMQC64J)gj5Tct$%!31X;RX5)w)d)`_fj*8_2P*Gecqr+eua- zpwk|x)Q9~moBD!eA(bco4J3HrjlB(t3G=(xA4#`P6WeW%eb49b+;h*hV`X$(ugifV}xx#41z;v7L(wDeip*xth=@#7t-^TSS=6w7-_t(Ef+&_(x-`9nf zhzHCynTWoCpoDl41>}-PT|{%KM+}iYa>$3_im*}1AeEXR13B=FR%ijfx&0=5Lb61h z0phvv^#sgq$b9+=dJA$*$W)r2^4*3mfcL~lqcV_kBB~0kG?Gn25$PtG)Q2Y@$6*)( zeEF|9HC8{0>i>8`pAjl+JPoO7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_ zIywr@8Vbr^Q;ddV*HlxhnN3mfg@py)eU%s5uT?qHro7GZs7&8tV8l~F-G>y;Y^~;%mM=Jlk-_+0b>RR82|tP diff --git a/components/nicechart/demo/common/Unit1.dfm b/components/nicechart/demo/common/Unit1.dfm index f141c8040..66cbb8bef 100644 --- a/components/nicechart/demo/common/Unit1.dfm +++ b/components/nicechart/demo/common/Unit1.dfm @@ -1,26 +1,24 @@ object Form1: TForm1 Left = 169 Top = 68 - Width = 778 - Height = 596 Caption = 'NiceChart Demo - priyatna.org' + ClientHeight = 558 + ClientWidth = 766 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText - Font.Height = -11 - Font.Name = 'MS Sans Serif' + Font.Height = -12 + Font.Name = 'Segoe UI' Font.Style = [] - OldCreateOrder = False Position = poDesktopCenter OnCreate = FormCreate OnDestroy = FormDestroy - PixelsPerInch = 96 - TextHeight = 13 + TextHeight = 15 object Label1: TLabel Left = 376 Top = 15 - Width = 32 - Height = 13 + Width = 34 + Height = 15 Caption = 'Label1' end object Button1: TButton diff --git a/components/nicechart/demo/common/Unit1.pas b/components/nicechart/demo/common/Unit1.pas index 95823210c..ecef493d0 100644 --- a/components/nicechart/demo/common/Unit1.pas +++ b/components/nicechart/demo/common/Unit1.pas @@ -73,6 +73,7 @@ begin Title := 'Look at me!'#13'I''m a NiceChart!'; AxisXOnePerValue := True; ShowXGrid := False; + ShowYGrid := False; AxisYScale := 1000; //Monochrome := True; OnMouseMove := ChartMouseMove; diff --git a/components/nicechart/packages/Delphi XE11 Alexandria/NiceChartDXE11.dproj b/components/nicechart/packages/Delphi XE11 Alexandria/NiceChartDXE11.dproj index fd316713e..330d56e79 100644 --- a/components/nicechart/packages/Delphi XE11 Alexandria/NiceChartDXE11.dproj +++ b/components/nicechart/packages/Delphi XE11 Alexandria/NiceChartDXE11.dproj @@ -18,6 +18,11 @@ Base true + + true + Base + true + true Base @@ -58,6 +63,10 @@ true CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) 1033 + vcl;rtl;$(DCC_UsePackage) + + + vcl;rtl;$(DCC_UsePackage) RELEASE;$(DCC_Define) diff --git a/components/nicechart/source/NiceChart.pas b/components/nicechart/source/NiceChart.pas index 0eba8fefc..a8287113f 100644 --- a/components/nicechart/source/NiceChart.pas +++ b/components/nicechart/source/NiceChart.pas @@ -35,7 +35,12 @@ unit NiceChart; interface uses - Windows, Messages, Classes, Graphics, Forms, Controls, ExtCtrls, SysUtils, + {$IFDEF FPC} + LclIntf, LCLType, LMessages, + {$ELSE} + Windows, Messages, + {$ENDIF} + Classes, Graphics, Forms, Controls, ExtCtrls, SysUtils, BSplines, Math; const @@ -122,8 +127,13 @@ type procedure SetTitle(const Value: string); procedure SetTitleFont(const Value: TFont); procedure TitleFontChanged(Sender: TObject); + {$IFDEF FPC} + procedure WMSize(var Msg: TLMSize); message LM_SIZE; + procedure WMEraseBkgnd(var Msg: TLMEraseBkgnd); message LM_ERASEBKGND; + {$ELSE} procedure WMSize(var Msg: TWMSize); message WM_SIZE; procedure WMEraseBkgnd(var Msg: TWMEraseBkgnd); message WM_ERASEBKGND; + {$ENDIF} function GetSeries(Index: Integer): TNiceSeries; function GetSeriesCount: Integer; procedure DrawLegend(ACanvas: TCanvas); @@ -213,6 +223,7 @@ type implementation {$R NiceChart.res} + {$IFDEF FPC} {$R nicechart_images.res} {$ENDIF} @@ -666,13 +677,13 @@ begin end; end; -procedure TNiceChart.WMSize(var Msg: TWMSize); +procedure TNiceChart.WMSize(var Msg: {$IFDEF FPC}TLMSize{$ELSE}TWMSize{$ENDIF}); begin inherited; Changed; end; -procedure TNiceChart.WMEraseBkgnd(var Msg: TWMEraseBkgnd); +procedure TNiceChart.WMEraseBkgnd(var Msg: {$IFDEF FPC}TLMEraseBkgnd{$ELSE}TWMEraseBkgnd{$ENDIF}); begin Msg.Result := 1; end; @@ -1137,7 +1148,7 @@ begin Last := l + w; end; MoveTo(P^.Px, P^.Py); - LineTo(P^.Px, P^.Py + SMALL_MARGIN); + LineTo(P^.Px, P^.Py + SMALL_MARGIN + 1); end; if FShowXGrid then begin