Printers, updated dialogs sample

git-svn-id: trunk@41083 -
This commit is contained in:
jesus 2013-05-09 05:52:08 +00:00
parent 5e53bcfafa
commit 1629fddad5
5 changed files with 97 additions and 89 deletions

1
.gitattributes vendored
View File

@ -2605,7 +2605,6 @@ components/printers/qt/qtprinters_h.inc svneol=native#text/pascal
components/printers/qt/qtprndialogs.inc svneol=native#text/pascal
components/printers/readme.txt svneol=native#text/plain
components/printers/samples/dialogs/frmselprinter.lfm svneol=native#text/plain
components/printers/samples/dialogs/frmselprinter.lrs svneol=native#text/pascal
components/printers/samples/dialogs/frmselprinter.pas svneol=native#text/pascal
components/printers/samples/dialogs/selectprinter.lpi svneol=native#text/plain
components/printers/samples/dialogs/selectprinter.lpr svneol=native#text/pascal

View File

@ -1,20 +1,20 @@
object Form1: TForm1
Left = 335
Height = 504
Top = 141
Width = 340
Left = 606
Height = 574
Top = 122
Width = 338
ActiveControl = Button7
Caption = 'Form1'
ClientHeight = 504
ClientWidth = 340
ClientHeight = 574
ClientWidth = 338
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '0.9.27'
LCLVersion = '1.1'
object Label1: TLabel
Left = 12
Height = 14
Height = 13
Top = 4
Width = 230
Width = 229
Caption = 'This sample show how to use the printer dialogs'
ParentColor = False
end
@ -40,9 +40,9 @@ object Form1: TForm1
end
object SGrid: TStringGrid
Left = 8
Height = 304
Top = 192
Width = 320
Height = 302
Top = 264
Width = 318
AlternateColor = clCream
Anchors = [akTop, akLeft, akRight, akBottom]
AutoFillColumns = True
@ -59,7 +59,7 @@ object Form1: TForm1
MaxSize = 350
ReadOnly = True
Title.Caption = 'Value'
Width = 196
Width = 177
end>
DefaultColWidth = 120
FixedCols = 0
@ -71,7 +71,7 @@ object Form1: TForm1
OnSelectCell = SGridSelectCell
ColWidths = (
120
196
177
)
end
object Button3: TButton
@ -142,42 +142,94 @@ object Form1: TForm1
end
object txtOutputFile: TFileNameEdit
Left = 195
Height = 23
Height = 21
Top = 48
Width = 109
Width = 113
DialogKind = dkSave
DialogOptions = []
FilterIndex = 0
HideDirectories = False
ButtonWidth = 23
NumGlyphs = 0
NumGlyphs = 1
Anchors = [akTop, akLeft, akRight]
MaxLength = 0
TabOrder = 10
end
object Label2: TLabel
Left = 20
Height = 13
Top = 188
Width = 94
Caption = 'PageSetupDlg Title:'
ParentColor = False
end
object Label3: TLabel
Left = 12
Height = 13
Top = 212
Width = 102
Caption = 'PrinterSetupDlg Title:'
ParentColor = False
end
object txtPageSetupDlgTitle: TEdit
Left = 128
Height = 21
Top = 188
Width = 198
Anchors = [akTop, akLeft, akRight]
TabOrder = 11
Text = 'Printer Dialogs Tests: PageSetupDialog'
end
object txtPrinterSetupDlgTitle: TEdit
Left = 128
Height = 21
Top = 212
Width = 198
Anchors = [akTop, akLeft, akRight]
TabOrder = 12
Text = 'Printer Dialogs Tests: PrinterSetupDialog'
end
object Label4: TLabel
Left = 36
Height = 13
Top = 236
Width = 78
Caption = 'PrintDialog Title:'
ParentColor = False
end
object txtPrintDialogTitle: TEdit
Left = 128
Height = 21
Top = 236
Width = 198
Anchors = [akTop, akLeft, akRight]
TabOrder = 13
Text = 'Printer Dialogs Tests: PrinterDialog'
end
object PSD: TPrinterSetupDialog
Title = 'Testing dialog title'
left = 176
top = 240
left = 172
top = 452
end
object PD: TPrintDialog
Title = 'Testing title'
Collate = True
Copies = 1
FromPage = 2
MinPage = 2
MaxPage = 5
Options = [poPrintToFile, poPageNums, poSelection, poWarning, poHelp]
PrintToFile = True
ToPage = 3
left = 176
top = 272
left = 172
top = 484
end
object PopupMenu1: TPopupMenu
left = 216
top = 240
left = 212
top = 452
end
object PAGED: TPageSetupDialog
Title = 'Ustawienie strony raportu'
left = 176
top = 304
left = 172
top = 516
end
end

