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>
<MainSource>Project1.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Release</Config>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Application</AppType>
<FrameworkType>VCL</FrameworkType>

View File

@@ -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

View File

@@ -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;

View File

@@ -18,6 +18,11 @@
<CfgParent>Base</CfgParent>
<Base>true</Base>
</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)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
@@ -58,6 +63,10 @@
<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_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 Condition="'$(Cfg_1)'!=''">
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>

View File

@@ -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