-
Notifications
You must be signed in to change notification settings - Fork 25
/
ReadFloat.pas
executable file
·53 lines (40 loc) · 1.11 KB
/
ReadFloat.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
unit ReadFloat;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
Spin;
type
{ TReadFloatForm }
TReadFloatForm = class(TForm)
ReadFloatEdit: TFloatSpinEdit;
OKBtn: TButton;
ReadFloatLabel: TLabel;
procedure OKBtnClick(Sender: TObject);
function GetFloat(lStr: string; lMin,lDefault,lMax: double): double;
private
{ private declarations }
public
{ public declarations }
end;
var
ReadFloatForm: TReadFloatForm;
implementation
{ TReadFloatForm }
function TReadFloatForm.GetFloat(lStr: string; lMin,lDefault,lMax: double): double;
begin
//result := lDefault;
ReadFloatLabel.caption := lStr+' ['+floattostr(lMin)+'..'+floattostr(lMax)+']';
ReadFloatEdit.MinValue := lMin;
ReadFloatEdit.MaxValue := lMax;
ReadFloatEdit.Value := lDefault;
ReadFloatForm.ShowModal;
result := ReadFloatEdit.value;
end;
procedure TReadFloatForm.OKBtnClick(Sender: TObject);
begin
ReadFloatForm.ModalResult := mrOK;
end;
initialization
{$I ReadFloat.lrs}
end.