View File

@ -1,52 +0,0 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TForm1','FORMDATA',[
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'O'#1#6'Height'#3#248#1#3'Top'#3#141#0#5'W'
+'idth'#3'T'#1#13'ActiveControl'#7#7'Button7'#7'Caption'#6#5'Form1'#12'Client'
+'Height'#3#248#1#11'ClientWidth'#3'T'#1#8'OnCreate'#7#10'FormCreate'#8'Posit'
+'ion'#7#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.27'#0#6'TLabel'#6'Label1'#4
+'Left'#2#12#6'Height'#2#14#3'Top'#2#4#5'Width'#3#230#0#7'Caption'#6'/This sa'
+'mple show how to use the printer dialogs'#11'ParentColor'#8#0#0#7'TButton'#7
+'Button2'#4'Left'#2#8#6'Height'#2#27#3'Top'#2'3'#5'Width'#3#176#0#25'BorderS'
+'pacing.InnerBorder'#2#4#7'Caption'#6#27'Execute TPrinterSetupDialog'#7'OnCl'
+'ick'#7#12'Button2Click'#8'TabOrder'#2#0#0#0#7'TButton'#7'Button1'#4'Left'#2
+#8#6'Height'#2#27#3'Top'#2'N'#5'Width'#3#176#0#25'BorderSpacing.InnerBorder'
+#2#4#7'Caption'#6#20'Execute TPrintDialog'#7'OnClick'#7#12'Button1Click'#8'T'
+'abOrder'#2#1#0#0#11'TStringGrid'#5'SGrid'#4'Left'#2#8#6'Height'#3'0'#1#3'To'
+'p'#3#192#0#5'Width'#3'@'#1#14'AlternateColor'#7#7'clCream'#7'Anchors'#11#5
+'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#15'AutoFillColumns'#9#8'ColCount'
+#2#2#7'Columns'#14#1#5'Color'#7#9'clBtnFace'#12'SizePriority'#2#0#13'Title.C'
+'aption'#6#8'Property'#5'Width'#2'x'#0#1#7'MinSize'#2'<'#7'MaxSize'#3'^'#1#8
+'ReadOnly'#9#13'Title.Caption'#6#5'Value'#5'Width'#3#196#0#0#0#15'DefaultCol'
+'Width'#2'x'#9'FixedCols'#2#0#9'FixedRows'#2#0#7'Options'#11#10'goVertLine'
+#13'goRangeSelect'#14'goSmoothScroll'#0#8'RowCount'#2#15#8'TabOrder'#2#7#10
+'TitleStyle'#7#8'tsNative'#12'OnSelectCell'#7#15'SGridSelectCell'#9'ColWidth'
+'s'#1#2'x'#3#196#0#0#0#0#7'TButton'#7'Button3'#4'Left'#2#8#6'Height'#2#27#3
+'Top'#2'i'#5'Width'#3#176#0#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#24
+'Get default printer info'#7'OnClick'#7#12'Button3Click'#8'TabOrder'#2#2#0#0
+#7'TButton'#7'Button4'#4'Left'#3#200#0#6'Height'#2#27#3'Top'#3#155#0#5'Width'
+#2'X'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#10'Print test'#7'OnClic'
+'k'#7#12'Button4Click'#8'TabOrder'#2#3#0#0#7'TButton'#7'Button5'#4'Left'#2#8
+#6'Height'#2#25#3'Top'#3#132#0#5'Width'#3#176#0#25'BorderSpacing.InnerBorder'
+#2#4#7'Caption'#6#25'Update printer state info'#7'OnClick'#7#12'Button5Click'
+#8'TabOrder'#2#4#0#0#7'TButton'#7'Button6'#4'Left'#2#8#6'Height'#2#25#3'Top'
+#3#157#0#5'Width'#3#176#0#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#23
+'Show printer properties'#7'OnClick'#7#12'Button6Click'#8'TabOrder'#2#5#0#0#7
+'TButton'#7'Button7'#4'Left'#2#8#6'Height'#2#27#3'Top'#2#24#5'Width'#3#176#0
+#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#24'Execute TPageSetupDialog'
+#7'OnClick'#7#12'Button7Click'#8'TabOrder'#2#6#0#0#9'TCheckBox'#11'chkTestIm'
+'gs'#4'Left'#3#200#0#6'Height'#2#17#3'Top'#3#133#0#5'Width'#2'A'#7'Caption'#6
+#9'Test Imgs'#8'TabOrder'#2#8#0#0#9'TCheckBox'#13'chkOutputFile'#4'Left'#3
+#195#0#6'Height'#2#17#3'Top'#2#27#5'Width'#2'G'#7'Caption'#6#11'Output File'
+#8'TabOrder'#2#9#0#0#13'TFileNameEdit'#13'txtOutputFile'#4'Left'#3#195#0#6'H'
+'eight'#2#23#3'Top'#2'0'#5'Width'#2'm'#10'DialogKind'#7#6'dkSave'#13'DialogO'
+'ptions'#11#0#11'FilterIndex'#2#0#15'HideDirectories'#8#11'ButtonWidth'#2#23
+#9'NumGlyphs'#2#0#8'TabOrder'#2#10#0#0#19'TPrinterSetupDialog'#3'PSD'#5'Titl'
+'e'#6#20'Testing dialog title'#4'left'#3#176#0#3'top'#3#240#0#0#0#12'TPrintD'
+'ialog'#2'PD'#5'Title'#6#13'Testing title'#7'Collate'#9#6'Copies'#2#1#8'From'
+'Page'#2#2#7'MinPage'#2#2#7'MaxPage'#2#5#7'Options'#11#13'poPrintToFile'#10
+'poPageNums'#11'poSelection'#9'poWarning'#6'poHelp'#0#11'PrintToFile'#9#6'To'
+'Page'#2#3#4'left'#3#176#0#3'top'#3#16#1#0#0#10'TPopupMenu'#10'PopupMenu1'#4
+'left'#3#216#0#3'top'#3#240#0#0#0#16'TPageSetupDialog'#5'PAGED'#5'Title'#6#25
+'Ustawienie strony raportu'#4'left'#3#176#0#3'top'#3'0'#1#0#0#0
]);

