1 |
|
5 |
//------------------------------------------------------------
|
2 |
|
|
//------------------------------------------------------------
|
3 |
|
|
// MAGiC
|
4 |
|
|
// Jean Christophe Cuillière et Vincent FRANCOIS
|
5 |
|
|
// Département de Génie Mécanique - UQTR
|
6 |
|
|
//------------------------------------------------------------
|
7 |
|
|
// Le projet MAGIC est un projet de recherche du département
|
8 |
|
|
// de génie mécanique de l'Université du Québec à
|
9 |
|
|
// Trois Rivières
|
10 |
|
|
// Les librairies ne peuvent être utilisées sans l'accord
|
11 |
|
|
// des auteurs (contact : francois@uqtr.ca)
|
12 |
|
|
//------------------------------------------------------------
|
13 |
|
|
//------------------------------------------------------------
|
14 |
|
|
//
|
15 |
|
|
// config.cpp
|
16 |
|
|
//
|
17 |
|
|
//------------------------------------------------------------
|
18 |
|
|
//------------------------------------------------------------
|
19 |
|
|
// COPYRIGHT 2000
|
20 |
|
|
// Version du 02/03/2006 à 11H26
|
21 |
|
|
//------------------------------------------------------------
|
22 |
|
|
//------------------------------------------------------------
|
23 |
|
|
|
24 |
|
|
|
25 |
|
|
#include "gestionversion.h"
|
26 |
|
|
|
27 |
|
|
#include <vcl.h>
|
28 |
|
|
#pragma hdrstop
|
29 |
|
|
|
30 |
|
|
#include "main.h"
|
31 |
|
|
#include "config.h"
|
32 |
|
|
//---------------------------------------------------------------------------
|
33 |
|
|
#pragma package(smart_init)
|
34 |
|
|
#pragma resource "*.dfm"
|
35 |
|
|
Tconfigwin *configwin;
|
36 |
|
|
|
37 |
|
|
//---------------------------------------------------------------------------
|
38 |
|
|
__fastcall Tconfigwin::Tconfigwin(TComponent* Owner)
|
39 |
francois |
62 |
: TForm(Owner),indexdegrade(6)
|
40 |
|
5 |
{
|
41 |
|
|
}
|
42 |
|
|
//---------------------------------------------------------------------------
|
43 |
|
|
void __fastcall Tconfigwin::Button1Click(TObject *Sender)
|
44 |
|
|
{
|
45 |
francois |
98 |
char buf[5000];
|
46 |
|
5 |
char temp[10];
|
47 |
|
|
buf[0]=0;
|
48 |
|
|
if (CheckBox1->Checked==true) MainForm->valeurconfig[56]=1.; else MainForm->valeurconfig[56]=0.;
|
49 |
francois |
62 |
for (int i=0;i<200;i++)
|
50 |
|
5 |
{
|
51 |
francois |
62 |
sprintf(temp,"%.4f ",MainForm->valeurconfig[i]);
|
52 |
|
5 |
strcat(buf,temp);
|
53 |
|
|
}
|
54 |
|
|
HKEY clef;
|
55 |
|
|
DWORD type,taille;
|
56 |
|
|
RegCreateKeyEx(HKEY_CURRENT_USER,"SOFTWARE\\UQTR\\VMM\\Configuration",0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,0,&clef,&type);
|
57 |
|
|
|
58 |
|
|
RegSetValueEx(clef,"Default",0,REG_SZ, buf,sizeof(char)*(strlen(buf)+1));
|
59 |
|
|
RegCloseKey(clef);
|
60 |
|
|
Close();
|
61 |
|
|
}
|
62 |
|
|
//---------------------------------------------------------------------------
|
63 |
|
|
void __fastcall Tconfigwin::Button2Click(TObject *Sender)
|
64 |
|
|
{
|
65 |
|
|
if (ColorDialog1->Execute())
|
66 |
|
|
{
|
67 |
|
|
Label5->Color=ColorDialog1->Color;
|
68 |
|
|
getRGB(Label5->Color,MainForm->valeurconfig[0],MainForm->valeurconfig[1],MainForm->valeurconfig[2]);
|
69 |
|
|
}
|
70 |
|
|
}
|
71 |
|
|
//---------------------------------------------------------------------------
|
72 |
|
|
void __fastcall Tconfigwin::getRGB(int color,double& r,double &g,double& b)
|
73 |
|
|
{
|
74 |
|
|
r=(color & 0x000000FF)/255.;
|
75 |
|
|
g=((color & 0x0000FF00)>>8)/255.;
|
76 |
|
|
b=((color & 0x00FF0000)>>16)/255.;
|
77 |
|
|
}
|
78 |
|
|
//---------------------------------------------------------------------------
|
79 |
|
|
TColor __fastcall Tconfigwin::getcolor(double r,double g,double b)
|
80 |
|
|
{
|
81 |
|
|
int rr=int(r*255.);
|
82 |
|
|
int gg=int(g*255.);
|
83 |
|
|
int bb=int(b*255.);
|
84 |
|
|
int color=rr+(gg<<8)+(bb<<16);
|
85 |
|
|
return (TColor)color;
|
86 |
|
|
}
|
87 |
|
|
//---------------------------------------------------------------------------
|
88 |
|
|
void __fastcall Tconfigwin::Button3Click(TObject *Sender)
|
89 |
|
|
{
|
90 |
|
|
if (ColorDialog1->Execute())
|
91 |
|
|
{
|
92 |
|
|
Label6->Color=ColorDialog1->Color;
|
93 |
|
|
getRGB(Label6->Color,MainForm->valeurconfig[3],MainForm->valeurconfig[4],MainForm->valeurconfig[5]);
|
94 |
|
|
}
|
95 |
|
|
|
96 |
|
|
}
|
97 |
|
|
//---------------------------------------------------------------------------
|
98 |
|
|
void __fastcall Tconfigwin::Button4Click(TObject *Sender)
|
99 |
|
|
{
|
100 |
|
|
if (ColorDialog1->Execute())
|
101 |
|
|
{
|
102 |
|
|
Label7->Color=ColorDialog1->Color;
|
103 |
|
|
getRGB(Label7->Color,MainForm->valeurconfig[6],MainForm->valeurconfig[7],MainForm->valeurconfig[8]);
|
104 |
|
|
}
|
105 |
|
|
|
106 |
|
|
}
|
107 |
|
|
//---------------------------------------------------------------------------
|
108 |
|
|
void __fastcall Tconfigwin::UpDown1Click(TObject *Sender,
|
109 |
|
|
TUDBtnType Button)
|
110 |
|
|
{
|
111 |
|
|
if (Button==Comctrls::btNext) MainForm->valeurconfig[9]++;
|
112 |
|
|
if (Button==Comctrls::btPrev) MainForm->valeurconfig[9]--;
|
113 |
|
|
if (MainForm->valeurconfig[9]<1.) MainForm->valeurconfig[9]=1.;
|
114 |
|
|
Label9->Caption=MainForm->valeurconfig[9];
|
115 |
|
|
}
|
116 |
|
|
//---------------------------------------------------------------------------
|
117 |
|
|
void __fastcall Tconfigwin::FormPaint(TObject *Sender)
|
118 |
|
|
{
|
119 |
|
|
Label5->Color=getcolor(MainForm->valeurconfig[0],MainForm->valeurconfig[1],MainForm->valeurconfig[2]);
|
120 |
|
|
Label6->Color=getcolor(MainForm->valeurconfig[3],MainForm->valeurconfig[4],MainForm->valeurconfig[5]);
|
121 |
|
|
Label7->Color=getcolor(MainForm->valeurconfig[6],MainForm->valeurconfig[7],MainForm->valeurconfig[8]);
|
122 |
|
|
Label10->Color=getcolor(MainForm->valeurconfig[11],MainForm->valeurconfig[12],MainForm->valeurconfig[13]);
|
123 |
|
|
Label13->Color=getcolor(MainForm->valeurconfig[14],MainForm->valeurconfig[15],MainForm->valeurconfig[16]);
|
124 |
|
|
Label19->Color=getcolor(MainForm->valeurconfig[18],MainForm->valeurconfig[19],MainForm->valeurconfig[20]);
|
125 |
|
|
Label23->Color=getcolor(MainForm->valeurconfig[22],MainForm->valeurconfig[23],MainForm->valeurconfig[24]);
|
126 |
|
|
Label31->Color=getcolor(MainForm->valeurconfig[26],MainForm->valeurconfig[27],MainForm->valeurconfig[28]);
|
127 |
|
|
Label35->Color=getcolor(MainForm->valeurconfig[30],MainForm->valeurconfig[31],MainForm->valeurconfig[32]);
|
128 |
|
|
Label39->Color=getcolor(MainForm->valeurconfig[34],MainForm->valeurconfig[35],MainForm->valeurconfig[36]);
|
129 |
|
|
Label42->Color=getcolor(MainForm->valeurconfig[37],MainForm->valeurconfig[38],MainForm->valeurconfig[39]);
|
130 |
|
|
Label43->Color=getcolor(MainForm->valeurconfig[41],MainForm->valeurconfig[42],MainForm->valeurconfig[43]);
|
131 |
|
|
Label49->Color=getcolor(MainForm->valeurconfig[44],MainForm->valeurconfig[45],MainForm->valeurconfig[46]);
|
132 |
|
|
Label50->Color=getcolor(MainForm->valeurconfig[47],MainForm->valeurconfig[48],MainForm->valeurconfig[49]);
|
133 |
|
|
Label51->Color=getcolor(MainForm->valeurconfig[50],MainForm->valeurconfig[51],MainForm->valeurconfig[52]);
|
134 |
|
|
Label2->Color=getcolor(MainForm->valeurconfig[57],MainForm->valeurconfig[58],MainForm->valeurconfig[59]);
|
135 |
francois |
62 |
Label57->Color=getcolor(MainForm->valeurconfig[66+3*indexdegrade],MainForm->valeurconfig[67+3*indexdegrade],MainForm->valeurconfig[68+3*indexdegrade]);
|
136 |
|
|
Label60->Color=getcolor(MainForm->valeurconfig[69+3*indexdegrade],MainForm->valeurconfig[70+3*indexdegrade],MainForm->valeurconfig[71+3*indexdegrade]);
|
137 |
|
|
Label59->Color=getcolor(MainForm->valeurconfig[63+3*indexdegrade],MainForm->valeurconfig[64+3*indexdegrade],MainForm->valeurconfig[65+3*indexdegrade]);
|
138 |
|
|
if (indexdegrade==0) Label59->Visible=false; else Label59->Visible=true;
|
139 |
|
|
if (indexdegrade==11) Label60->Visible=false; else Label60->Visible=true;
|
140 |
|
|
Label55->Color=getcolor(MainForm->valeurconfig[108],MainForm->valeurconfig[109],MainForm->valeurconfig[110]);
|
141 |
|
|
Label64->Color=getcolor(MainForm->valeurconfig[111],MainForm->valeurconfig[112],MainForm->valeurconfig[113]);
|
142 |
|
|
Label65->Color=getcolor(MainForm->valeurconfig[114],MainForm->valeurconfig[115],MainForm->valeurconfig[116]);
|
143 |
|
|
Label66->Color=getcolor(MainForm->valeurconfig[117],MainForm->valeurconfig[118],MainForm->valeurconfig[119]);
|
144 |
|
|
Label67->Color=getcolor(MainForm->valeurconfig[120],MainForm->valeurconfig[121],MainForm->valeurconfig[122]);
|
145 |
|
5 |
Label16->Caption=MainForm->valeurconfig[17];
|
146 |
|
|
Label18->Caption=MainForm->valeurconfig[21];
|
147 |
|
|
Label9->Caption=MainForm->valeurconfig[9];
|
148 |
|
|
Label12->Caption=MainForm->valeurconfig[10];
|
149 |
|
|
Label22->Caption=MainForm->valeurconfig[25];
|
150 |
|
|
Label30->Caption=MainForm->valeurconfig[29];
|
151 |
|
|
Label34->Caption=MainForm->valeurconfig[33];
|
152 |
|
|
Label38->Caption=MainForm->valeurconfig[40];
|
153 |
|
|
Label46->Caption=MainForm->valeurconfig[53];
|
154 |
|
|
Label52->Caption=MainForm->valeurconfig[54];
|
155 |
|
|
Label53->Caption=MainForm->valeurconfig[55];
|
156 |
|
|
if (MainForm->valeurconfig[56]==1.) CheckBox1->Checked=true; else CheckBox1->Checked=false;
|
157 |
|
|
}
|
158 |
|
|
//---------------------------------------------------------------------------
|
159 |
|
|
void __fastcall Tconfigwin::Button5Click(TObject *Sender)
|
160 |
|
|
{
|
161 |
|
|
if (ColorDialog1->Execute())
|
162 |
|
|
{
|
163 |
|
|
Label10->Color=ColorDialog1->Color;
|
164 |
|
|
getRGB(Label10->Color,MainForm->valeurconfig[11],MainForm->valeurconfig[12],MainForm->valeurconfig[13]);
|
165 |
|
|
}
|
166 |
|
|
|
167 |
|
|
}
|
168 |
|
|
//---------------------------------------------------------------------------
|
169 |
|
|
void __fastcall Tconfigwin::UpDown2Click(TObject *Sender,
|
170 |
|
|
TUDBtnType Button)
|
171 |
|
|
{
|
172 |
|
|
if (Button==Comctrls::btNext) MainForm->valeurconfig[10]=MainForm->valeurconfig[10]+0.1;
|
173 |
|
|
if (Button==Comctrls::btPrev) MainForm->valeurconfig[10]=MainForm->valeurconfig[10]-0.1;
|
174 |
|
|
if (MainForm->valeurconfig[10]<0.1) MainForm->valeurconfig[10]=0.1;
|
175 |
|
|
Label12->Caption=MainForm->valeurconfig[10];
|
176 |
|
|
}
|
177 |
|
|
//---------------------------------------------------------------------------
|
178 |
|
|
void __fastcall Tconfigwin::UpDown3Click(TObject *Sender,
|
179 |
|
|
TUDBtnType Button)
|
180 |
|
|
{
|
181 |
|
|
if (Button==Comctrls::btNext) MainForm->valeurconfig[17]++;
|
182 |
|
|
if (Button==Comctrls::btPrev) MainForm->valeurconfig[17]--;
|
183 |
|
|
if (MainForm->valeurconfig[17]<1.) MainForm->valeurconfig[17]=1.;
|
184 |
|
|
Label16->Caption=MainForm->valeurconfig[17];
|
185 |
|
|
}
|
186 |
|
|
//---------------------------------------------------------------------------
|
187 |
|
|
void __fastcall Tconfigwin::Button6Click(TObject *Sender)
|
188 |
|
|
{
|
189 |
|
|
if (ColorDialog1->Execute())
|
190 |
|
|
{
|
191 |
|
|
Label13->Color=ColorDialog1->Color;
|
192 |
|
|
getRGB(Label13->Color,MainForm->valeurconfig[14],MainForm->valeurconfig[15],MainForm->valeurconfig[16]);
|
193 |
|
|
}
|
194 |
|
|
}
|
195 |
|
|
//---------------------------------------------------------------------------
|
196 |
|
|
void __fastcall Tconfigwin::Button7Click(TObject *Sender)
|
197 |
|
|
{
|
198 |
|
|
if (ColorDialog1->Execute())
|
199 |
|
|
{
|
200 |
|
|
Label19->Color=ColorDialog1->Color;
|
201 |
|
|
getRGB(Label19->Color,MainForm->valeurconfig[18],MainForm->valeurconfig[19],MainForm->valeurconfig[20]);
|
202 |
|
|
}
|
203 |
|
|
}
|
204 |
|
|
//---------------------------------------------------------------------------
|
205 |
|
|
|
206 |
|
|
void __fastcall Tconfigwin::Button8Click(TObject *Sender)
|
207 |
|
|
{
|
208 |
|
|
if (ColorDialog1->Execute())
|
209 |
|
|
{
|
210 |
|
|
Label23->Color=ColorDialog1->Color;
|
211 |
|
|
getRGB(Label23->Color,MainForm->valeurconfig[22],MainForm->valeurconfig[23],MainForm->valeurconfig[24]);
|
212 |
|
|
}
|
213 |
|
|
|
214 |
|
|
}
|
215 |
|
|
//---------------------------------------------------------------------------
|
216 |
|
|
|
217 |
|
|
void __fastcall Tconfigwin::UpDown5Click(TObject *Sender,
|
218 |
|
|
TUDBtnType Button)
|
219 |
|
|
{
|
220 |
|
|
if (Button==Comctrls::btNext) MainForm->valeurconfig[25]++;
|
221 |
|
|
if (Button==Comctrls::btPrev) MainForm->valeurconfig[25]--;
|
222 |
|
|
if (MainForm->valeurconfig[25]<1.) MainForm->valeurconfig[25]=1.;
|
223 |
|
|
Label22->Caption=MainForm->valeurconfig[25];
|
224 |
|
|
|
225 |
|
|
}
|
226 |
|
|
//---------------------------------------------------------------------------
|
227 |
|
|
|
228 |
|
|
void __fastcall Tconfigwin::UpDown4Click(TObject *Sender,
|
229 |
|
|
TUDBtnType Button)
|
230 |
|
|
{
|
231 |
|
|
if (Button==Comctrls::btNext) MainForm->valeurconfig[21]++;
|
232 |
|
|
if (Button==Comctrls::btPrev) MainForm->valeurconfig[21]--;
|
233 |
|
|
if (MainForm->valeurconfig[21]<1.) MainForm->valeurconfig[21]=1.;
|
234 |
|
|
Label18->Caption=MainForm->valeurconfig[21];
|
235 |
|
|
|
236 |
|
|
}
|
237 |
|
|
//---------------------------------------------------------------------------
|
238 |
|
|
|
239 |
|
|
void __fastcall Tconfigwin::Button9Click(TObject *Sender)
|
240 |
|
|
{
|
241 |
|
|
if (ColorDialog1->Execute())
|
242 |
|
|
{
|
243 |
|
|
Label31->Color=ColorDialog1->Color;
|
244 |
|
|
getRGB(Label31->Color,MainForm->valeurconfig[26],MainForm->valeurconfig[27],MainForm->valeurconfig[28]);
|
245 |
|
|
}
|
246 |
|
|
}
|
247 |
|
|
//---------------------------------------------------------------------------
|
248 |
|
|
|
249 |
|
|
void __fastcall Tconfigwin::UpDown6Click(TObject *Sender,
|
250 |
|
|
TUDBtnType Button)
|
251 |
|
|
{
|
252 |
|
|
if (Button==Comctrls::btNext) MainForm->valeurconfig[29]++;
|
253 |
|
|
if (Button==Comctrls::btPrev) MainForm->valeurconfig[29]--;
|
254 |
|
|
if (MainForm->valeurconfig[29]<1.) MainForm->valeurconfig[29]=1.;
|
255 |
|
|
Label30->Caption=MainForm->valeurconfig[29];
|
256 |
|
|
|
257 |
|
|
}
|
258 |
|
|
//---------------------------------------------------------------------------
|
259 |
|
|
|
260 |
|
|
void __fastcall Tconfigwin::Button10Click(TObject *Sender)
|
261 |
|
|
{
|
262 |
|
|
if (ColorDialog1->Execute())
|
263 |
|
|
{
|
264 |
|
|
Label35->Color=ColorDialog1->Color;
|
265 |
|
|
getRGB(Label35->Color,MainForm->valeurconfig[30],MainForm->valeurconfig[31],MainForm->valeurconfig[32]);
|
266 |
|
|
}
|
267 |
|
|
|
268 |
|
|
}
|
269 |
|
|
//---------------------------------------------------------------------------
|
270 |
|
|
|
271 |
|
|
void __fastcall Tconfigwin::UpDown7Click(TObject *Sender,
|
272 |
|
|
TUDBtnType Button)
|
273 |
|
|
{
|
274 |
|
|
if (Button==Comctrls::btNext) MainForm->valeurconfig[33]++;
|
275 |
|
|
if (Button==Comctrls::btPrev) MainForm->valeurconfig[33]--;
|
276 |
|
|
if (MainForm->valeurconfig[33]<1.) MainForm->valeurconfig[33]=1.;
|
277 |
|
|
Label34->Caption=MainForm->valeurconfig[33];
|
278 |
|
|
}
|
279 |
|
|
//---------------------------------------------------------------------------
|
280 |
|
|
|
281 |
|
|
|
282 |
|
|
|
283 |
|
|
void __fastcall Tconfigwin::Button11Click(TObject *Sender)
|
284 |
|
|
{
|
285 |
|
|
if (ColorDialog1->Execute())
|
286 |
|
|
{
|
287 |
|
|
Label39->Color=ColorDialog1->Color;
|
288 |
|
|
getRGB(Label39->Color,MainForm->valeurconfig[34],MainForm->valeurconfig[35],MainForm->valeurconfig[36]);
|
289 |
|
|
}
|
290 |
|
|
|
291 |
|
|
}
|
292 |
|
|
//---------------------------------------------------------------------------
|
293 |
|
|
|
294 |
|
|
void __fastcall Tconfigwin::Button12Click(TObject *Sender)
|
295 |
|
|
{
|
296 |
|
|
if (ColorDialog1->Execute())
|
297 |
|
|
{
|
298 |
|
|
Label42->Color=ColorDialog1->Color;
|
299 |
|
|
getRGB(Label42->Color,MainForm->valeurconfig[37],MainForm->valeurconfig[38],MainForm->valeurconfig[39]);
|
300 |
|
|
}
|
301 |
|
|
|
302 |
|
|
}
|
303 |
|
|
//---------------------------------------------------------------------------
|
304 |
|
|
|
305 |
|
|
void __fastcall Tconfigwin::UpDown8Click(TObject *Sender,
|
306 |
|
|
TUDBtnType Button)
|
307 |
|
|
{
|
308 |
|
|
if (Button==Comctrls::btNext) MainForm->valeurconfig[40]++;
|
309 |
|
|
if (Button==Comctrls::btPrev) MainForm->valeurconfig[40]--;
|
310 |
|
|
if (MainForm->valeurconfig[40]<1.) MainForm->valeurconfig[40]=1.;
|
311 |
|
|
Label38->Caption=MainForm->valeurconfig[40];
|
312 |
|
|
}
|
313 |
|
|
//---------------------------------------------------------------------------
|
314 |
|
|
|
315 |
|
|
void __fastcall Tconfigwin::Button13Click(TObject *Sender)
|
316 |
|
|
{
|
317 |
|
|
if (ColorDialog1->Execute())
|
318 |
|
|
{
|
319 |
|
|
Label43->Color=ColorDialog1->Color;
|
320 |
|
|
getRGB(Label43->Color,MainForm->valeurconfig[41],MainForm->valeurconfig[42],MainForm->valeurconfig[43]);
|
321 |
|
|
}
|
322 |
|
|
|
323 |
|
|
}
|
324 |
|
|
//---------------------------------------------------------------------------
|
325 |
|
|
|
326 |
|
|
void __fastcall Tconfigwin::Button14Click(TObject *Sender)
|
327 |
|
|
{
|
328 |
|
|
if (ColorDialog1->Execute())
|
329 |
|
|
{
|
330 |
|
|
Label49->Color=ColorDialog1->Color;
|
331 |
|
|
getRGB(Label49->Color,MainForm->valeurconfig[44],MainForm->valeurconfig[45],MainForm->valeurconfig[46]);
|
332 |
|
|
}
|
333 |
|
|
|
334 |
|
|
|
335 |
|
|
}
|
336 |
|
|
//---------------------------------------------------------------------------
|
337 |
|
|
|
338 |
|
|
void __fastcall Tconfigwin::Button15Click(TObject *Sender)
|
339 |
|
|
{
|
340 |
|
|
if (ColorDialog1->Execute())
|
341 |
|
|
{
|
342 |
|
|
Label50->Color=ColorDialog1->Color;
|
343 |
|
|
getRGB(Label50->Color,MainForm->valeurconfig[47],MainForm->valeurconfig[48],MainForm->valeurconfig[49]);
|
344 |
|
|
}
|
345 |
|
|
}
|
346 |
|
|
//---------------------------------------------------------------------------
|
347 |
|
|
|
348 |
|
|
void __fastcall Tconfigwin::Button16Click(TObject *Sender)
|
349 |
|
|
{
|
350 |
|
|
if (ColorDialog1->Execute())
|
351 |
|
|
{
|
352 |
|
|
Label51->Color=ColorDialog1->Color;
|
353 |
|
|
getRGB(Label51->Color,MainForm->valeurconfig[50],MainForm->valeurconfig[51],MainForm->valeurconfig[52]);
|
354 |
|
|
}
|
355 |
|
|
}
|
356 |
|
|
//---------------------------------------------------------------------------
|
357 |
|
|
|
358 |
|
|
void __fastcall Tconfigwin::UpDown9Click(TObject *Sender,
|
359 |
|
|
TUDBtnType Button)
|
360 |
|
|
{
|
361 |
|
|
if (Button==Comctrls::btNext) MainForm->valeurconfig[53]=MainForm->valeurconfig[53]+0.05;
|
362 |
|
|
if (Button==Comctrls::btPrev) MainForm->valeurconfig[53]=MainForm->valeurconfig[53]-0.05;
|
363 |
|
|
if (MainForm->valeurconfig[53]<MainForm->valeurconfig[54]) MainForm->valeurconfig[53]=MainForm->valeurconfig[54];
|
364 |
|
|
if (MainForm->valeurconfig[53]>1.) MainForm->valeurconfig[53]=1.;
|
365 |
|
|
Label46->Caption=MainForm->valeurconfig[53];
|
366 |
|
|
}
|
367 |
|
|
//---------------------------------------------------------------------------
|
368 |
|
|
|
369 |
|
|
void __fastcall Tconfigwin::UpDown10Click(TObject *Sender,
|
370 |
|
|
TUDBtnType Button)
|
371 |
|
|
{
|
372 |
|
|
if (Button==Comctrls::btNext) MainForm->valeurconfig[54]=MainForm->valeurconfig[54]+0.05;
|
373 |
|
|
if (Button==Comctrls::btPrev) MainForm->valeurconfig[54]=MainForm->valeurconfig[54]-0.05;
|
374 |
|
|
if (MainForm->valeurconfig[54]<MainForm->valeurconfig[55]) MainForm->valeurconfig[54]=MainForm->valeurconfig[55];
|
375 |
|
|
if (MainForm->valeurconfig[54]>MainForm->valeurconfig[53]) MainForm->valeurconfig[54]=MainForm->valeurconfig[53];
|
376 |
|
|
Label52->Caption=MainForm->valeurconfig[54];
|
377 |
|
|
|
378 |
|
|
}
|
379 |
|
|
//---------------------------------------------------------------------------
|
380 |
|
|
|
381 |
|
|
void __fastcall Tconfigwin::UpDown11Click(TObject *Sender,
|
382 |
|
|
TUDBtnType Button)
|
383 |
|
|
{
|
384 |
|
|
if (Button==Comctrls::btNext) MainForm->valeurconfig[55]=MainForm->valeurconfig[55]+0.05;
|
385 |
|
|
if (Button==Comctrls::btPrev) MainForm->valeurconfig[55]=MainForm->valeurconfig[55]-0.05;
|
386 |
|
|
if (MainForm->valeurconfig[55]<0.) MainForm->valeurconfig[55]=0.;
|
387 |
|
|
if (MainForm->valeurconfig[55]>MainForm->valeurconfig[54]) MainForm->valeurconfig[55]=MainForm->valeurconfig[54];
|
388 |
|
|
Label53->Caption=MainForm->valeurconfig[55];
|
389 |
|
|
|
390 |
|
|
}
|
391 |
|
|
//---------------------------------------------------------------------------
|
392 |
|
|
|
393 |
|
|
void __fastcall Tconfigwin::Button17Click(TObject *Sender)
|
394 |
|
|
{
|
395 |
|
|
AnsiString InputString = InputBox("Information", "Nom de la configuration ?","");
|
396 |
francois |
98 |
char buf[5000];
|
397 |
|
5 |
char temp[10];
|
398 |
|
|
int nb;
|
399 |
|
|
HKEY clef;
|
400 |
|
|
DWORD type,taille,typeclef;
|
401 |
|
|
RegCreateKeyEx(HKEY_CURRENT_USER,"SOFTWARE\\UQTR\\VMM\\Configuration",0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,0,&clef,&typeclef);
|
402 |
|
|
int res=RegQueryValueEx(clef,"Nombre",0,&type,0,&taille);
|
403 |
|
|
if (res==ERROR_SUCCESS)
|
404 |
|
|
{
|
405 |
|
|
RegQueryValueEx(clef,"Nombre",0,&type,(LPBYTE)&nb,&taille);
|
406 |
|
|
}
|
407 |
|
|
else nb=0;
|
408 |
|
|
nb++;
|
409 |
|
|
buf[0]=0;
|
410 |
francois |
62 |
for (int i=0;i<200;i++)
|
411 |
|
5 |
{
|
412 |
francois |
62 |
sprintf(temp,"%.4f ",MainForm->valeurconfig[i]);
|
413 |
|
5 |
strcat(buf,temp);
|
414 |
|
|
}
|
415 |
|
|
RegSetValueEx(clef,"Nombre",0,REG_DWORD, (LPBYTE)&nb,sizeof(int));
|
416 |
|
|
sprintf(temp,"Nom%d",nb);
|
417 |
|
|
RegSetValueEx(clef,temp,0,REG_SZ, InputString.c_str(),sizeof(char)*(strlen(InputString.c_str())+1));
|
418 |
|
|
RegSetValueEx(clef,InputString.c_str(),0,REG_SZ, buf,sizeof(char)*(strlen(buf)+1));
|
419 |
|
|
RegCloseKey(clef);
|
420 |
|
|
Close();
|
421 |
|
|
}
|
422 |
|
|
//---------------------------------------------------------------------------
|
423 |
|
|
|
424 |
|
|
void __fastcall Tconfigwin::FormShow(TObject *Sender)
|
425 |
|
|
{
|
426 |
|
|
char buf[500];
|
427 |
|
|
char temp[10];
|
428 |
|
|
int nb;
|
429 |
|
|
ComboBox1->Items->Clear();
|
430 |
|
|
HKEY clef;
|
431 |
|
|
DWORD type,taille,typeclef;
|
432 |
|
|
RegCreateKeyEx(HKEY_CURRENT_USER,"SOFTWARE\\UQTR\\VMM\\Configuration",0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,0,&clef,&typeclef);
|
433 |
|
|
int res=RegQueryValueEx(clef,"Nombre",0,&type,0,&taille);
|
434 |
|
|
if (res==ERROR_SUCCESS)
|
435 |
|
|
{
|
436 |
|
|
res=RegQueryValueEx(clef,"Nombre",0,&type,(LPBYTE)&nb,&taille);
|
437 |
|
|
}
|
438 |
|
|
else nb=0;
|
439 |
|
|
if (nb==0) ComboBox1->Enabled=false; else ComboBox1->Enabled=true;
|
440 |
|
|
for (int i=0;i<nb;i++)
|
441 |
|
|
{
|
442 |
|
|
sprintf(temp,"Nom%d",i+1);
|
443 |
|
|
RegQueryValueEx(clef,temp,0,&type,0,&taille);
|
444 |
|
|
RegQueryValueEx(clef,temp,0,&type,buf,&taille);
|
445 |
|
|
ComboBox1->Items->Add(buf);
|
446 |
|
|
}
|
447 |
|
|
RegCloseKey(clef);
|
448 |
|
|
}
|
449 |
|
|
//---------------------------------------------------------------------------
|
450 |
|
|
|
451 |
|
|
|
452 |
|
|
void __fastcall Tconfigwin::ComboBox1Change(TObject *Sender)
|
453 |
|
|
{
|
454 |
|
|
char buf[500];
|
455 |
|
|
HKEY clef;
|
456 |
|
|
DWORD type,taille,typeclef;
|
457 |
|
|
RegCreateKeyEx(HKEY_CURRENT_USER,"SOFTWARE\\UQTR\\VMM\\Configuration",0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,0,&clef,&typeclef);
|
458 |
|
|
RegQueryValueEx(clef,ComboBox1->Text.c_str(),0,&type,0,&taille);
|
459 |
|
|
RegQueryValueEx(clef,ComboBox1->Text.c_str(),0,&type,buf,&taille);
|
460 |
|
|
if (buf[0]!='?')
|
461 |
|
|
{
|
462 |
|
|
char* p=strtok(buf," ");
|
463 |
|
|
for (int i=0;i<57;i++)
|
464 |
|
|
{
|
465 |
|
|
double val;
|
466 |
|
|
sscanf(p,"%lf",&val);
|
467 |
|
|
MainForm->valeurconfig[i]=val;
|
468 |
|
|
p=strtok(NULL," ");
|
469 |
|
|
}
|
470 |
|
|
}
|
471 |
|
|
Invalidate();
|
472 |
|
|
RegCloseKey(clef);
|
473 |
|
|
}
|
474 |
|
|
//---------------------------------------------------------------------------
|
475 |
|
|
|
476 |
|
|
void __fastcall Tconfigwin::Button18Click(TObject *Sender)
|
477 |
|
|
{
|
478 |
|
|
if (ColorDialog1->Execute())
|
479 |
|
|
{
|
480 |
|
|
Label2->Color=ColorDialog1->Color;
|
481 |
|
|
getRGB(Label2->Color,MainForm->valeurconfig[57],MainForm->valeurconfig[58],MainForm->valeurconfig[59]);
|
482 |
|
|
}
|
483 |
|
|
}
|
484 |
|
|
//---------------------------------------------------------------------------
|
485 |
|
|
|
486 |
|
|
|
487 |
|
|
|
488 |
francois |
62 |
void __fastcall Tconfigwin::UpDown12Click(TObject *Sender,
|
489 |
|
|
TUDBtnType Button)
|
490 |
|
|
{
|
491 |
|
|
if (Button==Comctrls::btNext) indexdegrade++;
|
492 |
|
|
if (Button==Comctrls::btPrev) indexdegrade--;
|
493 |
|
|
if (indexdegrade<0) indexdegrade=0;
|
494 |
|
|
if (indexdegrade>11) indexdegrade=11;
|
495 |
|
|
Invalidate();
|
496 |
|
|
}
|
497 |
|
|
//---------------------------------------------------------------------------
|
498 |
|
|
|
499 |
|
|
void __fastcall Tconfigwin::Button19Click(TObject *Sender)
|
500 |
|
|
{
|
501 |
|
|
if (ColorDialog1->Execute())
|
502 |
|
|
{
|
503 |
|
|
Label31->Color=ColorDialog1->Color;
|
504 |
|
|
getRGB(Label31->Color,MainForm->valeurconfig[66+3*indexdegrade],MainForm->valeurconfig[67+3*indexdegrade],MainForm->valeurconfig[68+3*indexdegrade]);
|
505 |
|
|
}
|
506 |
|
|
}
|
507 |
|
|
//---------------------------------------------------------------------------
|
508 |
|
|
|
509 |
|
|
void __fastcall Tconfigwin::Button20Click(TObject *Sender)
|
510 |
|
|
{
|
511 |
|
|
if (ColorDialog1->Execute())
|
512 |
|
|
{
|
513 |
|
|
Label55->Color=ColorDialog1->Color;
|
514 |
|
|
getRGB(Label55->Color,MainForm->valeurconfig[108],MainForm->valeurconfig[109],MainForm->valeurconfig[110]);
|
515 |
|
|
}
|
516 |
|
|
}
|
517 |
|
|
//---------------------------------------------------------------------------
|
518 |
|
|
|
519 |
|
|
void __fastcall Tconfigwin::Button21Click(TObject *Sender)
|
520 |
|
|
{
|
521 |
|
|
if (ColorDialog1->Execute())
|
522 |
|
|
{
|
523 |
|
|
Label64->Color=ColorDialog1->Color;
|
524 |
|
|
getRGB(Label64->Color,MainForm->valeurconfig[111],MainForm->valeurconfig[112],MainForm->valeurconfig[113]);
|
525 |
|
|
}
|
526 |
|
|
}
|
527 |
|
|
//---------------------------------------------------------------------------
|
528 |
|
|
|
529 |
|
|
void __fastcall Tconfigwin::Button22Click(TObject *Sender)
|
530 |
|
|
{
|
531 |
|
|
if (ColorDialog1->Execute())
|
532 |
|
|
{
|
533 |
|
|
Label65->Color=ColorDialog1->Color;
|
534 |
|
|
getRGB(Label65->Color,MainForm->valeurconfig[114],MainForm->valeurconfig[115],MainForm->valeurconfig[116]);
|
535 |
|
|
}
|
536 |
|
|
}
|
537 |
|
|
//---------------------------------------------------------------------------
|
538 |
|
|
|
539 |
|
|
void __fastcall Tconfigwin::Button23Click(TObject *Sender)
|
540 |
|
|
{
|
541 |
|
|
if (ColorDialog1->Execute())
|
542 |
|
|
{
|
543 |
|
|
Label66->Color=ColorDialog1->Color;
|
544 |
|
|
getRGB(Label66->Color,MainForm->valeurconfig[117],MainForm->valeurconfig[118],MainForm->valeurconfig[119]);
|
545 |
|
|
}
|
546 |
|
|
}
|
547 |
|
|
//---------------------------------------------------------------------------
|
548 |
|
|
|
549 |
|
|
void __fastcall Tconfigwin::Button24Click(TObject *Sender)
|
550 |
|
|
{
|
551 |
|
|
if (ColorDialog1->Execute())
|
552 |
|
|
{
|
553 |
|
|
Label67->Color=ColorDialog1->Color;
|
554 |
|
|
getRGB(Label67->Color,MainForm->valeurconfig[120],MainForm->valeurconfig[121],MainForm->valeurconfig[122]);
|
555 |
|
|
}
|
556 |
|
|
}
|
557 |
|
|
//---------------------------------------------------------------------------
|
558 |
|
|
|