TAChart: Fix compilation of html demo by making Windows-only package TADrawerWMF usable as (empty) requirement also in other OSs.

git-svn-id: trunk@56497 -
This commit is contained in:
wp 2017-11-25 23:02:32 +00:00
parent 130b9d9510
commit 6bfac0b4b1
4 changed files with 23 additions and 17 deletions

View File

@ -21,13 +21,16 @@
<FormatVersion Value="1"/> <FormatVersion Value="1"/>
</local> </local>
</RunParams> </RunParams>
<RequiredPackages Count="2"> <RequiredPackages Count="3">
<Item1> <Item1>
<PackageName Value="TAChartLazarusPkg"/> <PackageName Value="TAChartWMF"/>
</Item1> </Item1>
<Item2> <Item2>
<PackageName Value="LCL"/> <PackageName Value="TAChartLazarusPkg"/>
</Item2> </Item2>
<Item3>
<PackageName Value="LCL"/>
</Item3>
</RequiredPackages> </RequiredPackages>
<Units Count="2"> <Units Count="2">
<Unit0> <Unit0>

View File

@ -7,7 +7,7 @@ uses
cthreads, cthreads,
{$ENDIF}{$ENDIF} {$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset Interfaces, // this includes the LCL widgetset
Forms, main, tachartlazaruspkg Forms, main, tachartlazaruspkg, tachartwmf
{ you can add units after this }; { you can add units after this };
{$R *.res} {$R *.res}

View File

@ -2,17 +2,17 @@ object MainForm: TMainForm
Left = 280 Left = 280
Height = 452 Height = 452
Top = 130 Top = 130
Width = 655 Width = 656
Caption = 'HTML demo' Caption = 'HTML demo'
ClientHeight = 452 ClientHeight = 452
ClientWidth = 655 ClientWidth = 656
OnCreate = FormCreate OnCreate = FormCreate
LCLVersion = '1.9.0.0' LCLVersion = '1.9.0.0'
object BottomPanel: TPanel object BottomPanel: TPanel
Left = 8 Left = 8
Height = 105 Height = 105
Top = 339 Top = 339
Width = 639 Width = 640
Align = alBottom Align = alBottom
AutoSize = True AutoSize = True
BorderSpacing.Left = 8 BorderSpacing.Left = 8
@ -20,7 +20,7 @@ object MainForm: TMainForm
BorderSpacing.Bottom = 8 BorderSpacing.Bottom = 8
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 105 ClientHeight = 105
ClientWidth = 639 ClientWidth = 640
TabOrder = 0 TabOrder = 0
object CgHTML: TCheckGroup object CgHTML: TCheckGroup
Left = 0 Left = 0
@ -62,7 +62,7 @@ object MainForm: TMainForm
AnchorSideTop.Control = BottomPanel AnchorSideTop.Control = BottomPanel
AnchorSideRight.Control = BottomPanel AnchorSideRight.Control = BottomPanel
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 510 Left = 511
Height = 25 Height = 25
Top = 8 Top = 8
Width = 121 Width = 121
@ -80,7 +80,7 @@ object MainForm: TMainForm
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = BtnCopyToClipboard AnchorSideRight.Control = BtnCopyToClipboard
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 510 Left = 511
Height = 25 Height = 25
Top = 37 Top = 37
Width = 121 Width = 121
@ -97,7 +97,7 @@ object MainForm: TMainForm
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = BtnCopyToClipboard AnchorSideRight.Control = BtnCopyToClipboard
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 510 Left = 511
Height = 25 Height = 25
Top = 66 Top = 66
Width = 121 Width = 121
@ -109,15 +109,13 @@ object MainForm: TMainForm
TabOrder = 3 TabOrder = 3
end end
object CbRTL: TCheckBox object CbRTL: TCheckBox
AnchorSideLeft.Control = CgHTML AnchorSideLeft.Control = CbRotateXLabels
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = CbRotateXLabels AnchorSideTop.Control = CbRotateXLabels
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 349 Left = 349
Height = 19 Height = 19
Top = 38 Top = 38
Width = 86 Width = 86
BorderSpacing.Left = 16
BorderSpacing.Top = 8 BorderSpacing.Top = 8
Caption = 'Right-to-left' Caption = 'Right-to-left'
OnChange = CbRTLChange OnChange = CbRTLChange
@ -125,12 +123,15 @@ object MainForm: TMainForm
Visible = False Visible = False
end end
object CbRotateXLabels: TCheckBox object CbRotateXLabels: TCheckBox
AnchorSideLeft.Control = CgHTML
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = BtnCopyToClipboard AnchorSideTop.Control = BtnCopyToClipboard
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 349 Left = 349
Height = 19 Height = 19
Top = 11 Top = 11
Width = 131 Width = 131
BorderSpacing.Left = 16
Caption = 'Rotate x labels by 45°' Caption = 'Rotate x labels by 45°'
OnChange = CbRotateXLabelsChange OnChange = CbRotateXLabelsChange
TabOrder = 5 TabOrder = 5
@ -152,7 +153,7 @@ object MainForm: TMainForm
Left = 8 Left = 8
Height = 323 Height = 323
Top = 8 Top = 8
Width = 639 Width = 640
AxisList = < AxisList = <
item item
Grid.Color = clSilver Grid.Color = clSilver

View File

@ -14,6 +14,7 @@ unit TADrawerWMF;
interface interface
{$IFDEF WINDOWS}
uses uses
Windows, Classes, Graphics, Windows, Classes, Graphics,
TADrawerCanvas, TAGraph; TADrawerCanvas, TAGraph;
@ -102,10 +103,11 @@ type
procedure CopyToClipboardMetafile; procedure CopyToClipboardMetafile;
procedure SaveToWMF(const AFileName: String); procedure SaveToWMF(const AFileName: String);
end; end;
{$ENDIF}
implementation implementation
{$IFDEF WINDOWS}
uses uses
SysUtils, clipbrd, TAChartUtils; SysUtils, clipbrd, TAChartUtils;
@ -472,7 +474,7 @@ procedure TWMFChartHelper.SaveToWMF(const AFileName: String);
begin begin
Draw(TWindowsMetafileDrawer.Create(AFilename), Rect(0, 0, Width, Height)); Draw(TWindowsMetafileDrawer.Create(AFilename), Rect(0, 0, Width, Height));
end; end;
{$ENDIF}
end. end.