Bonjour a tous,

Je rencontre un petit problème.
Comment modifier la taille d'une fenêtre de paramétrage de mon application ?

Voici mon code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
var
PagePropathApp : TInputQueryWizardPage;
PagePropathDog : TInputQueryWizardPage;
PagePropathCs : TInputQueryWizardPage;
PagePropathSrv : TInputQueryWizardPage;
PageTurbo : TInputQueryWizardPage;
 
PathLabel, TotalSpaceLabel, FreeSpaceLabel, NeedSpacelabel, InstallSpaceLabel: TLabel;
FreeMB, TotalMB: Cardinal;
Drive: String;
 
// Espace Disponible sur le disque + Espace Necessaire
Function NumToStr(Float: Extended): String;
Begin
Result:= Format('%.2n', [Float]); StringChange(Result, ',', ',');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = ',')) and (Pos(',', Result) > 0) do
SetLength(Result, Length(Result)-1);
End;
 
function MbOrTb(Float: Extended): String;
begin
if Float < 1024 then Result:= NumToStr(Float)+' MB' else
if Float/1024 < 1024 then Result:= NumToStr(Float/1024)+' GB' else
Result:= NumToStr(Float/(1024*1024))+' TB';
end;
 
procedure DirEditOnChange(Sender: TObject);
begin
  Drive:= ExtractFileDrive(WizardForm.DirEdit.Text);
  GetSpaceOnDisk(Drive, True, FreeMB, TotalMB);
  TotalSpaceLabel.Caption:= 'Total disk space: '+MbOrTb(TotalMB);
  FreeSpaceLabel.Caption:= 'Available disk space: '+MbOrTb(FreeMB)+' ('+IntToStr(round(FreeMB*100/TotalMB))+'%)';
  NeedSpaceLabel.Caption:= 'Required disk space: '+MbOrTb({#NeedSize});
  WizardForm.NextButton.Enabled:= (FreeMB>{#NeedSize});
end;
 
procedure InitializeWizard();
begin
  with WizardForm do
  begin
    PathLabel := TLabel.Create(WizardForm)
    DirEdit.OnChange := @DirEditOnChange;
  end;
 
  TotalSpaceLabel:= TLabel.Create(WizardForm);
  TotalSpaceLabel.AutoSize:= False;
  TotalSpaceLabel.SetBounds(0, 155, 300, 20);
  TotalSpaceLabel.Parent:= WizardForm.SelectDirpage;
 
  FreeSpaceLabel:= TLabel.Create(WizardForm);
  FreeSpaceLabel.AutoSize:= False;
  FreeSpaceLabel.SetBounds(0, 175, 300, 20);
  FreeSpaceLabel.Parent:= WizardForm.SelectDirpage;
 
  NeedSpaceLabel:= TLabel.Create(WizardForm);
  NeedSpaceLabel.AutoSize:= False;
  NeedSpaceLabel.SetBounds(0, 195, 300, 20)
  NeedSpaceLabel.Parent:= WizardForm.SelectDirpage;
 
PagePropathApp := CreateInputQueryPage(wpWelcome,
    'CONFIGURATION PROPATH APP SERVEUR','PARAMETRAGE INI',
    'Merci de renseigner le PROPATH APP SERVEUR. Puis appuyer sur suivant.');
  PagePropathApp.Add('IDENT CLIENT:', False);
  PagePropathApp.Add('RACINE ERP:', False);
  PagePropathApp.Add('RACINE DOG:', False);
  PagePropathApp.Add('PORTAIL WEB:', False);
 
PagePropathDog := CreateInputQueryPage(wpWelcome,
    'CONFIGURATION PROPATH DOG','PARAMETRAGE INI',
    'Merci de renseigner le PROPATH DOG INI. Puis appuyer sur suivant.');
  PagePropathDog.Add('IDENT CLIENT:', False);
  PagePropathDog.Add('RACINE ERP:', False);
  PagePropathDog.Add('PORTAIL WEB:', False);
 
PagePropathCs := CreateInputQueryPage(wpWelcome,
    'CONFIGURATION PROPATH CLIENT/SERVEUR','PARAMETRAGE INI',
    'Merci de renseigner le PROPATH CLIENT/SERVEUR. Puis appuyer sur suivant.');
  PagePropathCs.Add('IDENT CLIENT:', False);
  PagePropathCs.Add('PROGICIEL:', False);
  PagePropathCs.Add('RACINE ERP:', False);
  PagePropathCs.Add('ENVIRONNEMENT cmp/dvl/exe:', False);
  PagePropathCs.Add('LOCAL:', False);
  PagePropathCs.Add('ENVIRONNEMENT BATCH cmp/dvl/exe:', False);
  PagePropathCs.Add('LOG APPSERVEUR:', False);
 
PagePropathSrv := CreateInputQueryPage(wpWelcome,
    'CONFIGURATION PROPATH SERVEUR','PARAMETRAGE INI',
    'Merci de renseigner le PROPATH SERVEUR. Puis appuyer sur suivant.');
  PagePropathSrv.Add('IDENT CLIENT:', False);
  PagePropathSrv.Add('PROGICIEL:', False);
  PagePropathSrv.Add('RACINE ERP:', False);
  PagePropathSrv.Add('ENVIRONNEMENT cmp/dvl/exe:', False);
  PagePropathSrv.Add('ENVIRONNEMENT BATCH cmp/dvl/exe:', False);
 
PageTurbo := CreateInputQueryPage(wpWelcome,
    'CONFIGURATION TURBOGRAPH','CONFIGURATION TURBOMAQ',
    'Merci de renseigner votre SERVEUR SMTP, URL PORTAIL et PROPATH. Puis appuyer sur suivant.');
  PageTurbo.Add('SMTP: ', False);
  PageTurbo.Add('URL: ', False);
  PageTurbo.Add('PATH: ', False);
end;
 
procedure CurPageChanged(CurPageID: Integer);
begin
  if CurPageID=wpSelectDir then
  begin
    DirEditOnChange(nil)
  end;
end;
 
// Parametrage PROPATH APP
function FormPropathApp_NextButtonClick(Page: TWizardPage): Boolean;
begin
  Result := True;
end;
 
function GetIdentApp(Param: String): string;
begin
result := PagePropathApp.Values[0];
end;
 
function GetErpApp(Param: String): string;
begin
result := PagePropathApp.Values[1];
end;
 
function GetRacineApp(Param: String): string;
begin
result := PagePropathApp.Values[2];
end;
 
function GetConsoleWebApp(Param: String): string;
begin
result := PagePropathApp.Values[3];
end;
 
// Parametrage PROPATH DOG
function FormPropathDog_NextButtonClick(Page: TWizardPage): Boolean;
begin
  Result := True;
end;
 
function GetIdentDog(Param: String): string;
begin
result := PagePropathDog.Values[0];
end;
 
function GetRacineDog(Param: String): string;
begin
result := PagePropathDog.Values[1];
end;
 
function GetConsoleWebDog(Param: String): string;
begin
result := PagePropathDog.Values[2];
end;
 
// Parametrage PROPATH C/S
function FormPropathCs_NextButtonClick(Page: TWizardPage): Boolean;
begin
  Result := True;
end;
 
function GetIdentCs(Param: String): string;
begin
result := PagePropathCs.Values[0];
end;
 
function GetProgicielCs(Param: String): string;
begin
result := PagePropathCs.Values[1];
end;
 
function GetRacineCs(Param: String): string;
begin
result := PagePropathCs.Values[2];
end;
 
function GetEnvCs(Param: String): string;
begin
result := PagePropathCs.Values[3];
end;
 
function GetLocalCs(Param: String): string;
begin
result := PagePropathCs.Values[4];
end;
 
function GetBatchEnvCs(Param: String): string;
begin
result := PagePropathCs.Values[5];
end;
 
function GetAppLogCs(Param: String): string;
begin
result := PagePropathCs.Values[6];
end;
 
// Parametrage PROPATH SRV
function FormPropathSrv_NextButtonClick(Page: TWizardPage): Boolean;
begin
  Result := True;
end;
 
function GetIdentSrv(Param: String): string;
begin
result := PagePropathSrv.Values[0];
end;
 
function GetProgicielSrv(Param: String): string;
begin
result := PagePropathSrv.Values[1];
end;
 
function GetRacineSrv(Param: String): string;
begin
result := PagePropathSrv.Values[2];
end;
 
function GetEnvSrv(Param: String): string;
begin
result := PagePropathSrv.Values[3];
end;
 
function GetBatchEnvSrv(Param: String): string;
begin
result := PagePropathSrv.Values[4];
end;
 
// Parametrage Turboini
function FormTurbo_NextButtonClick(Page: TWizardPage): Boolean;
begin
  Result := True;
end;
 
function GetRoot(Param: String): string;
begin
result := PageTurbo.Values[0];
end;
 
function GetSmtp(Param: String): string;
begin
result := PageTurbo.Values[1];
end;
 
function GetHttp(Param: String): string;
begin
result := PageTurbo.Values[2];
end;