forked from lmbelo/python4delphi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfmSettings.pas
More file actions
101 lines (90 loc) · 2.54 KB
/
Copy pathfmSettings.pas
File metadata and controls
101 lines (90 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
unit fmSettings;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, ExtCtrls, ComCtrls;
type
TSettings = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
TabSheet3: TTabSheet;
GroupBox1: TGroupBox;
Label3: TLabel;
Label4: TLabel;
edPythonFiles: TEdit;
edDelphiFiles: TEdit;
GroupBox2: TGroupBox;
Label1: TLabel;
Label2: TLabel;
meExclusion: TMemo;
TabSheet4: TTabSheet;
meGlobals: TMemo;
edComponentName: TEdit;
edUnitName: TEdit;
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Déclarations privées }
FComponentName : String;
FUnitName : String;
FPythonFiles : String;
FDelphiFiles : String;
FExclusion : String;
FGlobals : String;
public
{ Déclarations publiques }
procedure LoadFromStream( S : TStream );
procedure SaveToStream( S : TStream );
end;
var
Settings: TSettings;
implementation
uses unMisc, fmMain;
{$R *.DFM}
procedure TSettings.LoadFromStream( S : TStream );
begin
edComponentName.Text := ReadString( S );
edUnitName.Text := ReadString( S );
edPythonFiles.Text := ReadString( S );
edDelphiFiles.Text := ReadString( S );
meExclusion.Lines.Text := ReadString( S );
meGlobals.Lines.Text := ReadString( S );
end;
procedure TSettings.SaveToStream( S : TStream );
begin
WriteString( S, edComponentName.Text );
WriteString( S, edUnitName.Text );
WriteString( S, edPythonFiles.Text );
WriteString( S, edDelphiFiles.Text );
WriteString( S, meExclusion.Text );
WriteString( S, meGlobals.Text );
end;
procedure TSettings.FormShow(Sender: TObject);
begin
FComponentName := edComponentName.Text;
FUnitName := edUnitName.Text;
FPythonFiles := edPythonFiles.Text ;
FDelphiFiles := edDelphiFiles.Text;
FExclusion := meExclusion.Text;
FGlobals := meGlobals.Text;
end;
procedure TSettings.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if ModalResult = mrOk then
MainForm.FChanged := True
else
begin
edComponentName.Text := FComponentName;
edUnitName.Text := FUnitName;
edPythonFiles.Text := FPythonFiles;
edDelphiFiles.Text := FDelphiFiles;
meExclusion.Text := FExclusion;
meGlobals.Text := FGlobals;
end;
end;
end.