OnGuard: Move TOgAboutProperty code in unit qoAbout0

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8716 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2023-02-19 22:05:46 +00:00
parent 1db7476596
commit bb494adee5
2 changed files with 46 additions and 57 deletions

View File

@ -34,7 +34,6 @@
{$I ONGUARD.INC} {$I ONGUARD.INC}
unit ogreg; {AH.01} unit ogreg; {AH.01}
@ -59,21 +58,18 @@ uses
LazarusPackageIntf, LazarusPackageIntf,
LResources; LResources;
{-------------------------------------------------------------------------------
TOgCodeGenEditor
component editor for TogCodeBase components
-------------------------------------------------------------------------------}
type type
{component editor for TogCodeBase components}
TOgCodeGenEditor = class({TDefaultEditor}TDefaultComponentEditor) TOgCodeGenEditor = class({TDefaultEditor}TDefaultComponentEditor)
public public
procedure ExecuteVerb(Index : Integer); procedure ExecuteVerb(Index: Integer); override;
override; function GetVerb(Index: Integer): string; override;
function GetVerb(Index : Integer) : string; function GetVerbCount: Integer; override;
override;
function GetVerbCount : Integer;
override;
end; end;
{*** TOgCodeGenEditor ***}
procedure TOgCodeGenEditor.ExecuteVerb(Index : Integer); procedure TOgCodeGenEditor.ExecuteVerb(Index : Integer);
begin begin
if Index = 0 then begin if Index = 0 then begin
@ -128,7 +124,37 @@ begin
end; end;
{component registration} {-------------------------------------------------------------------------------
TOgAboutProperty
-------------------------------------------------------------------------------}
type
TOgAboutProperty = class(TStringProperty)
public
function GetAttributes: TPropertyAttributes; override;
procedure Edit; override;
end;
function TOgAboutProperty.GetAttributes: TPropertyAttributes;
begin
Result := [paDialog, paReadOnly];
end;
procedure TOgAboutProperty.Edit;
begin
with TOgAboutForm.Create(Application) do begin
try
ShowModal;
finally
Free;
end;
end;
end;
{-------------------------------------------------------------------------------
Component registration
-------------------------------------------------------------------------------}
procedure Register; procedure Register;
begin begin
RegisterComponentEditor(TOgCodeBase, TOgCodeGenEditor); RegisterComponentEditor(TOgCodeBase, TOgCodeGenEditor);
@ -137,20 +163,20 @@ begin
TypeInfo(string), TOgMakeKeys, 'KeyFileName', TOgFileNameProperty); TypeInfo(string), TOgMakeKeys, 'KeyFileName', TOgFileNameProperty);
RegisterPropertyEditor( RegisterPropertyEditor(
TypeInfo(string), TOgMakeCodes, 'KeyFileName', TOgFileNameProperty); TypeInfo(string), TOgMakeCodes, 'KeyFileName', TOgFileNameProperty);
{ RegisterPropertyEditor( } {!!.09} { RegisterPropertyEditor( }
{ TypeInfo(string), TOgCodeBase, 'Expires', TOgExpiresProperty);} {!!.09} { TypeInfo(string), TOgCodeBase, 'Expires', TOgExpiresProperty);}
RegisterPropertyEditor( RegisterPropertyEditor(
TypeInfo(string), TOgCodeBase, 'Code', TOgCodeProperty); TypeInfo(string), TOgCodeBase, 'Code', TOgCodeProperty);
RegisterPropertyEditor( RegisterPropertyEditor(
TypeInfo(string), TOgCodeBase, 'Modifier', TOgModifierProperty); TypeInfo(string), TOgCodeBase, 'Modifier', TOgModifierProperty);
RegisterPropertyEditor( RegisterPropertyEditor(
TypeInfo(string), TOgCodeBase, 'About', TOgAboutProperty); {!!.08} TypeInfo(string), TOgCodeBase, 'About', TOgAboutProperty);
RegisterPropertyEditor( RegisterPropertyEditor(
TypeInfo(string), TOgProtectExe, 'About', TOgAboutProperty); {!!.08} TypeInfo(string), TOgProtectExe, 'About', TOgAboutProperty);
RegisterPropertyEditor( RegisterPropertyEditor(
TypeInfo(string), TOgMakeCodes, 'About', TOgAboutProperty); {!!.08} TypeInfo(string), TOgMakeCodes, 'About', TOgAboutProperty);
RegisterPropertyEditor( RegisterPropertyEditor(
TypeInfo(string), TOgMakeKeys, 'About', TOgAboutProperty); {!!.08} TypeInfo(string), TOgMakeKeys, 'About', TOgAboutProperty);
RegisterComponents('OnGuard', [ RegisterComponents('OnGuard', [
TOgMakeKeys, TOgMakeKeys,
@ -166,12 +192,9 @@ begin
end; end;
{$IFDEF FPC} {$IFDEF FPC}
initialization initialization
{$I ogreg.lrs} {$I ogreg.lrs}
{$ENDIF} {$ENDIF}
end. end.
end.

View File

@ -43,12 +43,7 @@ uses
LCLIntf, LCLIntf,
SysUtils, Classes, SysUtils, Classes,
Graphics, Controls,Buttons, Forms, Dialogs, StdCtrls, ExtCtrls, Graphics, Controls,Buttons, Forms, Dialogs, StdCtrls, ExtCtrls,
ogutil, ogutil;
ComponentEditors,
PropEdits;
type type
@ -92,42 +87,13 @@ type
{ Public declarations } { Public declarations }
end; end;
TOgAboutProperty = class(TStringProperty) {!!.08}
public
function GetAttributes: TPropertyAttributes;
override;
procedure Edit;
override;
end;
implementation implementation
uses uses
LResources; LResources;
{*** TOgAboutForm ***}
{*** TOgVersionProperty ***}
function TOgAboutProperty.GetAttributes: TPropertyAttributes; {!!.08}
begin
Result := [paDialog, paReadOnly];
end;
procedure TOgAboutProperty.Edit; {!!.08}
begin
with TOgAboutForm.Create(Application) do begin
try
ShowModal;
finally
Free;
end;
end;
end;
{*** TEsAboutForm ***}
procedure TOgAboutForm.btnOKClick(Sender: TObject); procedure TOgAboutForm.btnOKClick(Sender: TObject);
begin begin