Repository navigation
Expand file tree
/
Copy pathOptions.pas
More file actions
73 lines (63 loc) · 1.87 KB
/
Copy pathOptions.pas
File metadata and controls
73 lines (63 loc) · 1.87 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
unit Options;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, Mask;
type
TFormOptions = class(TForm)
Columns: TMaskEdit;
Rows: TMaskEdit;
Bombs: TMaskEdit;
btnOk: TBitBtn;
btnCancel: TBitBtn;
Label3: TLabel;
Label1: TLabel;
Label2: TLabel;
btBeginner: TRadioButton;
btIntermediate: TRadioButton;
btAdvanced: TRadioButton;
Label4: TLabel;
Label5: TLabel;
procedure btAdvancedClick(Sender: TObject);
procedure btIntermediateClick(Sender: TObject);
procedure btBeginnerClick(Sender: TObject);
procedure UpdateRadioButton(RadioButton : TRadioButton);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormOptions: TFormOptions;
implementation
{$R *.dfm}
procedure TFormOptions.btAdvancedClick(Sender: TObject);
begin
formOptions.Rows.Text := IntToStr(24);
formOptions.Columns.Text := IntToStr(24);
formOptions.Bombs.Text := IntToStr(99);
end;
procedure TFormOptions.btIntermediateClick(Sender: TObject);
begin
formOptions.Rows.Text := IntToStr(16);
formOptions.Columns.Text := IntToStr(16);
formOptions.Bombs.Text := IntToStr(40);
end;
procedure TFormOptions.btBeginnerClick(Sender: TObject);
begin
formOptions.Rows.Text := IntToStr(9);
formOptions.Columns.Text := IntToStr(9);
formOptions.Bombs.Text := IntToStr(10);
end;
procedure TFormOptions.UpdateRadioButton(RadioButton: TRadioButton);
var
i : Integer;
begin
for i := 0 to FormOptions.ComponentCount - 1 do
begin
if FormOptions.Components[i] is TRadioButton then
if TRadioButton(FormOptions.Components[i]) <> RadioButton then
TRadioButton(FormOptions.Components[i]).Checked := False;
end;
end;
end.