mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 16:09:41 +02:00
Examples: Beginning to restructure the simple demos: move into individual folders, add a RAD version of each demo.
This commit is contained in:
parent
744d5506fd
commit
f5a28ea008
129
examples/simple/rad/bitbtn/bitbtnform.lfm
Normal file
129
examples/simple/rad/bitbtn/bitbtnform.lfm
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
object Form1: TForm1
|
||||||
|
Left = 270
|
||||||
|
Height = 170
|
||||||
|
Top = 131
|
||||||
|
Width = 335
|
||||||
|
Caption = 'TBitBtn Verify'
|
||||||
|
ClientHeight = 170
|
||||||
|
ClientWidth = 335
|
||||||
|
OnCreate = FormCreate
|
||||||
|
LCLVersion = '2.3.0.0'
|
||||||
|
object BitBtn1: TBitBtn
|
||||||
|
Left = 12
|
||||||
|
Height = 120
|
||||||
|
Top = 12
|
||||||
|
Width = 120
|
||||||
|
Caption = 'BitBtn1'
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object GroupBox1: TGroupBox
|
||||||
|
Left = 144
|
||||||
|
Height = 120
|
||||||
|
Top = 12
|
||||||
|
Width = 80
|
||||||
|
Caption = 'Kind'
|
||||||
|
ClientHeight = 100
|
||||||
|
ClientWidth = 76
|
||||||
|
TabOrder = 1
|
||||||
|
object RadioButton1: TRadioButton
|
||||||
|
Left = 8
|
||||||
|
Height = 19
|
||||||
|
Top = 6
|
||||||
|
Width = 47
|
||||||
|
Caption = 'Close'
|
||||||
|
Checked = True
|
||||||
|
OnChange = RadioButton1Change
|
||||||
|
TabOrder = 3
|
||||||
|
TabStop = True
|
||||||
|
end
|
||||||
|
object RadioButton2: TRadioButton
|
||||||
|
Left = 8
|
||||||
|
Height = 19
|
||||||
|
Top = 28
|
||||||
|
Width = 34
|
||||||
|
Caption = 'OK'
|
||||||
|
OnChange = RadioButton2Change
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object RadioButton3: TRadioButton
|
||||||
|
Left = 8
|
||||||
|
Height = 19
|
||||||
|
Top = 50
|
||||||
|
Width = 54
|
||||||
|
Caption = 'Cancel'
|
||||||
|
OnChange = RadioButton3Change
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object RadioButton4: TRadioButton
|
||||||
|
Left = 8
|
||||||
|
Height = 19
|
||||||
|
Top = 72
|
||||||
|
Width = 43
|
||||||
|
Caption = 'Help'
|
||||||
|
OnChange = RadioButton4Change
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object GroupBox2: TGroupBox
|
||||||
|
Left = 240
|
||||||
|
Height = 120
|
||||||
|
Top = 12
|
||||||
|
Width = 80
|
||||||
|
Caption = 'Type'
|
||||||
|
ClientHeight = 100
|
||||||
|
ClientWidth = 76
|
||||||
|
TabOrder = 2
|
||||||
|
object RadioButton5: TRadioButton
|
||||||
|
Left = 8
|
||||||
|
Height = 19
|
||||||
|
Top = 6
|
||||||
|
Width = 38
|
||||||
|
Caption = 'Left'
|
||||||
|
Checked = True
|
||||||
|
OnChange = RadioButton5Change
|
||||||
|
TabOrder = 0
|
||||||
|
TabStop = True
|
||||||
|
end
|
||||||
|
object RadioButton6: TRadioButton
|
||||||
|
Left = 8
|
||||||
|
Height = 19
|
||||||
|
Top = 28
|
||||||
|
Width = 38
|
||||||
|
Caption = 'Top'
|
||||||
|
OnChange = RadioButton6Change
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object RadioButton7: TRadioButton
|
||||||
|
Left = 8
|
||||||
|
Height = 19
|
||||||
|
Top = 50
|
||||||
|
Width = 46
|
||||||
|
Caption = 'Right'
|
||||||
|
OnChange = RadioButton7Change
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
object RadioButton8: TRadioButton
|
||||||
|
Left = 8
|
||||||
|
Height = 19
|
||||||
|
Top = 72
|
||||||
|
Width = 58
|
||||||
|
Caption = 'Bottom'
|
||||||
|
OnChange = RadioButton8Change
|
||||||
|
TabOrder = 3
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 144
|
||||||
|
Height = 15
|
||||||
|
Top = 144
|
||||||
|
Width = 34
|
||||||
|
Caption = 'Label1'
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 240
|
||||||
|
Height = 15
|
||||||
|
Top = 144
|
||||||
|
Width = 34
|
||||||
|
Caption = 'Label2'
|
||||||
|
end
|
||||||
|
end
|
108
examples/simple/rad/bitbtn/bitbtnform.pas
Normal file
108
examples/simple/rad/bitbtn/bitbtnform.pas
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
unit BitBtnForm;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Buttons, ExtCtrls,
|
||||||
|
StdCtrls;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TForm1 }
|
||||||
|
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
BitBtn1: TBitBtn;
|
||||||
|
GroupBox1: TGroupBox;
|
||||||
|
GroupBox2: TGroupBox;
|
||||||
|
Label1: TLabel;
|
||||||
|
Label2: TLabel;
|
||||||
|
RadioButton1: TRadioButton;
|
||||||
|
RadioButton2: TRadioButton;
|
||||||
|
RadioButton3: TRadioButton;
|
||||||
|
RadioButton4: TRadioButton;
|
||||||
|
RadioButton5: TRadioButton;
|
||||||
|
RadioButton6: TRadioButton;
|
||||||
|
RadioButton7: TRadioButton;
|
||||||
|
RadioButton8: TRadioButton;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure RadioButton1Change(Sender: TObject);
|
||||||
|
procedure RadioButton2Change(Sender: TObject);
|
||||||
|
procedure RadioButton3Change(Sender: TObject);
|
||||||
|
procedure RadioButton4Change(Sender: TObject);
|
||||||
|
procedure RadioButton5Change(Sender: TObject);
|
||||||
|
procedure RadioButton6Change(Sender: TObject);
|
||||||
|
procedure RadioButton7Change(Sender: TObject);
|
||||||
|
procedure RadioButton8Change(Sender: TObject);
|
||||||
|
private
|
||||||
|
|
||||||
|
public
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.lfm}
|
||||||
|
|
||||||
|
{ TForm1 }
|
||||||
|
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
RadioButton1Change(nil);
|
||||||
|
RadioButton5Change(nil);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.RadioButton1Change(Sender: TObject);
|
||||||
|
begin
|
||||||
|
BitBtn1.Kind := bkClose;
|
||||||
|
Label1.Caption := 'bkClose';
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.RadioButton2Change(Sender: TObject);
|
||||||
|
begin
|
||||||
|
BitBtn1.Kind := bkOK;
|
||||||
|
Label1.Caption := 'bkOK';
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.RadioButton3Change(Sender: TObject);
|
||||||
|
begin
|
||||||
|
BitBtn1.Kind := bkCancel;
|
||||||
|
Label1.Caption := 'bkCancel';
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.RadioButton4Change(Sender: TObject);
|
||||||
|
begin
|
||||||
|
BitBtn1.Kind := bkHelp;
|
||||||
|
Label1.Caption := 'bkHelp';
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.RadioButton5Change(Sender: TObject);
|
||||||
|
begin
|
||||||
|
BitBtn1.Layout := blGlyphLeft;
|
||||||
|
Label2.Caption := 'blGlyphLeft';
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.RadioButton6Change(Sender: TObject);
|
||||||
|
begin
|
||||||
|
BitBtn1.Layout := blGlyphTop;
|
||||||
|
Label2.Caption := 'blGlyphTop';
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.RadioButton7Change(Sender: TObject);
|
||||||
|
begin
|
||||||
|
BitBtn1.Layout := blGlyphRight;
|
||||||
|
Label2.Caption := 'blGlyphRight';
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.RadioButton8Change(Sender: TObject);
|
||||||
|
begin
|
||||||
|
BitBtn1.Layout := blGlyphBottom;
|
||||||
|
Label2.Caption := 'blGlyphBottom';
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
81
examples/simple/rad/bitbtn/bitbutton_demo.lpi
Normal file
81
examples/simple/rad/bitbtn/bitbutton_demo.lpi
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<Version Value="12"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<General>
|
||||||
|
<SessionStorage Value="InProjectDir"/>
|
||||||
|
<Title Value="BitButton_Demo"/>
|
||||||
|
<Scaled Value="True"/>
|
||||||
|
<ResourceType Value="res"/>
|
||||||
|
<UseXPManifest Value="True"/>
|
||||||
|
<XPManifest>
|
||||||
|
<DpiAware Value="True"/>
|
||||||
|
</XPManifest>
|
||||||
|
<Icon Value="0"/>
|
||||||
|
</General>
|
||||||
|
<BuildModes>
|
||||||
|
<Item Name="Default" Default="True"/>
|
||||||
|
</BuildModes>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<UseFileFilters Value="True"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<FormatVersion Value="2"/>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages>
|
||||||
|
<Item>
|
||||||
|
<PackageName Value="LCL"/>
|
||||||
|
</Item>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units>
|
||||||
|
<Unit>
|
||||||
|
<Filename Value="BitButton_Demo.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
</Unit>
|
||||||
|
<Unit>
|
||||||
|
<Filename Value="bitbtnform.pas"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<ComponentName Value="Form1"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceBaseClass Value="Form"/>
|
||||||
|
<UnitName Value="BitBtnForm"/>
|
||||||
|
</Unit>
|
||||||
|
</Units>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="11"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<Target>
|
||||||
|
<Filename Value="BitButton_Demo"/>
|
||||||
|
</Target>
|
||||||
|
<SearchPaths>
|
||||||
|
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||||
|
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||||
|
</SearchPaths>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<DebugInfoType Value="dsDwarf2Set"/>
|
||||||
|
</Debugging>
|
||||||
|
<Options>
|
||||||
|
<Win32>
|
||||||
|
<GraphicApplication Value="True"/>
|
||||||
|
</Win32>
|
||||||
|
</Options>
|
||||||
|
</Linking>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<Exceptions>
|
||||||
|
<Item>
|
||||||
|
<Name Value="EAbort"/>
|
||||||
|
</Item>
|
||||||
|
<Item>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item>
|
||||||
|
<Item>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
25
examples/simple/rad/bitbtn/bitbutton_demo.lpr
Normal file
25
examples/simple/rad/bitbtn/bitbutton_demo.lpr
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
program BitButton_Demo;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
{$IFDEF UNIX}
|
||||||
|
cthreads,
|
||||||
|
{$ENDIF}
|
||||||
|
{$IFDEF HASAMIGA}
|
||||||
|
athreads,
|
||||||
|
{$ENDIF}
|
||||||
|
Interfaces, // this includes the LCL widgetset
|
||||||
|
Forms, BitBtnForm
|
||||||
|
{ you can add units after this };
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
begin
|
||||||
|
RequireDerivedFormResource:=True;
|
||||||
|
Application.Scaled:=True;
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
|
|
@ -1,27 +1,30 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<CONFIG>
|
<CONFIG>
|
||||||
<ProjectOptions>
|
<ProjectOptions>
|
||||||
<Version Value="10"/>
|
<Version Value="12"/>
|
||||||
<General>
|
<General>
|
||||||
<Flags>
|
<Flags>
|
||||||
<SaveOnlyProjectUnits Value="True"/>
|
<SaveOnlyProjectUnits Value="True"/>
|
||||||
<LRSInOutputDirectory Value="False"/>
|
<LRSInOutputDirectory Value="False"/>
|
||||||
|
<CompatibilityMode Value="True"/>
|
||||||
</Flags>
|
</Flags>
|
||||||
<MainUnit Value="0"/>
|
<Scaled Value="True"/>
|
||||||
|
<UseXPManifest Value="True"/>
|
||||||
|
<XPManifest>
|
||||||
|
<DpiAware Value="True"/>
|
||||||
|
</XPManifest>
|
||||||
</General>
|
</General>
|
||||||
<BuildModes Count="1">
|
<BuildModes Count="1">
|
||||||
<Item1 Name="default" Default="True"/>
|
<Item1 Name="default" Default="True"/>
|
||||||
</BuildModes>
|
</BuildModes>
|
||||||
<PublishOptions>
|
<PublishOptions>
|
||||||
<Version Value="2"/>
|
<Version Value="2"/>
|
||||||
<IgnoreBinaries Value="False"/>
|
|
||||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
|
||||||
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
|
||||||
</PublishOptions>
|
</PublishOptions>
|
||||||
<RunParams>
|
<RunParams>
|
||||||
<local>
|
<FormatVersion Value="2"/>
|
||||||
<FormatVersion Value="1"/>
|
<Modes Count="1">
|
||||||
</local>
|
<Mode0 Name="default"/>
|
||||||
|
</Modes>
|
||||||
</RunParams>
|
</RunParams>
|
||||||
<RequiredPackages Count="1">
|
<RequiredPackages Count="1">
|
||||||
<Item1>
|
<Item1>
|
||||||
@ -32,8 +35,9 @@
|
|||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="bitbutton.pp"/>
|
<Filename Value="bitbutton.pp"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<CursorPos X="28" Y="26"/>
|
<EditorIndex Value="1"/>
|
||||||
<UsageCount Value="20"/>
|
<CursorPos X="19" Y="33"/>
|
||||||
|
<UsageCount Value="21"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
<LoadedDesigner Value="True"/>
|
<LoadedDesigner Value="True"/>
|
||||||
</Unit0>
|
</Unit0>
|
||||||
@ -41,9 +45,9 @@
|
|||||||
<Filename Value="bitbtnform.pp"/>
|
<Filename Value="bitbtnform.pp"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<IsVisibleTab Value="True"/>
|
<IsVisibleTab Value="True"/>
|
||||||
<EditorIndex Value="1"/>
|
<TopLine Value="249"/>
|
||||||
<CursorPos X="24" Y="21"/>
|
<CursorPos X="62" Y="265"/>
|
||||||
<UsageCount Value="20"/>
|
<UsageCount Value="21"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
</Units>
|
</Units>
|
||||||
@ -51,6 +55,9 @@
|
|||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
<Version Value="11"/>
|
<Version Value="11"/>
|
||||||
<Linking>
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<DebugInfoType Value="dsDwarf2Set"/>
|
||||||
|
</Debugging>
|
||||||
<Options>
|
<Options>
|
||||||
<Win32>
|
<Win32>
|
||||||
<GraphicApplication Value="True"/>
|
<GraphicApplication Value="True"/>
|
@ -25,7 +25,11 @@ program bitbutton;
|
|||||||
uses
|
uses
|
||||||
interfaces, forms, bitbtnform;
|
interfaces, forms, bitbtnform;
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Application.Scaled:=True;
|
||||||
|
Application.Title:='';
|
||||||
Application.Initialize;
|
Application.Initialize;
|
||||||
Application.CreateForm(TForm1, Form1);
|
Application.CreateForm(TForm1, Form1);
|
||||||
Application.Run;
|
Application.Run;
|
Loading…
Reference in New Issue
Block a user