mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 08:38:19 +02:00
* fixes postscriptcanvas example
patch by Darius git-svn-id: trunk@9555 -
This commit is contained in:
parent
8cf48a5f64
commit
2b7bb69fe4
@ -1,38 +1,19 @@
|
||||
<?xml version="1.0"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="5"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<SaveClosedFiles Value="False"/>
|
||||
<SaveOnlyProjectUnits Value="True"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<ActiveEditorIndexAtStart Value="1"/>
|
||||
<IconPath Value="./"/>
|
||||
<TargetFileExt Value=""/>
|
||||
<Title Value="samplepostscriptcanvas"/>
|
||||
</General>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="samplepostscriptcanvas.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="samplepostscriptcanvas"/>
|
||||
<UsageCount Value="20"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<CursorPos X="21" Y="9"/>
|
||||
<EditorIndex Value="0"/>
|
||||
<Filename Value="usamplepostscriptcanvas.pas"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<Loaded Value="True"/>
|
||||
<ResourceFilename Value="usamplepostscriptcanvas.lrs"/>
|
||||
<TopLine Value="1"/>
|
||||
<UnitName Value="uSamplePostScriptCanvas"/>
|
||||
<UsageCount Value="20"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<IgnoreBinaries Value="False"/>
|
||||
@ -50,15 +31,37 @@
|
||||
<PackageName Value="LCL"/>
|
||||
</Item1>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="samplepostscriptcanvas.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="samplepostscriptcanvas"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="usamplepostscriptcanvas.pas"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ResourceFilename Value="usamplepostscriptcanvas.lrs"/>
|
||||
<UnitName Value="uSamplePostScriptCanvas"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="2"/>
|
||||
<Version Value="5"/>
|
||||
<PathDelim Value="\"/>
|
||||
<SearchPaths>
|
||||
<SrcPath Value="$(LazarusDir)/lcl/;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)/"/>
|
||||
<SrcPath Value="$(LazarusDir)\lcl\;$(LazarusDir)\lcl\interfaces\$(LCLWidgetType)\"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<Generate Value="Faster"/>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
<Other>
|
||||
<CompilerPath Value="$(CompPath)"/>
|
||||
</Other>
|
||||
|
@ -3,14 +3,15 @@ object Form1: TForm1
|
||||
Caption = 'Form1'
|
||||
ClientHeight = 97
|
||||
ClientWidth = 400
|
||||
PixelsPerInch = 90
|
||||
HorzScrollBar.Page = 401
|
||||
VertScrollBar.Page = 98
|
||||
PixelsPerInch = 96
|
||||
HorzScrollBar.Page = 399
|
||||
VertScrollBar.Page = 96
|
||||
Left = 310
|
||||
Height = 97
|
||||
Top = 163
|
||||
Width = 400
|
||||
object Button1: TButton
|
||||
BorderSpacing.InnerBorder = 4
|
||||
Caption = 'Generate a PostScript file'
|
||||
OnClick = Button1Click
|
||||
TabOrder = 0
|
||||
@ -20,6 +21,7 @@ object Form1: TForm1
|
||||
Width = 352
|
||||
end
|
||||
object Button2: TButton
|
||||
BorderSpacing.InnerBorder = 4
|
||||
Caption = 'Show this file (kghostview)'
|
||||
OnClick = Button2Click
|
||||
TabOrder = 1
|
||||
|
@ -1,11 +1,14 @@
|
||||
{ This is an automatically generated lazarus resource file }
|
||||
|
||||
LazarusResources.Add('TForm1','FORMDATA',[
|
||||
'TPF0'#6'TForm1'#5'Form1'#13'ActiveControl'#7#7'Button1'#7'Caption'#6#5'Form1'
|
||||
+#12'ClientHeight'#2'a'#11'ClientWidth'#3#144#1#13'PixelsPerInch'#2'Z'#18'Hor'
|
||||
+'zScrollBar.Page'#3#145#1#18'VertScrollBar.Page'#2'b'#4'Left'#3'6'#1#6'Heigh'
|
||||
+'t'#2'a'#3'Top'#3#163#0#5'Width'#3#144#1#0#7'TButton'#7'Button1'#7'Caption'#6
|
||||
+#26'Generate a PostScript file'#7'OnClick'#7#12'Button1Click'#8'TabOrder'#2#0
|
||||
+#4'Left'#2#24#6'Height'#2#25#3'Top'#2#23#5'Width'#3'`'#1#0#0#7'TButton'#7'Bu'
|
||||
+'tton2'#7'Caption'#6#27'Show this file (kghostview)'#7'OnClick'#7#12'Button2'
|
||||
+'Click'#8'TabOrder'#2#1#4'Left'#2#24#6'Height'#2#25#3'Top'#2'8'#5'Width'#3'`'
|
||||
+#1#0#0#0
|
||||
+#12'ClientHeight'#2'a'#11'ClientWidth'#3#144#1#13'PixelsPerInch'#2'`'#18'Hor'
|
||||
+'zScrollBar.Page'#3#143#1#18'VertScrollBar.Page'#2'`'#4'Left'#3'6'#1#6'Heigh'
|
||||
+'t'#2'a'#3'Top'#3#163#0#5'Width'#3#144#1#0#7'TButton'#7'Button1'#25'BorderSp'
|
||||
+'acing.InnerBorder'#2#4#7'Caption'#6#26'Generate a PostScript file'#7'OnClic'
|
||||
+'k'#7#12'Button1Click'#8'TabOrder'#2#0#4'Left'#2#24#6'Height'#2#25#3'Top'#2
|
||||
+#23#5'Width'#3'`'#1#0#0#7'TButton'#7'Button2'#25'BorderSpacing.InnerBorder'#2
|
||||
+#4#7'Caption'#6#27'Show this file (kghostview)'#7'OnClick'#7#12'Button2Click'
|
||||
+#8'TabOrder'#2#1#4'Left'#2#24#6'Height'#2#25#3'Top'#2'8'#5'Width'#3'`'#1#0#0
|
||||
+#0
|
||||
]);
|
||||
|
@ -5,8 +5,14 @@ unit uSamplePostScriptCanvas;
|
||||
interface
|
||||
|
||||
uses
|
||||
{$IFDEF MSWINDOWS}
|
||||
Windows,
|
||||
{$ENDIF}
|
||||
{$IFDEF UNIX}
|
||||
Unix,
|
||||
{$ENDIF}
|
||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons,
|
||||
PostScriptCanvas, Unix;
|
||||
PostScriptCanvas;
|
||||
|
||||
type
|
||||
TForm1 = class(TForm)
|
||||
@ -177,10 +183,20 @@ begin
|
||||
end;
|
||||
|
||||
procedure TForm1.Button2Click(Sender: TObject);
|
||||
var
|
||||
FName: string;
|
||||
begin
|
||||
if Sender=nil then ;
|
||||
if FileExists(ExpandFileName('./test1.ps')) then
|
||||
Shell(format('kghostview %s',[ExpandFileName('./test1.ps')]));
|
||||
begin
|
||||
{$IFDEF MSWINDOWS}
|
||||
FName := '"C:\Program Files\Ghostgum\gsview\gsview32" ' + ExpandFileName('./test1.ps');
|
||||
ShellExecute(Handle, 'open', PChar(FName), nil, nil, SW_SHOWNORMAL)
|
||||
{$ENDIF}
|
||||
{$IFDEF UNIX}
|
||||
Shell(format('kghostview %s',[ExpandFileName('./test1.ps')]));
|
||||
{$ENDIF}
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
Loading…
Reference in New Issue
Block a user