-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathUnit11.pas
125 lines (97 loc) · 2.88 KB
/
Unit11.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
unit Unit11;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Spin, AdvGlassButton, ExtCtrls, pngimage;
type
TForm11 = class(TForm)
Label1: TLabel;
Shape2: TShape;
Shape1: TShape;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label6: TLabel;
AdvGlassButton12: TAdvGlassButton;
AdvGlassButton1: TAdvGlassButton;
SpinEdit1: TSpinEdit;
SpinEdit2: TSpinEdit;
SpinEdit3: TSpinEdit;
Label5: TLabel;
Label7: TLabel;
Image1: TImage;
procedure SpinEdit1Change(Sender: TObject);
procedure AdvGlassButton12Click(Sender: TObject);
procedure SpinEdit2Change(Sender: TObject);
procedure AdvGlassButton1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormShow(Sender: TObject);
procedure SpinEdit3Exit(Sender: TObject);
private
send_cmd:bool;
public
{ Public declarations }
end;
var
Form11: TForm11;
implementation
uses Unit1;
{$R *.dfm}
procedure update_values;
begin
Form11.SpinEdit1.MaxValue:=Form11.SpinEdit2.Value-1;
Form11.SpinEdit3.MaxValue:=Form11.SpinEdit2.Value-1;
Form11.SpinEdit3.MinValue:=Form11.SpinEdit1.Value;
if Form11.SpinEdit1.Value>Form11.SpinEdit3.Value then
Form11.SpinEdit3.Value:=Form11.SpinEdit1.Value;
Form11.SpinEdit2.MinValue:=Form11.SpinEdit3.Value+1;
if Form11.SpinEdit1.Value>Form11.SpinEdit1.MaxValue then
Form11.SpinEdit1.Value:=Form11.SpinEdit1.MaxValue;
if Form11.SpinEdit2.Value>Form11.SpinEdit2.MaxValue then
Form11.SpinEdit2.Value:=Form11.SpinEdit2.MaxValue;
if Form11.SpinEdit3.Value>Form11.SpinEdit3.MaxValue then
Form11.SpinEdit3.Value:=Form11.SpinEdit3.MaxValue;
if Form11.SpinEdit1.Value<Form11.SpinEdit1.MinValue then
Form11.SpinEdit1.Value:=Form11.SpinEdit1.MinValue;
if Form11.SpinEdit2.Value<Form11.SpinEdit2.MinValue then
Form11.SpinEdit2.Value:=Form11.SpinEdit2.MinValue;
if Form11.SpinEdit3.Value<Form11.SpinEdit3.MinValue then
Form11.SpinEdit3.Value:=Form11.SpinEdit3.MinValue;
end;
procedure TForm11.AdvGlassButton12Click(Sender: TObject);
begin
update_values();
if (settings_mode=17) then begin
settings_data_ext :=byte(Form11.SpinEdit2.Value) + ( byte(Form11.SpinEdit3.Value) shl 8)+ ( byte(Form11.SpinEdit1.Value) shl 16);
send_cmd:=true;
Form11.Close;
send_new_settings_ext(17);
end;
end;
procedure TForm11.AdvGlassButton1Click(Sender: TObject);
begin
send_cmd:=false;
Form11.Close;
end;
procedure TForm11.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if send_cmd=false then
Form1.AdvGlassButton12.Click;
end;
procedure TForm11.FormShow(Sender: TObject);
begin
send_cmd:=false;
end;
procedure TForm11.SpinEdit1Change(Sender: TObject);
begin
//update_values();
end;
procedure TForm11.SpinEdit2Change(Sender: TObject);
begin
//update_values();
end;
procedure TForm11.SpinEdit3Exit(Sender: TObject);
begin
//update_values();
end;
end.