mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-21 09:48:22 +02:00
Adds the lazdialogs testcase
git-svn-id: trunk@33651 -
This commit is contained in:
parent
1c3ceae6df
commit
b51f40bfee
6
.gitattributes
vendored
6
.gitattributes
vendored
@ -6074,6 +6074,12 @@ test/customdrawn/cd_test_all.ico -text
|
||||
test/customdrawn/cd_test_all.lpi svneol=native#text/plain
|
||||
test/customdrawn/cd_test_all.lpr svneol=native#text/plain
|
||||
test/customdrawn/cd_test_all.res -text
|
||||
test/customdrawn/lazdialogs_form.lfm svneol=native#text/plain
|
||||
test/customdrawn/lazdialogs_form.pas svneol=native#text/plain
|
||||
test/customdrawn/lazdialogs_test.ico -text
|
||||
test/customdrawn/lazdialogs_test.lpi svneol=native#text/plain
|
||||
test/customdrawn/lazdialogs_test.lpr svneol=native#text/plain
|
||||
test/customdrawn/lazdialogs_test.res -text
|
||||
test/customdrawn/mainform.lfm svneol=native#text/plain
|
||||
test/customdrawn/mainform.pas svneol=native#text/plain
|
||||
test/hello.ahk svneol=native#text/plain
|
||||
|
106
test/customdrawn/lazdialogs_form.lfm
Normal file
106
test/customdrawn/lazdialogs_form.lfm
Normal file
@ -0,0 +1,106 @@
|
||||
object Form1: TForm1
|
||||
Left = 315
|
||||
Height = 243
|
||||
Top = 183
|
||||
Width = 527
|
||||
Caption = 'Lazarus Dialogs Test'
|
||||
ClientHeight = 243
|
||||
ClientWidth = 527
|
||||
LCLVersion = '0.9.31'
|
||||
object buttonNativeOpen: TButton
|
||||
Left = 16
|
||||
Height = 25
|
||||
Top = 24
|
||||
Width = 250
|
||||
Caption = 'Native TOpenDialog'
|
||||
OnClick = buttonNativeOpenClick
|
||||
TabOrder = 0
|
||||
end
|
||||
object buttonLazOpen: TButton
|
||||
Left = 16
|
||||
Height = 25
|
||||
Top = 60
|
||||
Width = 250
|
||||
Caption = 'TLazOpenDialog'
|
||||
OnClick = buttonLazOpenClick
|
||||
TabOrder = 1
|
||||
end
|
||||
object buttonNativeSave: TButton
|
||||
Left = 16
|
||||
Height = 25
|
||||
Top = 96
|
||||
Width = 250
|
||||
Caption = 'Native TSaveDialog'
|
||||
OnClick = buttonNativeSaveClick
|
||||
TabOrder = 2
|
||||
end
|
||||
object buttonLazSave: TButton
|
||||
Left = 16
|
||||
Height = 25
|
||||
Top = 136
|
||||
Width = 250
|
||||
Caption = 'TLazSaveDialog'
|
||||
OnClick = buttonLazSaveClick
|
||||
TabOrder = 3
|
||||
end
|
||||
object buttonNativeSelectDir: TButton
|
||||
Left = 16
|
||||
Height = 25
|
||||
Top = 173
|
||||
Width = 250
|
||||
Caption = 'Native TSelectDirectoryDialog'
|
||||
OnClick = buttonNativeSelectDirClick
|
||||
TabOrder = 4
|
||||
end
|
||||
object buttonLazSelectDir: TButton
|
||||
Left = 16
|
||||
Height = 25
|
||||
Top = 208
|
||||
Width = 250
|
||||
Caption = 'TLazSelectDirectoryDialog'
|
||||
OnClick = buttonLazSelectDirClick
|
||||
TabOrder = 5
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 288
|
||||
Height = 17
|
||||
Top = 24
|
||||
Width = 100
|
||||
Caption = 'Input FileName:'
|
||||
ParentColor = False
|
||||
end
|
||||
object editInputFileName: TEdit
|
||||
Left = 288
|
||||
Height = 22
|
||||
Top = 48
|
||||
Width = 232
|
||||
TabOrder = 6
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 288
|
||||
Height = 17
|
||||
Top = 136
|
||||
Width = 107
|
||||
Caption = 'Output FileName'
|
||||
ParentColor = False
|
||||
end
|
||||
object editOutputFileName: TEdit
|
||||
Left = 288
|
||||
Height = 22
|
||||
Top = 160
|
||||
Width = 232
|
||||
TabOrder = 7
|
||||
end
|
||||
object dialogNativeOpen: TOpenDialog
|
||||
left = 8
|
||||
top = 8
|
||||
end
|
||||
object dialogNativeSave: TSaveDialog
|
||||
left = 56
|
||||
top = 8
|
||||
end
|
||||
object dialogNativeSelectDir: TSelectDirectoryDialog
|
||||
left = 112
|
||||
top = 8
|
||||
end
|
||||
end
|
110
test/customdrawn/lazdialogs_form.pas
Normal file
110
test/customdrawn/lazdialogs_form.pas
Normal file
@ -0,0 +1,110 @@
|
||||
unit lazdialogs_form;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||
ButtonPanel;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
buttonNativeOpen: TButton;
|
||||
buttonLazOpen: TButton;
|
||||
buttonNativeSave: TButton;
|
||||
buttonLazSave: TButton;
|
||||
buttonNativeSelectDir: TButton;
|
||||
buttonLazSelectDir: TButton;
|
||||
dialogNativeOpen: TOpenDialog;
|
||||
editInputFileName: TEdit;
|
||||
editOutputFileName: TEdit;
|
||||
Label1: TLabel;
|
||||
Label2: TLabel;
|
||||
dialogNativeSave: TSaveDialog;
|
||||
dialogNativeSelectDir: TSelectDirectoryDialog;
|
||||
procedure buttonLazSaveClick(Sender: TObject);
|
||||
procedure buttonNativeOpenClick(Sender: TObject);
|
||||
procedure buttonLazOpenClick(Sender: TObject);
|
||||
procedure buttonLazSelectDirClick(Sender: TObject);
|
||||
procedure buttonNativeSaveClick(Sender: TObject);
|
||||
procedure buttonNativeSelectDirClick(Sender: TObject);
|
||||
private
|
||||
{ private declarations }
|
||||
public
|
||||
{ public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
uses lazdialogs;
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
procedure TForm1.buttonNativeOpenClick(Sender: TObject);
|
||||
begin
|
||||
dialogNativeOpen.Execute;
|
||||
end;
|
||||
|
||||
procedure TForm1.buttonLazSaveClick(Sender: TObject);
|
||||
var
|
||||
lDialog: TLazSaveDialog;
|
||||
begin
|
||||
lDialog := TLazSaveDialog.Create(nil);
|
||||
try
|
||||
lDialog.FileName := editInputFileName.Text;
|
||||
lDialog.Execute;
|
||||
editOutputFileName.Text := lDialog.FileName;
|
||||
finally
|
||||
lDialog.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.buttonLazOpenClick(Sender: TObject);
|
||||
var
|
||||
lDialog: TLazOpenDialog;
|
||||
begin
|
||||
lDialog := TLazOpenDialog.Create(nil);
|
||||
try
|
||||
lDialog.FileName := editInputFileName.Text;
|
||||
lDialog.Execute;
|
||||
editOutputFileName.Text := lDialog.FileName;
|
||||
finally
|
||||
lDialog.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.buttonLazSelectDirClick(Sender: TObject);
|
||||
var
|
||||
lDialog: TLazSelectDirectoryDialog;
|
||||
begin
|
||||
lDialog := TLazSelectDirectoryDialog.Create(nil);
|
||||
try
|
||||
lDialog.FileName := editInputFileName.Text;
|
||||
lDialog.Execute;
|
||||
editOutputFileName.Text := lDialog.FileName;
|
||||
finally
|
||||
lDialog.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.buttonNativeSaveClick(Sender: TObject);
|
||||
begin
|
||||
dialogNativeSave.Execute;
|
||||
end;
|
||||
|
||||
procedure TForm1.buttonNativeSelectDirClick(Sender: TObject);
|
||||
begin
|
||||
dialogNativeSelectDir.Execute;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
BIN
test/customdrawn/lazdialogs_test.ico
Normal file
BIN
test/customdrawn/lazdialogs_test.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 134 KiB |
87
test/customdrawn/lazdialogs_test.lpi
Normal file
87
test/customdrawn/lazdialogs_test.lpi
Normal file
@ -0,0 +1,87 @@
|
||||
<?xml version="1.0"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="9"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
<Icon Value="0"/>
|
||||
</General>
|
||||
<i18n>
|
||||
<EnableI18N LFM="False"/>
|
||||
</i18n>
|
||||
<VersionInfo>
|
||||
<StringTable ProductVersion=""/>
|
||||
</VersionInfo>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||
<ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="1">
|
||||
<Item1>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item1>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="lazdialogs_test.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="lazdialogs_test"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="lazdialogs_form.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="lazdialogs_form"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<Target>
|
||||
<Filename Value="lazdialogs_test"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Linking>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
<Other>
|
||||
<CompilerMessages>
|
||||
<UseMsgFile Value="True"/>
|
||||
</CompilerMessages>
|
||||
<CompilerPath Value="$(CompPath)"/>
|
||||
</Other>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
22
test/customdrawn/lazdialogs_test.lpr
Normal file
22
test/customdrawn/lazdialogs_test.lpr
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
{$R *.res}
|
||||
|
||||
program lazdialogs_test;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms, lazdialogs_form
|
||||
{ you can add units after this };
|
||||
|
||||
begin
|
||||
RequireDerivedFormResource := True;
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
||||
|
BIN
test/customdrawn/lazdialogs_test.res
Normal file
BIN
test/customdrawn/lazdialogs_test.res
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user