-
Notifications
You must be signed in to change notification settings - Fork 25
/
ReadInt.pas
executable file
·88 lines (69 loc) · 2 KB
/
ReadInt.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
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
unit ReadInt;
interface
uses
{$IFDEF FPC} LResources,{$ENDIF}
Buttons{only Lazarus?},SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Spin;
type
{ TReadIntForm }
TReadIntForm = class(TForm)
ReadIntEdit: TSpinEdit;
ReadIntLabel: TLabel;
OKBtn: TButton;
procedure FormShow(Sender: TObject);
function GetInt(lStr: string; lMin,lDefault,lMax: integer): integer;
procedure OKBtnClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ReadIntLabelClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
ReadIntForm: TReadIntForm;
implementation
uses nifti_img_view,{license,} MultiSlice, render;
{$IFNDEF FPC}
{$R *.DFM}
{$ENDIF}
function TReadIntForm.GetInt(lStr: string; lMin,lDefault,lMax: integer): integer;
begin
//result := lDefault;
ReadIntLabel.caption := lStr+' ['+inttostr(lMin)+'..'+inttostr(lMax)+']';
ReadIntEdit.MinValue := lMin;
ReadIntEdit.MaxValue := lMax;
ReadIntEdit.Value := lDefault;
//ReadIntForm.OKBtn.Focused := true;
//ReadIntForm.OKBtn.SetFocus;
ReadIntForm.ShowModal;
result := ReadIntEdit.Value;
if (result < lMin) then result := lMin;
if (result > lMax) then result := lMax;
end;
procedure TReadIntForm.FormShow(Sender: TObject);
begin
//OKBtn.SetFocus;;
end;
procedure TReadIntForm.OKBtnClick(Sender: TObject);
begin
ReadIntForm.ModalResult := mrOK;
end;
procedure TReadIntForm.FormCreate(Sender: TObject);
//var lCPUid: longint;
begin
//Jan 2008 39448
if Date > (400003) then begin
showmessage('This software became obsolete on '+datetostr(40000)+'. Please update to the current version.');
//gBGImg.LicenseID := 1626;
//ImgForm.Exit1Click(nil);
end;
end;
procedure TReadIntForm.ReadIntLabelClick(Sender: TObject);
begin
end;
{$IFDEF FPC}
initialization
{$I ReadInt.lrs}
{$ENDIF}
end.