-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOptions.pas
166 lines (148 loc) · 4.51 KB
/
Options.pas
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
unit Options;
(*
Copyright 1999,2009 Csabo.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*)
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Globals, ComCtrls;
type
TFormOptions = class(TForm)
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
TabSheet3: TTabSheet;
cmdOK: TButton;
cmdCancel: TButton;
Label1: TLabel;
chkOpenLast: TCheckBox;
chkOnlyOneBackup: TCheckBox;
chkShowFullPath: TCheckBox;
chkShowSize: TCheckBox;
chkShowPosition: TCheckBox;
EditTempFolder: TEdit;
chkAutoCleanUp: TCheckBox;
chkAutoPlaySounds: TCheckBox;
chkCutCopy: TCheckBox;
chkDisableUndo: TCheckBox;
chkDontAutoCapitalize: TCheckBox;
TabSheet4: TTabSheet;
radFileTypes0: TRadioButton;
radFileTypes1: TRadioButton;
radFileTypes2: TRadioButton;
Label2: TLabel;
radFileTypes3: TRadioButton;
chkRawPNG: TCheckBox;
chkPreviewMaps: TCheckBox;
chkAutoApplyOffset: TCheckBox;
chkAutoBackup: TCheckBox;
procedure FormCreate(Sender: TObject);
procedure cmdOKClick(Sender: TObject);
procedure cmdCancelClick(Sender: TObject);
procedure chkShowSizeClick(Sender: TObject);
private
{ Private declarations }
procedure RefreshScreen;
procedure SaveOptions;
public
{ Public declarations }
ColumnsChanged : Boolean;
AssociationsChanged : Boolean;
end;
var
FormOptions: TFormOptions;
implementation
{$R *.DFM}
procedure TFormOptions.FormCreate(Sender: TObject);
begin
RefreshScreen;
end;
procedure TFormOptions.RefreshScreen;
begin
chkOpenLast.Checked := gOpenLast;
chkCutCopy.Checked := gCutCopyEmpty;
chkOnlyOneBackup.Checked := gOnlyOneBack;
chkAutoCleanUp.Checked := gAutoCleanUp;
chkAutoBackup.Checked := gAutoBackup;
chkPreviewMaps.Checked := gPreviewMaps;
chkAutoPlaySounds.Checked := gAutoPlaySounds;
chkDisableUndo.Checked := gDisableUndo;
chkRawPNG.Checked := gRawPNG;
chkAutoApplyOffset.Checked := gAutoApplyOffsets;
EditTempFolder.Text := sTempFolder;
//
chkShowFullPath.Checked := gShowFullPath;
chkShowSize.Checked := gShowSize;
chkShowSizeClick ( Self );
chkShowPosition.Checked := gShowPosition;
chkDontAutoCapitalize.Checked := gDontAutoCapitalize;
//
If gAssociations = assoc_None Then
radFileTypes0.Checked := True
Else If gAssociations = assoc_WAD Then
radFileTypes1.Checked := True
Else If gAssociations = assoc_Common Then
radFileTypes2.Checked := True
Else
radFileTypes3.Checked := True;
end;
procedure TFormOptions.SaveOptions;
Var
NewAssociations : TAssociations;
begin
gOpenLast := chkOpenLast.Checked;
gCutCopyEmpty := chkCutCopy.Checked;
gOnlyOneBack := chkOnlyOneBackup.Checked;
gAutoCleanUp := chkAutoCleanUp.Checked;
gAutoBackup := chkAutoBackup.Checked;
gPreviewMaps := chkPreviewMaps.Checked;
gAutoPlaySounds := chkAutoPlaySounds.Checked;
gDisableUndo := chkDisableUndo.Checked;
gRawPNG := chkRawPNG.Checked;
gAutoApplyOffsets := chkAutoApplyOffset.Checked;
sTempFolder := EditTempFolder.Text;
//
ColumnsChanged := ( gShowSize <> chkShowSize.Checked )
Or ( gShowPosition <> ( chkShowPosition.Checked And chkShowPosition.Enabled ) );
//
gShowFullPath := chkShowFullPath.Checked;
gShowSize := chkShowSize.Checked;
gShowPosition := ( chkShowPosition.Checked And chkShowPosition.Enabled );
gDontAutoCapitalize := chkDontAutoCapitalize.Checked;
//
If radFileTypes0.Checked Then
NewAssociations := assoc_None
Else If radFileTypes1.Checked Then
NewAssociations := assoc_WAD
Else If radFileTypes2.Checked Then
NewAssociations := assoc_Common
Else
NewAssociations := assoc_All;
//
AssociationsChanged := NewAssociations <> gAssociations;
gAssociations := NewAssociations;
end;
procedure TFormOptions.cmdOKClick(Sender: TObject);
begin
SaveOptions;
Close;
end;
procedure TFormOptions.cmdCancelClick(Sender: TObject);
begin
Close;
end;
procedure TFormOptions.chkShowSizeClick(Sender: TObject);
begin
chkShowPosition.Enabled := chkShowSize.Checked;
end;
end.