OnGuard: Rework sample projects.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8721 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2023-02-20 11:17:45 +00:00
parent a1792b0941
commit d6279b614d
103 changed files with 2214 additions and 1689 deletions

View File

@ -59,8 +59,8 @@
<UnitName Value="Exdtp21u"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="87"/>
<CursorPos X="52" Y="107"/>
<TopLine Value="88"/>
<CursorPos X="3" Y="108"/>
<UsageCount Value="836"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
@ -74,7 +74,7 @@
<Loaded Value="True"/>
</Unit2>
</Units>
<JumpHistory Count="15" HistoryIndex="14">
<JumpHistory Count="16" HistoryIndex="15">
<Position1>
<Filename Value="exdtp21u.pas"/>
<Caret Line="83" Column="17" TopLine="69"/>
@ -135,6 +135,10 @@
<Filename Value="exdtp21u.pas"/>
<Caret Line="97" Column="49" TopLine="72"/>
</Position15>
<Position16>
<Filename Value="exdtp21u.pas"/>
<Caret Line="106" Column="37" TopLine="87"/>
</Position16>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>

View File

@ -4,16 +4,17 @@ object Form1: TForm1
Top = 279
Width = 228
AutoSize = True
BorderStyle = bsDialog
Caption = 'Form1'
ClientHeight = 155
ClientWidth = 228
OnActivate = FormActivate
Position = poScreenCenter
LCLVersion = '2.3.0.0'
object Label1: TLabel
object lblExpires: TLabel
AnchorSideLeft.Control = Owner
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = Memo1
AnchorSideTop.Control = Info
AnchorSideTop.Side = asrBottom
Left = 64
Height = 15
@ -25,17 +26,18 @@ object Form1: TForm1
object CloseBtn: TBitBtn
AnchorSideLeft.Control = Owner
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = Label1
AnchorSideTop.Control = Bevel1
AnchorSideTop.Side = asrBottom
Left = 70
Height = 33
Top = 81
Width = 89
Left = 91
Height = 26
Top = 96
Width = 46
AutoSize = True
BorderSpacing.Around = 12
Kind = bkClose
TabOrder = 0
end
object Memo1: TLabel
object Info: TLabel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
AnchorSideRight.Control = Owner
@ -48,7 +50,21 @@ object Form1: TForm1
BorderSpacing.Around = 12
Caption = 'If you can edit this, your program was allowed to run'
WordWrap = True
OnDblClick = Memo1DblClick
OnDblClick = InfoDblClick
end
object Bevel1: TBevel
AnchorSideLeft.Control = Info
AnchorSideTop.Control = lblExpires
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Info
AnchorSideRight.Side = asrBottom
Left = 12
Height = 3
Top = 81
Width = 204
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 12
Shape = bsTopLine
end
object OgDateCode1: TOgDateCode
OnChecked = OgDateCode1Checked

View File

