-
Notifications
You must be signed in to change notification settings - Fork 0
/
GrafikOptions.pas
197 lines (163 loc) · 5.05 KB
/
GrafikOptions.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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
unit GrafikOptions;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Verlauf, ComCtrls, Einstellung;
type
TForm7 = class(TForm)
Button1: TButton;
Button2: TButton;
Panel1: TPanel;
AntiAliasing: TCheckBox;
Label1: TLabel;
Label2: TLabel;
PaintBox1: TPaintBox;
Panel2: TPanel;
PaintBox2: TPaintBox;
Panel3: TPanel;
PaintBox3: TPaintBox;
GrPlaneColor: TColorBox;
GridColor: TColorBox;
TicksColor: TColorBox;
GrPlaneAlpha: TEdit;
GridAlpha: TEdit;
TicksAlpha: TEdit;
UpDown1: TUpDown;
UpDown2: TUpDown;
UpDown3: TUpDown;
Background: TColorBox;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
PaintBox4: TPaintBox;
PaintBox5: TPaintBox;
PaintBox6: TPaintBox;
SensityBar: TTrackBar;
Label13: TLabel;
Button3: TButton;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormPaint(Sender: TObject);
procedure PaintBox1Paint(Sender: TObject);
procedure PaintBox3Paint(Sender: TObject);
procedure PaintBox2Paint(Sender: TObject);
procedure PaintBox6Paint(Sender: TObject);
procedure Label1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure GrPlaneAlphaChange(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form7: TForm7;
implementation
{$R *.dfm}
uses Main, GLContext;
procedure TForm7.Button2Click(Sender: TObject);
begin
Hide;
end;
procedure TForm7.Button1Click(Sender: TObject);
begin
//Display
Settings.FDisplay.AntiAliasing:= AntiAliasing.Checked;
// Colors
Settings.FColors.Background:= Background.Selected;
Settings.FColors.GroundPlane:= GrPlaneColor.Selected;
Settings.FColors.GroundPlaneAlpha:= StrToInt(GrPlaneAlpha.Text)/100;
Settings.FColors.Grid:= GridColor.Selected;
Settings.FColors.GridAlpha:= StrToInt(GridAlpha.Text)/100;
Settings.FColors.Ticks:= TicksColor.Selected;
Settings.FColors.TicksAlpha:= StrToInt(TicksAlpha.Text)/100;
// Environment
Settings.FEnvironment.MouseSensity:= SensityBar.Position;
Settings.NotifyChanges;
Hide;
end;
procedure TForm7.FormActivate(Sender: TObject);
begin
//Display
AntiAliasing.Checked:= Settings.FDisplay.AntiAliasing;
// Colors
Background.Selected:= Settings.FColors.Background;
GrPlaneColor.Selected:= Settings.FColors.GroundPlane;
GrPlaneAlpha.Text:= IntToStr(Round(Settings.FColors.GroundPlaneAlpha*100));
GridColor.Selected:= Settings.FColors.Grid;
GridAlpha.Text:= IntToStr(Round(Settings.FColors.GridAlpha*100));
TicksColor.Selected:= Settings.FColors.Ticks;
TicksAlpha.Text:= IntToStr(Round(Settings.FColors.TicksAlpha*100));
// Environment
SensityBar.Position:= Settings.FEnvironment.MouseSensity;
end;
procedure TForm7.FormPaint(Sender: TObject);
begin
VerlaufVertical(Canvas, clMoneyGreen, clGreen, Width, Height);
end;
procedure TForm7.PaintBox1Paint(Sender: TObject);
begin
VerlaufHorizontal(PaintBox1.Canvas, $007CB16D, $00C6DDBF, PaintBox1.Width, PaintBox1.Height);
end;
procedure TForm7.PaintBox3Paint(Sender: TObject);
begin
VerlaufHorizontal(PaintBox3.Canvas, $00C6DDBF, $007CB16D, PaintBox3.Width, PaintBox3.Height);
end;
procedure TForm7.PaintBox2Paint(Sender: TObject);
begin
VerlaufHorizontal(PaintBox2.Canvas, $00C6DDBF, $007CB16D, PaintBox2.Width, PaintBox2.Height);
end;
procedure TForm7.PaintBox6Paint(Sender: TObject);
begin
VerlaufHorizontal(TPaintBox(Sender).Canvas, clGreen, clMoneyGreen, TPaintBox(Sender).Width, TPaintBox(Sender).Height);
end;
procedure TForm7.Label1Click(Sender: TObject);
begin
AntiAliasing.Checked:= not AntiAliasing.Checked;
end;
procedure TForm7.FormCreate(Sender: TObject);
var
i: integer;
begin
for i:=1 to High(GermanColors) do
BackGround.Items[i]:=GermanColors[i];
BackGround.Items[0]:='benutzerdefiniert...';
for i:=1 to High(GermanColors) do
GrPlaneColor.Items[i]:=GermanColors[i];
GrPlaneColor.Items[0]:='benutzerdefiniert...';
for i:=1 to High(GermanColors) do
GridColor.Items[i]:=GermanColors[i];
GridColor.Items[0]:='benutzerdefiniert...';
for i:=1 to High(GermanColors) do
TicksColor.Items[i]:=GermanColors[i];
TicksColor.Items[0]:='benutzerdefiniert...';
end;
procedure TForm7.Button3Click(Sender: TObject);
begin
Settings.SetColorStandard;
Settings.FEnvironment.MouseSensity:= ST_M_SENSITY;
FormActivate(Self);
end;
procedure TForm7.GrPlaneAlphaChange(Sender: TObject);
begin
Try
If not ((TEdit(Sender).Text = '') or (TEdit(Sender).Text = '-')) then begin
If (StrToInt(TEdit(Sender).Text) > 100) then
TEdit(Sender).Text:= '100';
If (StrToInt(TEdit(Sender).Text) < 0) then
TEdit(Sender).Text:= '0';
end;
except
ShowMessage('Bitte eine Zahl zwischen 0 und 100 eingeben');
end;
end;
end.