{Procedure of TForm}
procedure TForm1.FormCreate(Sender: TObject);
var
i, index, intLine: Integer;
ScreenWidth, ScreenHeight: Integer;
OSInfo: TOSVersionInfo;
Labelx: array[1..10] of Tlabel;
bolOK: Boolean;
begin
DefaultFormatSettings.DecimalSeparator := '.';
OSInfo.dwOSVersionInfoSize := SizeOf(TOSVersionInfo);
if GetVersionEx(OSInfo) then
OSName := 'Windows'
else
OSName := 'Autre';
{
gd := Detect;
InitGraph(gd, gm, '');
if GraphResult <> grOk then
begin
ShowMessage('Erreur d''initialisation graphique.');
halt(1);
end; }
ScreenWidth := Screen.Width - 400;
ScreenHeight := Screen.Height - 100;
//width := GetMaxX + 1;
//height := GetMaxY + 1;
Form1.Width := ScreenWidth - 100;
Form1.Height := ScreenHeight - 100;
.../...
// Créer l'instance de TComboBox
CbLanguage := TComboBox.Create(Form1);
// Définir le parent pour qu'il soit visible
CbLanguage.Parent := Self;
CbLanguage.Left := LbSelectLanguage.Left;
CbLanguage.Top := LbETAccuracy.Top;
CbLanguage.Width := LbSelectLanguage.Width;
CbLanguage.Clear;
CbLanguage.Items.Add('English');
CbLanguage.Items.Add('Français');
CbLanguage.Items.Add('Deutch');
CbLanguage.OnChange := @CbLanguageChange;
strValeur := OpenReadInI('Parametres', 'Language', 'English');
case strValeur of
'English': begin
lang := 'en';
CbLanguage.ItemIndex:= 0;
end;
'Français': begin
lang := 'fr';
CbLanguage.ItemIndex:= 1;
end;
'Deutch': begin
lang := 'de';
CbLanguage.ItemIndex:= 2;
end;
else
begin
lang := 'en';
CbLanguage.ItemIndex:= 0;
end;
end;
CbMTAccuracy := TComboBox.Create(Form1);
// Définir le parent pour qu'il soit visible
CbMTAccuracy.Parent := Self;
CbMTAccuracy.Left := LbDelta.Left;
CbMTAccuracy.Top := LbMTAccuracy.Top;
CbMTAccuracy.Width := LbDelta.Width;
CbMTAccuracy.Clear;
CbMTAccuracy.Items.Add('1/100');
CbMTAccuracy.Items.Add('1/1000');
CbMTAccuracy.Items.Add('1/10000');
CbMTAccuracy.Items.Add('1/100000');
CbMTAccuracy.Items.Add('1/1000000');
strValeur := OpenReadInI('Parametres', 'MT_accuracy', '1/1000');
CbMTAccuracy.Text := strValeur;
case CbMTAccuracy.Text of
'1/100':
begin
strMaskMT := '!00:00:00.00;1;_';
MTPrecision := 2;
end;
'1/1000':
begin
strMaskMT := '!00:00:00.000;1;_';
MTPrecision := 3;
end;
'1/10000':
begin
strMaskMT := '!00:00:00.0000;1;_';
MTPrecision := 4;
end;
'1/100000':
begin
strMaskMT := '!00:00:00.00000;1;_';
MTPrecision := 5;
end;
'1/1000000':
begin
strMaskMT := '!00:00:00.000000;1;_';
MTPrecision := 6;
end;
end;
// Créer l'instance de TComboBox
CbETAccuracy := TComboBox.Create(Form1);
// Définir le parent pour qu'il soit visible
CbETAccuracy.Parent := Self;
CbETAccuracy.Left := LbDelta.Left;
CbETAccuracy.Top := LbETAccuracy.Top;
CbETAccuracy.Width := LbDelta.Width;
CbETAccuracy.Clear;
CbETAccuracy.Items.Add('1/1000');
CbETAccuracy.Items.Add('1/10000');
CbETAccuracy.Items.Add('1/100000');
CbETAccuracy.Items.Add('1/1000000');
strValeur := OpenReadInI('Parametres', 'ET_accuracy', '1/1000');
CbETAccuracy.Text := strValeur;
case CbETAccuracy.Text of
'1/1000':
begin
strMaskET := '!00:00:00.000:;1;_';
ETPrecision := 3;
end;
'1/10000':
begin
strMaskET := '!00:00:00.0000;1;_';
ETPrecision := 4;
end;
'1/100000':
begin
strMaskET := '!00:00:00.00000;1;_';
ETPrecision := 5;
end;
'1/1000000':
begin
strMaskET := '!00:00:00.000000;1;_';
ETPrecision := 6;
end;
end;