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
|
unit Unit5;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
StdCtrls, Buttons, ExtCtrls, Spin,UChaines,UnitScaleFont,LCLType;
type
{ TForm5 }
TForm5 = class(TForm)
BitBtn1: TBitBtn;
Label1: TLabel;
Label3: TLabel;
Label4: TLabel;
RadioGroup1: TRadioGroup;
SpinEdit1: TSpinEdit;
Label2: TLabel;
Label5: TLabel;
Editvarmax: TEdit;
Label6: TLabel;
Editpasmin: TEdit;
Label7: TLabel;
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure RadioGroup1Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
private
{ private declarations }
encreation:boolean;
public
{ public declarations }
end;
var
Form5: TForm5;
implementation
uses Unit1;
procedure TForm5.RadioGroup1Click(Sender: TObject);
begin
case radiogroup1.ItemIndex of
0: begin
spinedit1.Enabled:=true;
editvarmax.Enabled:=false;
editpasmin.Enabled:=false;
end;
1: begin
spinedit1.Enabled:=false;
editvarmax.Enabled:=true;
editpasmin.Enabled:=true;
end;
end;
end;
procedure TForm5.FormCreate(Sender: TObject);
begin
encreation:=true;
Caption := rsNombreDePoin ;
Label1.Caption := rsLesValeursDe ;
Label3.Caption := Format(rsOnAppellePas, ['"', '"']);
RadioGroup1.Caption := rsChoixDuPas;
//RadioGroup1.Items.clear;
RadioGroup1.Items[0]:=rsPasConstant;
RadioGroup1.Items[1]:=rsPasAdaptatif;
Label4.Caption := rsNombreDePoin2 ;
Label2.Caption := rsLaVariationM ;
Label5.Caption := rsEntreDeuxVol ;
Label6.Caption := rsMaisLePasNeP ;
Label7.Caption := rsML2;
BitBtn1.Caption := rsOK ;
spinedit1.MinValue:=2;
spinedit1.MaxValue:=10000;
end;
procedure TForm5.FormShow(Sender: TObject);
begin
if encreation then begin scalefont(self); encreation:=false; end;
end;
procedure TForm5.BitBtn1Click(Sender: TObject);
begin
if radiogroup1.ItemIndex=0 then begin
pas_adaptatif:=false;
nombre_points_calcul:=spinedit1.value;
nombre_points_calcul_0:=spinedit1.value;
exit;
end;
if radiogroup1.ItemIndex=1 then begin
pas_adaptatif:=true;
try
var_log_max:=strtofloat(editvarmax.text);
except
application.MessageBox(pchar(rsSyntaxeIncor8), pchar(rsAttention2), mb_ok);
var_log_max:=0.5;
editvarmax.Text:='0.5';
end;
try
limite_inferieure_pas:=strtofloat(editpasmin.text);
except
application.MessageBox(pchar(rsSyntaxeIncor8), pchar(rsAttention2), mb_ok);
limite_inferieure_pas:=0.01;
end;
end;
end;
initialization
{$I unit5.lrs}
end.
|