forked from hkociemba/CubeExplorer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOptions.pas
More file actions
121 lines (108 loc) · 4.04 KB
/
Options.pas
File metadata and controls
121 lines (108 loc) · 4.04 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
unit Options;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,CubeDefs, ComCtrls;
type
//++++++++++++++++++++Form for Options/Two-Phase-Algorithm++++++++++++++++++++++
TOptionForm = class(TForm)
GroupBox2: TGroupBox;
RadioButton6: TRadioButton;
RadioButton7: TRadioButton;
RadioButton8: TRadioButton;
RadioButton9: TRadioButton;
RadioButton10: TRadioButton;
Button1: TButton;
CheckBox1: TCheckBox;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
procedure Button1Click(Sender: TObject);
procedure RBStopAtClick(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
var
OptionForm: TOptionForm;
implementation
uses RubikMain;
{$R *.DFM}
//++++++++++++++Hit OK-Button+++++++++++++++++++++++++++++++++++++++++++++++++++
procedure TOptionForm.Button1Click(Sender: TObject);
begin
OptionForm.Hide;
end;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+++++++++++++++Enter Stop Lenght++++++++++++++++++++++++++++++++++++++++++++++
procedure TOptionForm.RBStopAtClick(Sender: TObject);
begin
stopAt:=(Sender as TRadioButton).Tag;
{$IF not QTM}
iniFile.WriteInteger('Two-Phase-Algorithm','stopAtF',stopAt);
{$ELSE}
iniFile.WriteInteger('Two-Phase-Algorithm','stopAtQ',stopAt);
{$IFEND}
end;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+++++++++++++++Check Triple Search Checkbox+++++++++++++++++++++++++++++++++++
procedure TOptionForm.CheckBox1Click(Sender: TObject);
begin
useTriple:=CheckBox1.Checked;
iniFile.WriteBool('Two-Phase-Algorithm','TripleSearch',useTriple);
end;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
procedure TOptionForm.FormCreate(Sender: TObject);
begin
{$IF not QTM}
stopAt:=20;
stopAt:=iniFile.ReadInteger('Two-Phase-Algorithm','stopAtF',stopAt);
{$ELSE}
stopAt:=26;
stopAt:=iniFile.ReadInteger('Two-Phase-Algorithm','stopAtQ',stopAt);
RadioButton2.Tag:=20;
RadioButton2.Caption:= '20 moves';
RadioButton3.Tag:=21;
RadioButton3.Caption:= '21 moves';
RadioButton10.Tag:=22;
RadioButton10.Caption:= '22 moves';
RadioButton6.Tag:=23;
RadioButton6.Caption:= '23 moves';
RadioButton7.Tag:=24;
RadioButton7.Caption:= '24 moves';
RadioButton8.Tag:=26;
RadioButton8.Caption:= '26 moves';
RadioButton9.Tag:=28;
RadioButton9.Caption:= '28 moves';
RadioButton1.Tag:=30;
RadioButton1.Caption:= '30 moves';
{$IFEND}
if RadioButton6.Tag <> stopAt then RadioButton6.Checked:= false
else RadioButton6.Checked:= true;
if RadioButton7.Tag <> stopAt then RadioButton7.Checked:= false
else RadioButton7.Checked:= true;
if RadioButton8.Tag <> stopAt then RadioButton8.Checked:= false
else RadioButton8.Checked:= true;
if RadioButton9.Tag <> stopAt then RadioButton9.Checked:= false
else RadioButton9.Checked:= true;
if RadioButton10.Tag <> stopAt then RadioButton10.Checked:= false
else RadioButton10.Checked:= true;
if RadioButton1.Tag <> stopAt then RadioButton1.Checked:= false
else RadioButton1.Checked:= true;
if RadioButton2.Tag <> stopAt then RadioButton2.Checked:= false
else RadioButton2.Checked:= true;
if RadioButton3.Tag <> stopAt then RadioButton3.Checked:= false
else RadioButton3.Checked:= true;
useTriple:=false;
CheckBox1.Checked:=iniFile.ReadBool('Two-Phase-Algorithm','TripleSearch',useTriple);
autoTime:=100;
//autoTime:=iniFile.ReadInteger('Two-Phase-Algorithm','autoTime',autoTime);
Form1.BatchTimer.Interval:=autoTime;
end;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
end.