NiceChart: Remove dependence on Windows.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8848 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2023-06-24 20:11:57 +00:00
parent 4d4305c7ed
commit 9f5674152f
6 changed files with 33 additions and 14 deletions

View File

@ -3,7 +3,7 @@
<ProjectGuid>{534D51BE-D1B2-47D2-AD6E-AF9159060EBD}</ProjectGuid> <ProjectGuid>{534D51BE-D1B2-47D2-AD6E-AF9159060EBD}</ProjectGuid>
<MainSource>Project1.dpr</MainSource> <MainSource>Project1.dpr</MainSource>
<Base>True</Base> <Base>True</Base>
<Config Condition="'$(Config)'==''">Release</Config> <Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms> <TargetedPlatforms>1</TargetedPlatforms>
<AppType>Application</AppType> <AppType>Application</AppType>
<FrameworkType>VCL</FrameworkType> <FrameworkType>VCL</FrameworkType>

View File

@ -1,26 +1,24 @@
object Form1: TForm1 object Form1: TForm1
Left = 169 Left = 169
Top = 68 Top = 68
Width = 778
Height = 596
Caption = 'NiceChart Demo - priyatna.org' Caption = 'NiceChart Demo - priyatna.org'
ClientHeight = 558
ClientWidth = 766
Color = clBtnFace Color = clBtnFace
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -11 Font.Height = -12
Font.Name = 'MS Sans Serif' Font.Name = 'Segoe UI'
Font.Style = [] Font.Style = []
OldCreateOrder = False
Position = poDesktopCenter Position = poDesktopCenter
OnCreate = FormCreate OnCreate = FormCreate
OnDestroy = FormDestroy OnDestroy = FormDestroy
PixelsPerInch = 96 TextHeight = 15
TextHeight = 13
object Label1: TLabel object Label1: TLabel
Left = 376 Left = 376
Top = 15 Top = 15
Width = 32 Width = 34
Height = 13 Height = 15
Caption = 'Label1' Caption = 'Label1'
end end
object Button1: TButton object Button1: TButton

View File

@ -73,6 +73,7 @@ begin
Title := 'Look at me!'#13'I''m a NiceChart!'; Title := 'Look at me!'#13'I''m a NiceChart!';
AxisXOnePerValue := True; AxisXOnePerValue := True;
ShowXGrid := False; ShowXGrid := False;
ShowYGrid := False;
AxisYScale := 1000; AxisYScale := 1000;
//Monochrome := True; //Monochrome := True;
OnMouseMove := ChartMouseMove; OnMouseMove := ChartMouseMove;

View File

@ -18,6 +18,11 @@
<CfgParent>Base</CfgParent> <CfgParent>Base</CfgParent>
<Base>true</Base> <Base>true</Base>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
<Base_Win64>true</Base_Win64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''"> <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1> <Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent> <CfgParent>Base</CfgParent>
@ -58,6 +63,10 @@
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo> <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys> <VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
<VerInfo_Locale>1033</VerInfo_Locale> <VerInfo_Locale>1033</VerInfo_Locale>
<DCC_UsePackage>vcl;rtl;$(DCC_UsePackage)</DCC_UsePackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<DCC_UsePackage>vcl;rtl;$(DCC_UsePackage)</DCC_UsePackage>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''"> <PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define> <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>

View File

@ -35,7 +35,12 @@ unit NiceChart;
interface interface
uses 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; BSplines, Math;
const const
@ -122,8 +127,13 @@ type
procedure SetTitle(const Value: string); procedure SetTitle(const Value: string);
procedure SetTitleFont(const Value: TFont); procedure SetTitleFont(const Value: TFont);
procedure TitleFontChanged(Sender: TObject); 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 WMSize(var Msg: TWMSize); message WM_SIZE;
procedure WMEraseBkgnd(var Msg: TWMEraseBkgnd); message WM_ERASEBKGND; procedure WMEraseBkgnd(var Msg: TWMEraseBkgnd); message WM_ERASEBKGND;
{$ENDIF}
function GetSeries(Index: Integer): TNiceSeries; function GetSeries(Index: Integer): TNiceSeries;
function GetSeriesCount: Integer; function GetSeriesCount: Integer;
procedure DrawLegend(ACanvas: TCanvas); procedure DrawLegend(ACanvas: TCanvas);
@ -213,6 +223,7 @@ type
implementation implementation
{$R NiceChart.res} {$R NiceChart.res}
{$IFDEF FPC} {$IFDEF FPC}
{$R nicechart_images.res} {$R nicechart_images.res}
{$ENDIF} {$ENDIF}
@ -666,13 +677,13 @@ begin
end; end;
end; end;
procedure TNiceChart.WMSize(var Msg: TWMSize); procedure TNiceChart.WMSize(var Msg: {$IFDEF FPC}TLMSize{$ELSE}TWMSize{$ENDIF});
begin begin
inherited; inherited;
Changed; Changed;
end; end;
procedure TNiceChart.WMEraseBkgnd(var Msg: TWMEraseBkgnd); procedure TNiceChart.WMEraseBkgnd(var Msg: {$IFDEF FPC}TLMEraseBkgnd{$ELSE}TWMEraseBkgnd{$ENDIF});
begin begin
Msg.Result := 1; Msg.Result := 1;
end; end;
@ -1137,7 +1148,7 @@ begin
Last := l + w; Last := l + w;
end; end;
MoveTo(P^.Px, P^.Py); MoveTo(P^.Px, P^.Py);
LineTo(P^.Px, P^.Py + SMALL_MARGIN); LineTo(P^.Px, P^.Py + SMALL_MARGIN + 1);
end; end;
if FShowXGrid then if FShowXGrid then
begin begin