You've already forked lazarus-ccr
OnGuard: Fix ModifierForm crashing due to unknown Font.Color=clText. Childsizing-layout of controls.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8717 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -44,7 +44,7 @@ procedure Register;
|
||||
implementation
|
||||
|
||||
uses
|
||||
Classes, Forms, {AH.01}
|
||||
System.UITypes, Classes, Forms,
|
||||
qogabout0, ogconst,ognetwrk, ogproexe, {AH.01}
|
||||
onguard, {AH.01}
|
||||
qonguard2, {AH.01}
|
||||
@ -124,6 +124,40 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
{-------------------------------------------------------------------------------
|
||||
TOgModifierProperty
|
||||
Property editor for ranges
|
||||
-------------------------------------------------------------------------------}
|
||||
type
|
||||
TOgModifierProperty = class(TStringProperty)
|
||||
public
|
||||
function GetAttributes: TPropertyAttributes; override;
|
||||
function GetValue: string; override;
|
||||
procedure Edit; override;
|
||||
end;
|
||||
|
||||
function TOgModifierProperty.GetAttributes: TPropertyAttributes;
|
||||
begin
|
||||
Result := [paDialog];
|
||||
end;
|
||||
|
||||
function TOgModifierProperty.GetValue: string;
|
||||
begin
|
||||
Result := inherited GetValue;
|
||||
end;
|
||||
|
||||
procedure TOgModifierProperty.Edit;
|
||||
begin
|
||||
with TModifierFrm.Create(Application) do
|
||||
try
|
||||
if ShowModal = mrOK then
|
||||
SetValue(BufferToHex(Modifier, SizeOf(Modifier)));
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
{-------------------------------------------------------------------------------
|
||||
TOgAboutProperty
|
||||
-------------------------------------------------------------------------------}
|
||||
|
@ -1,101 +1,121 @@
|
||||
object ModifierFrm: TModifierFrm
|
||||
Left = 295
|
||||
Height = 145
|
||||
Height = 179
|
||||
Top = 224
|
||||
Width = 433
|
||||
ActiveControl = NoModifierCb
|
||||
AutoSize = True
|
||||
BorderIcons = [biSystemMenu, biMinimize]
|
||||
Caption = 'Generate Modifier'
|
||||
ClientHeight = 145
|
||||
ClientHeight = 179
|
||||
ClientWidth = 433
|
||||
Font.Color = clText
|
||||
Font.Height = 11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Pitch = fpVariable
|
||||
OnCreate = FormCreate
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '0.9.27'
|
||||
LCLVersion = '2.3.0.0'
|
||||
object OKBtn: TBitBtn
|
||||
Left = 285
|
||||
Height = 26
|
||||
Top = 104
|
||||
Width = 57
|
||||
AnchorSideTop.Control = CancelBtn
|
||||
AnchorSideRight.Control = CancelBtn
|
||||
Left = 238
|
||||
Height = 25
|
||||
Top = 118
|
||||
Width = 75
|
||||
Anchors = [akTop, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Right = 4
|
||||
Caption = 'OK'
|
||||
Constraints.MinWidth = 75
|
||||
Default = True
|
||||
ModalResult = 1
|
||||
NumGlyphs = 0
|
||||
TabOrder = 1
|
||||
end
|
||||
object CancelBtn: TBitBtn
|
||||
Left = 344
|
||||
Height = 24
|
||||
Top = 104
|
||||
Width = 62
|
||||
AnchorSideTop.Control = GroupBox1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = GroupBox1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 317
|
||||
Height = 25
|
||||
Top = 118
|
||||
Width = 75
|
||||
Anchors = [akTop, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Bottom = 8
|
||||
Caption = 'Cancel'
|
||||
Constraints.MinWidth = 75
|
||||
ModalResult = 2
|
||||
NumGlyphs = 0
|
||||
TabOrder = 2
|
||||
end
|
||||
object GroupBox1: TGroupBox
|
||||
Left = 3
|
||||
Height = 90
|
||||
Top = 6
|
||||
Width = 406
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = Owner
|
||||
Left = 8
|
||||
Height = 102
|
||||
Top = 8
|
||||
Width = 384
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 8
|
||||
Caption = '&Modifiers'
|
||||
ClientHeight = 72
|
||||
ClientWidth = 402
|
||||
ChildSizing.LeftRightSpacing = 24
|
||||
ChildSizing.TopBottomSpacing = 16
|
||||
ChildSizing.HorizontalSpacing = 24
|
||||
ChildSizing.VerticalSpacing = 8
|
||||
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
|
||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||
ChildSizing.ControlsPerLine = 3
|
||||
ClientHeight = 82
|
||||
ClientWidth = 380
|
||||
TabOrder = 0
|
||||
object UniqueModifierCb: TCheckBox
|
||||
Left = 133
|
||||
Height = 17
|
||||
Top = 37
|
||||
Width = 91
|
||||
Caption = 'Unique modifier'
|
||||
object NoModifierCb: TCheckBox
|
||||
Left = 24
|
||||
Height = 19
|
||||
Top = 16
|
||||
Width = 82
|
||||
Caption = 'No modifier'
|
||||
OnClick = ModifierClick
|
||||
TabOrder = 3
|
||||
TabOrder = 0
|
||||
end
|
||||
object MachineModifierCb: TCheckBox
|
||||
Left = 133
|
||||
Height = 17
|
||||
Top = 20
|
||||
Width = 98
|
||||
Left = 130
|
||||
Height = 19
|
||||
Top = 16
|
||||
Width = 112
|
||||
Caption = 'Machine modifier'
|
||||
OnClick = ModifierClick
|
||||
TabOrder = 1
|
||||
end
|
||||
object DateModifierCb: TCheckBox
|
||||
Left = 267
|
||||
Height = 17
|
||||
Top = 18
|
||||
Width = 80
|
||||
Left = 266
|
||||
Height = 19
|
||||
Top = 16
|
||||
Width = 90
|
||||
Caption = 'Date modifier'
|
||||
OnClick = ModifierClick
|
||||
TabOrder = 2
|
||||
end
|
||||
object NoModifierCb: TCheckBox
|
||||
Left = 11
|
||||
Height = 17
|
||||
Top = 18
|
||||
Width = 71
|
||||
Caption = 'No modifier'
|
||||
OnClick = ModifierClick
|
||||
TabOrder = 0
|
||||
end
|
||||
object ModifierEd: TEdit
|
||||
Left = 12
|
||||
Left = 24
|
||||
Height = 23
|
||||
Top = 34
|
||||
Width = 104
|
||||
Top = 43
|
||||
Width = 82
|
||||
OnChange = InfoChanged
|
||||
OnKeyPress = ModifierEdKeyPress
|
||||
TabOrder = 3
|
||||
end
|
||||
object UniqueModifierCb: TCheckBox
|
||||
Left = 130
|
||||
Height = 23
|
||||
Top = 43
|
||||
Width = 112
|
||||
Caption = 'Unique modifier'
|
||||
OnClick = ModifierClick
|
||||
TabOrder = 4
|
||||
end
|
||||
object ModDateEd: TEdit
|
||||
Left = 267
|
||||
Left = 266
|
||||
Height = 23
|
||||
Hint = 'Code is invalid after this date'
|
||||
Top = 35
|
||||
Width = 120
|
||||
Top = 43
|
||||
Width = 90
|
||||
Enabled = False
|
||||
MaxLength = 10
|
||||
OnChange = ModifierClick
|
||||
|
@ -1,32 +1,42 @@
|
||||
{ To jest automatycznie wygenerowany plik zasob�w lazarusa }
|
||||
{ This is an automatically generated lazarus resource file }
|
||||
|
||||
LazarusResources.Add('TModifierFrm','FORMDATA',[
|
||||
'TPF0'#12'TModifierFrm'#11'ModifierFrm'#4'Left'#3''''#1#6'Height'#3#145#0#3'T'
|
||||
+'op'#3#224#0#5'Width'#3#177#1#13'ActiveControl'#7#12'NoModifierCb'#11'Border'
|
||||
+'Icons'#11#12'biSystemMenu'#10'biMinimize'#0#7'Caption'#6#17'Generate Modifi'
|
||||
+'er'#12'ClientHeight'#3#145#0#11'ClientWidth'#3#177#1#10'Font.Color'#7#6'clT'
|
||||
+'ext'#11'Font.Height'#2#11#9'Font.Name'#6#13'MS Sans Serif'#10'Font.Pitch'#7
|
||||
+#10'fpVariable'#8'OnCreate'#7#10'FormCreate'#8'Position'#7#14'poScreenCenter'
|
||||
+#10'LCLVersion'#6#6'0.9.27'#0#7'TBitBtn'#5'OKBtn'#4'Left'#3#29#1#6'Height'#2
|
||||
+#26#3'Top'#2'h'#5'Width'#2'9'#7'Caption'#6#2'OK'#7'Default'#9#11'ModalResult'
|
||||
+#2#1#9'NumGlyphs'#2#0#8'TabOrder'#2#1#0#0#7'TBitBtn'#9'CancelBtn'#4'Left'#3
|
||||
+'X'#1#6'Height'#2#24#3'Top'#2'h'#5'Width'#2'>'#7'Caption'#6#6'Cancel'#11'Mod'
|
||||
+'alResult'#2#2#9'NumGlyphs'#2#0#8'TabOrder'#2#2#0#0#9'TGroupBox'#9'GroupBox1'
|
||||
+#4'Left'#2#3#6'Height'#2'Z'#3'Top'#2#6#5'Width'#3#150#1#7'Caption'#6#10'&Mod'
|
||||
+'ifiers'#12'ClientHeight'#2'H'#11'ClientWidth'#3#146#1#8'TabOrder'#2#0#0#9'T'
|
||||
+'CheckBox'#16'UniqueModifierCb'#4'Left'#3#133#0#6'Height'#2#17#3'Top'#2'%'#5
|
||||
+'Width'#2'['#7'Caption'#6#15'Unique modifier'#7'OnClick'#7#13'ModifierClick'
|
||||
+#8'TabOrder'#2#3#0#0#9'TCheckBox'#17'MachineModifierCb'#4'Left'#3#133#0#6'He'
|
||||
+'ight'#2#17#3'Top'#2#20#5'Width'#2'b'#7'Caption'#6#16'Machine modifier'#7'On'
|
||||
+'Click'#7#13'ModifierClick'#8'TabOrder'#2#1#0#0#9'TCheckBox'#14'DateModifier'
|
||||
+'Cb'#4'Left'#3#11#1#6'Height'#2#17#3'Top'#2#18#5'Width'#2'P'#7'Caption'#6#13
|
||||
+'Date modifier'#7'OnClick'#7#13'ModifierClick'#8'TabOrder'#2#2#0#0#9'TCheckB'
|
||||
+'ox'#12'NoModifierCb'#4'Left'#2#11#6'Height'#2#17#3'Top'#2#18#5'Width'#2'G'#7
|
||||
+'Caption'#6#11'No modifier'#7'OnClick'#7#13'ModifierClick'#8'TabOrder'#2#0#0
|
||||
+#0#5'TEdit'#10'ModifierEd'#4'Left'#2#12#6'Height'#2#23#3'Top'#2'"'#5'Width'#2
|
||||
+'h'#8'OnChange'#7#11'InfoChanged'#10'OnKeyPress'#7#18'ModifierEdKeyPress'#8
|
||||
+'TabOrder'#2#4#0#0#5'TEdit'#9'ModDateEd'#4'Left'#3#11#1#6'Height'#2#23#4'Hin'
|
||||
+'t'#6#31'Code is invalid after this date'#3'Top'#2'#'#5'Width'#2'x'#7'Enable'
|
||||
+'d'#8#9'MaxLength'#2#10#8'OnChange'#7#13'ModifierClick'#10'OnKeyPress'#7#14
|
||||
+'DateEdKeyPress'#8'TabOrder'#2#5#0#0#0#0
|
||||
'TPF0'#12'TModifierFrm'#11'ModifierFrm'#4'Left'#3''''#1#6'Height'#3#179#0#3'T'
|
||||
+'op'#3#224#0#5'Width'#3#177#1#13'ActiveControl'#7#12'NoModifierCb'#8'AutoSiz'
|
||||
+'e'#9#11'BorderIcons'#11#12'biSystemMenu'#10'biMinimize'#0#7'Caption'#6#17'G'
|
||||
+'enerate Modifier'#12'ClientHeight'#3#179#0#11'ClientWidth'#3#177#1#8'OnCrea'
|
||||
+'te'#7#10'FormCreate'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#7'2.'
|
||||
+'3.0.0'#0#7'TBitBtn'#5'OKBtn'#21'AnchorSideTop.Control'#7#9'CancelBtn'#23'An'
|
||||
+'chorSideRight.Control'#7#9'CancelBtn'#4'Left'#3#238#0#6'Height'#2#25#3'Top'
|
||||
+#2'v'#5'Width'#2'K'#7'Anchors'#11#5'akTop'#7'akRight'#0#8'AutoSize'#9#19'Bor'
|
||||
+'derSpacing.Right'#2#4#7'Caption'#6#2'OK'#20'Constraints.MinWidth'#2'K'#7'De'
|
||||
+'fault'#9#11'ModalResult'#2#1#8'TabOrder'#2#1#0#0#7'TBitBtn'#9'CancelBtn'#21
|
||||
+'AnchorSideTop.Control'#7#9'GroupBox1'#18'AnchorSideTop.Side'#7#9'asrBottom'
|
||||
+#23'AnchorSideRight.Control'#7#9'GroupBox1'#20'AnchorSideRight.Side'#7#9'asr'
|
||||
+'Bottom'#4'Left'#3'='#1#6'Height'#2#25#3'Top'#2'v'#5'Width'#2'K'#7'Anchors'
|
||||
+#11#5'akTop'#7'akRight'#0#8'AutoSize'#9#20'BorderSpacing.Bottom'#2#8#7'Capti'
|
||||
+'on'#6#6'Cancel'#20'Constraints.MinWidth'#2'K'#11'ModalResult'#2#2#8'TabOrde'
|
||||
+'r'#2#2#0#0#9'TGroupBox'#9'GroupBox1'#22'AnchorSideLeft.Control'#7#5'Owner'
|
||||
+#21'AnchorSideTop.Control'#7#5'Owner'#4'Left'#2#8#6'Height'#2'f'#3'Top'#2#8#5
|
||||
+'Width'#3#128#1#8'AutoSize'#9#20'BorderSpacing.Around'#2#8#7'Caption'#6#10'&'
|
||||
+'Modifiers'#28'ChildSizing.LeftRightSpacing'#2#24#28'ChildSizing.TopBottomSp'
|
||||
+'acing'#2#16#29'ChildSizing.HorizontalSpacing'#2#24#27'ChildSizing.VerticalS'
|
||||
+'pacing'#2#8#29'ChildSizing.EnlargeHorizontal'#7#24'crsHomogenousChildResize'
|
||||
+#18'ChildSizing.Layout'#7#29'cclLeftToRightThenTopToBottom'#27'ChildSizing.C'
|
||||
+'ontrolsPerLine'#2#3#12'ClientHeight'#2'R'#11'ClientWidth'#3'|'#1#8'TabOrder'
|
||||
+#2#0#0#9'TCheckBox'#12'NoModifierCb'#4'Left'#2#24#6'Height'#2#19#3'Top'#2#16
|
||||
+#5'Width'#2'R'#7'Caption'#6#11'No modifier'#7'OnClick'#7#13'ModifierClick'#8
|
||||
+'TabOrder'#2#0#0#0#9'TCheckBox'#17'MachineModifierCb'#4'Left'#3#130#0#6'Heig'
|
||||
+'ht'#2#19#3'Top'#2#16#5'Width'#2'p'#7'Caption'#6#16'Machine modifier'#7'OnCl'
|
||||
+'ick'#7#13'ModifierClick'#8'TabOrder'#2#1#0#0#9'TCheckBox'#14'DateModifierCb'
|
||||
+#4'Left'#3#10#1#6'Height'#2#19#3'Top'#2#16#5'Width'#2'Z'#7'Caption'#6#13'Dat'
|
||||
+'e modifier'#7'OnClick'#7#13'ModifierClick'#8'TabOrder'#2#2#0#0#5'TEdit'#10
|
||||
+'ModifierEd'#4'Left'#2#24#6'Height'#2#23#3'Top'#2'+'#5'Width'#2'R'#8'OnChang'
|
||||
+'e'#7#11'InfoChanged'#10'OnKeyPress'#7#18'ModifierEdKeyPress'#8'TabOrder'#2#3
|
||||
+#0#0#9'TCheckBox'#16'UniqueModifierCb'#4'Left'#3#130#0#6'Height'#2#23#3'Top'
|
||||
+#2'+'#5'Width'#2'p'#7'Caption'#6#15'Unique modifier'#7'OnClick'#7#13'Modifie'
|
||||
+'rClick'#8'TabOrder'#2#4#0#0#5'TEdit'#9'ModDateEd'#4'Left'#3#10#1#6'Height'#2
|
||||
+#23#4'Hint'#6#31'Code is invalid after this date'#3'Top'#2'+'#5'Width'#2'Z'#7
|
||||
+'Enabled'#8#9'MaxLength'#2#10#8'OnChange'#7#13'ModifierClick'#10'OnKeyPress'
|
||||
+#7#14'DateEdKeyPress'#8'TabOrder'#2#5#0#0#0#0
|
||||
]);
|
||||
|
@ -34,22 +34,16 @@
|
||||
|
||||
{$I ONGUARD.INC}
|
||||
|
||||
|
||||
unit qonguard6; {AH.01}
|
||||
unit qonguard6;
|
||||
{-Code generation dialog}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
SysUtils, Classes, {AH.01}
|
||||
Graphics, Controls, Forms, Dialogs,{ Mask,} {AH.01}
|
||||
ExtCtrls, StdCtrls, Buttons, {AH.01}
|
||||
ogutil, onguard, {AH.01}
|
||||
ComponentEditors,
|
||||
PropEdits,
|
||||
LazarusPackageIntf;
|
||||
|
||||
|
||||
SysUtils, Classes,
|
||||
Graphics, Controls, Forms,
|
||||
ExtCtrls, StdCtrls, Buttons,
|
||||
ogutil, onguard;
|
||||
|
||||
type
|
||||
TModifierFrm = class(TForm)
|
||||
@ -73,24 +67,10 @@ type
|
||||
end;
|
||||
|
||||
|
||||
type
|
||||
{property editor for ranges}
|
||||
TOgModifierProperty = class(TStringProperty)
|
||||
public
|
||||
function GetAttributes: TPropertyAttributes;
|
||||
override;
|
||||
function GetValue : string;
|
||||
override;
|
||||
procedure Edit;
|
||||
override;
|
||||
end;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
LResources;
|
||||
|
||||
|
||||
LResources;
|
||||
|
||||
procedure TModifierFrm.FormCreate(Sender: TObject);
|
||||
begin
|
||||
@ -201,28 +181,6 @@ begin
|
||||
HexToBuffer(ModifierEd.Text, Modifier, SizeOf(Modifier));
|
||||
end;
|
||||
|
||||
{*** TOgModifierProperty ***}
|
||||
|
||||
function TOgModifierProperty.GetAttributes: TPropertyAttributes;
|
||||
begin
|
||||
Result := [paDialog];
|
||||
end;
|
||||
|
||||
function TOgModifierProperty.GetValue : string;
|
||||
begin
|
||||
Result := inherited GetValue;
|
||||
end;
|
||||
|
||||
procedure TOgModifierProperty.Edit;
|
||||
begin
|
||||
with TModifierFrm.Create(Application) do
|
||||
try
|
||||
if ShowModal = mrOK then
|
||||
SetValue(BufferToHex(Modifier, SizeOf(Modifier)));
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$I qonguard6.lrs}
|
||||
|
Reference in New Issue
Block a user