View File

@ -41,6 +41,12 @@ type
Button7: TButton;
chkOutputFile: TCheckBox;
chkTestImgs: TCheckBox;
txtPageSetupDlgTitle: TEdit;
txtPrinterSetupDlgTitle: TEdit;
txtPrintDialogTitle: TEdit;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
txtOutputFile: TFileNameEdit;
Label1: TLABEL;
PAGED: TPageSetupDialog;
@ -82,6 +88,8 @@ implementation
uses
Printers,OsPrinters,LCLType,LClProc;
{$R *.lfm}
{ TForm1 }
procedure TForm1.AddInfo(const Desc : String; Const Info : String);
@ -280,6 +288,7 @@ end;
procedure TForm1.Button2Click(Sender: TObject);
begin
PSD.Title := txtPrinterSetupDlgTitle.Text;
if PSD.Execute then
UpdatePrinterInfo;
end;
@ -314,6 +323,7 @@ procedure TForm1.Button7Click(Sender: TObject);
var
s : String;
begin
PageD.Title:= txtPageSetupDlgTitle.Text;
if PAGED.Execute then
begin
UpdatePrinterInfo;
@ -354,6 +364,7 @@ procedure TForm1.Button1Click(Sender: TObject);
var
s,x : String;
begin
PD.Title := txtPrintDialogTitle.Text;
if PD.Execute then
begin
UpdatePrinterInfo;
@ -368,7 +379,4 @@ begin
end;
end;
initialization
{$I frmselprinter.lrs}
end.

View File

@ -1,19 +1,20 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<Version Value="9"/>
<PathDelim Value="\"/>
<Version Value="7"/>
<General>
<Flags>
<SaveClosedFiles Value="False"/>
<SaveOnlyProjectUnits Value="True"/>
<LRSInOutputDirectory Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<TargetFileExt Value=".exe"/>
<Title Value="selectprinter"/>
</General>
<BuildModes Count="1">
<Item1 Name="default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
@ -45,22 +46,22 @@
<Filename Value="frmselprinter.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="frmselprinter"/>
</Unit1>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="8"/>
<Version Value="11"/>
<PathDelim Value="\"/>
<SearchPaths>
<SrcPath Value="$(LazarusDir)\lcl\;$(LazarusDir)\lcl\interfaces\$(LCLWidgetType)\"/>
<SrcPath Value="$(LazarusDir)\lcl;$(LazarusDir)\lcl\interfaces\$(LCLWidgetType)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
<IncludeAssertionCode Value="True"/>
<UseAnsiStrings Value="True"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
@ -72,7 +73,7 @@
</CodeGeneration>
<Linking>
<Debugging>
<GenerateDebugInfo Value="True"/>
<DebugInfoType Value="dsStabs"/>
</Debugging>
<Options>
<Win32>