@ -2,23 +2,29 @@
LazarusResources.Add('TForm1','FORMDATA',[
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'b'#1#6'Height'#3#155#0#3'Top'#3#23#1#5'Wi'
+'dth'#3#228#0#8'AutoSize'#9#7'Caption'#6#5'Form1'#12'ClientHeight'#3#155#0#11
+'ClientWidth'#3#228#0#10'OnActivate'#7#12'FormActivate'#8'Position'#7#14'poS'
+'creenCenter'#10'LCLVersion'#6#7'2.3.0.0'#0#6'TLabel'#6'Label1'#22'AnchorSid'
+'eLeft.Control'#7#5'Owner'#19'AnchorSideLeft.Side'#7#9'asrCenter'#21'AnchorS'
+'ideTop.Control'#7#5'Memo1'#18'AnchorSideTop.Side'#7#9'asrBottom'#4'Left'#2
+'@'#6'Height'#2#15#3'Top'#2'6'#5'Width'#2'e'#7'Caption'#6#19'Expires: 00/00/'
+'0000'#11'ParentColor'#8#0#0#7'TBitBtn'#8'CloseBtn'#22'AnchorSideLeft.Contro'
+'l'#7#5'Owner'#19'AnchorSideLeft.Side'#7#9'asrCenter'#21'AnchorSideTop.Contr'
+'ol'#7#6'Label1'#18'AnchorSideTop.Side'#7#9'asrBottom'#4'Left'#2'F'#6'Height'
+#2'!'#3'Top'#2'Q'#5'Width'#2'Y'#20'BorderSpacing.Around'#2#12#4'Kind'#7#7'bk'
+'Close'#8'TabOrder'#2#0#0#0#6'TLabel'#5'Memo1'#22'AnchorSideLeft.Control'#7#5
+'Owner'#21'AnchorSideTop.Control'#7#5'Owner'#23'AnchorSideRight.Control'#7#5
+'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#2#12#6'Height'#2#30#3
+'Top'#2#12#5'Width'#3#204#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#20
+'BorderSpacing.Around'#2#12#7'Caption'#6'5If you can edit this, your program'
+' was allowed to run'#8'WordWrap'#9#10'OnDblClick'#7#13'Memo1DblClick'#0#0#11
+'TOgDateCode'#11'OgDateCode1'#9'OnChecked'#7#18'OgDateCode1Checked'#8'OnGetK'
+'ey'#7#17'OgDateCode1GetKey'#9'OnGetCode'#7#18'OgDateCode1GetCode'#9'StoreCo'
+'de'#9#4'Left'#3#176#0#3'Top'#2'@'#0#0#0
+'dth'#3#228#0#8'AutoSize'#9#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#5'For'
+'m1'#12'ClientHeight'#3#155#0#11'ClientWidth'#3#228#0#10'OnActivate'#7#12'Fo'
+'rmActivate'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#7'2.3.0.0'#0#6
+'TLabel'#10'lblExpires'#22'AnchorSideLeft.Control'#7#5'Owner'#19'AnchorSideL'
+'eft.Side'#7#9'asrCenter'#21'AnchorSideTop.Control'#7#4'Info'#18'AnchorSideT'
+'op.Side'#7#9'asrBottom'#4'Left'#2'@'#6'Height'#2#15#3'Top'#2'6'#5'Width'#2
+'e'#7'Caption'#6#19'Expires: 00/00/0000'#11'ParentColor'#8#0#0#7'TBitBtn'#8
+'CloseBtn'#22'AnchorSideLeft.Control'#7#5'Owner'#19'AnchorSideLeft.Side'#7#9
+'asrCenter'#21'AnchorSideTop.Control'#7#6'Bevel1'#18'AnchorSideTop.Side'#7#9
+'asrBottom'#4'Left'#2'['#6'Height'#2#26#3'Top'#2'`'#5'Width'#2'.'#8'AutoSize'
+#9#20'BorderSpacing.Around'#2#12#4'Kind'#7#7'bkClose'#8'TabOrder'#2#0#0#0#6
+'TLabel'#4'Info'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Cont'
+'rol'#7#5'Owner'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.S'
+'ide'#7#9'asrBottom'#4'Left'#2#12#6'Height'#2#30#3'Top'#2#12#5'Width'#3#204#0
+#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#20'BorderSpacing.Around'#2#12
+#7'Caption'#6'5If you can edit this, your program was allowed to run'#8'Word'
+'Wrap'#9#10'OnDblClick'#7#12'InfoDblClick'#0#0#6'TBevel'#6'Bevel1'#22'Anchor'
+'SideLeft.Control'#7#4'Info'#21'AnchorSideTop.Control'#7#10'lblExpires'#18'A'
+'nchorSideTop.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#4'Info'#20
+'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#2#12#6'Height'#2#3#3'Top'#2'Q'
+#5'Width'#3#204#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#17'BorderSpa'
+'cing.Top'#2#12#5'Shape'#7#9'bsTopLine'#0#0#11'TOgDateCode'#11'OgDateCode1'#9
+'OnChecked'#7#18'OgDateCode1Checked'#8'OnGetKey'#7#17'OgDateCode1GetKey'#9'O'
+'nGetCode'#7#18'OgDateCode1GetCode'#9'StoreCode'#9#4'Left'#3#176#0#3'Top'#2
+'@'#0#0#0
]);

View File

@ -9,7 +9,7 @@ interface
uses
SysUtils,Classes,Controls,
Forms, Dialogs, StdCtrls, Buttons,LResources, OnGuard,
Forms, Dialogs, StdCtrls, Buttons,LResources, ExtCtrls, OnGuard,
OgUtil,
IniFiles;
@ -22,12 +22,13 @@ type
{ TForm1 }
TForm1 = class(TForm)
Bevel1: TBevel;
CloseBtn: TBitBtn;
Memo1: TLabel;
Info: TLabel;
OgDateCode1: TOgDateCode;
Label1: TLabel;
lblExpires: TLabel;
procedure FormActivate(Sender: TObject);
procedure Memo1DblClick(Sender: TObject);
procedure InfoDblClick(Sender: TObject);
procedure OgDateCode1GetKey(Sender: TObject; var Key: TKey);
procedure OgDateCode1GetCode(Sender: TObject; var Code: TCode);
procedure OgDateCode1Checked(Sender: TObject; Status: TCodeStatus);
@ -56,7 +57,7 @@ begin
if FExpired then Application.Terminate;
end;
procedure TForm1.Memo1DblClick(Sender: TObject);
procedure TForm1.InfoDblClick(Sender: TObject);
begin
ShowMessage(Inttostr(OgDateCode1.GetInvalidCount));
end;
@ -107,7 +108,7 @@ begin
// Status := ogValidCode; // -- just for testing the form
case Status of
ogValidCode : begin
Label1.Caption := 'Expires: ' + DateToStr(OgDateCode1.GetValue);
lblExpires.Caption := 'Expires: ' + DateToStr(OgDateCode1.GetValue);
Exit;
end;