6 Windows
, Classes
, Messages
, Forms
, SysUtils
,
7 mirror
, mckCtrls
, Graphics
;
11 TKOLFormSave
= class(TKOLObj
)
17 constructor Create(AOwner
: TComponent
); override;
18 function AdditionalUnits
: string; override;
19 procedure SetupFirst( SL
: TStringList
; const AName
, AParent
, Prefix
: String ); override;
20 procedure SetupLast( SL
: TStringList
; const AName
, AParent
, Prefix
: String ); override;
21 procedure AssignEvents( SL
: TStringList
; const AName
: String ); override;
22 procedure SetRegistry(Value
: boolean);
23 procedure SetFileName(Value
: string);
24 procedure SetSection(Value
: string);
27 property FileName
: string read fFileName write SetFileName
;
28 property Registry
: boolean read fRegistry write SetRegistry
;
29 property Section
: string read fSection write SetSection
;
38 constructor TKOLFormSave
.Create
;
43 fSection
:= AOwner
.Name
;
46 function TKOLFormSave
.AdditionalUnits
;
48 Result
:= ', FormSave';
51 procedure TKOLFormSave
.SetupFirst
;
53 SL
.Add( Prefix
+ AName
+ ' := NewFormSave(Result.Form);' );
55 SL
.Add( Prefix
+ AName
+ '.Registry := True;');
56 if fFileName
<> '' then
57 SL
.Add( Prefix
+ AName
+ '.FileName := ''' + fFileName
+ ''';' );
58 if fSection
<> '' then
59 SL
.Add( Prefix
+ AName
+ '.Section := ''' + fSection
+ ''';' );
60 SL
.Add( Prefix
+ AName
+ '.SaveWindow(False);' );
63 procedure TKOLFormSave
.SetupLast
;
67 procedure TKOLFormSave
.AssignEvents
;
72 procedure TKOLFormSave
.SetRegistry
;
78 procedure TKOLFormSave
.SetFileName
;
80 if Value
<> '' then begin
86 procedure TKOLFormSave
.SetSection
;
88 if Value
<> '' then begin
95 RegisterComponents('KOLUtil', [TKOLFormSave
]);