-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathUnit2.pas
104 lines (86 loc) · 3.05 KB
/
Unit2.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
{**********************************************************************}
{ }
{ Parameter input window unit }
{ for ARSSE }
{ }
{ (based on the Soldat Admin source by Michal Marcinkowski) }
{ }
{ Copyright (c) 2005-2008 Harsányi László (a.k.a. KeFear) }
{ Copyright (c) 2010 Gregor A. Cieslak (a.k.a. Shoozza) }
{ All rights reserved }
{ }
{ NOT free to distribute or modify }
{ }
{**********************************************************************}
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;
type
TMyDialogBox = class(TForm)
AlphaButton: TButton;
BravoButton: TButton;
CharlieButton: TButton;
DeltaButton: TButton;
ParamValue: TEdit;
ParamLabel: TLabel;
procedure AlphaButtonClick(Sender: TObject);
procedure BravoButtonClick(Sender: TObject);
procedure CharlieButtonClick(Sender: TObject);
procedure DeltaButtonClick(Sender: TObject);
procedure ParamValueKeyPress(Sender: TObject; var Key: Char);
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormPaint(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
MyDialogBox: TMyDialogBox;
implementation
uses Unit1, Unit3;
{$R *.dfm}
procedure TMyDialogBox.AlphaButtonClick(Sender: TObject);
begin
ModalResult := mrYes;
end;
procedure TMyDialogBox.BravoButtonClick(Sender: TObject);
begin
ModalResult := mrOK;
end;
procedure TMyDialogBox.CharlieButtonClick(Sender: TObject);
begin
ModalResult := mrCancel;
end;
procedure TMyDialogBox.DeltaButtonClick(Sender: TObject);
begin
ModalResult := mrNo;
end;
procedure TMyDialogBox.ParamValueKeyPress(Sender: TObject; var Key: Char);
begin
if Key=#13 then BravoButtonClick(nil);
if Key=#27 then CharlieButtonClick(nil);
end;
procedure TMyDialogBox.FormShow(Sender: TObject);
begin
// BotHelp.Visible:=true;
if BotHelp.Enabled then BotHelp.Show;
// BotHelp.Left:=MyDialogBox.Left+MyDialogBox.Width;
// BotHelp.Top:=MyDialogBox.Top;
if ParamValue.Visible then ParamValue.SetFocus;
end;
procedure TMyDialogBox.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
// BotHelp.Visible:=false;
BotHelp.Close;
end;
procedure TMyDialogBox.FormPaint(Sender: TObject);
begin
BotHelp.Left:=MyDialogBox.Left+MyDialogBox.Width;
BotHelp.Top:=MyDialogBox.Top;
end;
end.