-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathUDlgMethodCall.pas
More file actions
60 lines (50 loc) · 1.13 KB
/
UDlgMethodCall.pas
File metadata and controls
60 lines (50 loc) · 1.13 KB
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
unit UDlgMethodCall;
interface
uses
Forms,
StdCtrls,
Vcl.Controls,
System.Classes;
type
TFMethodCallDialog = class(TForm)
LMethodCall: TLabel;
LParametervalues: TLabel;
LResult: TLabel;
EResult: TEdit;
BOK: TButton;
EMethodCall: TEdit;
EParametervalues: TEdit;
procedure BOKClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
public
procedure Prepare;
end;
implementation
uses
Math,
JvGnugettext;
{$R *.dfm}
procedure TFMethodCallDialog.FormCreate(Sender: TObject);
begin
TranslateComponent(Self);
end;
procedure TFMethodCallDialog.BOKClick(Sender: TObject);
begin
Close;
end;
procedure TFMethodCallDialog.Prepare;
begin
var AWidth := 300;
AWidth := Max(AWidth, Canvas.TextWidth(EMethodCall.Text));
AWidth := Max(AWidth, Canvas.TextWidth(EParametervalues.Text));
AWidth := Max(AWidth, Canvas.TextWidth(EResult.Text));
if AWidth > 300 then
AWidth := AWidth + 10;
Width := (360 - 300) + AWidth;
EMethodCall.Width := AWidth;
EParametervalues.Width := AWidth;
EResult.Width := AWidth;
BOK.Left := 257 + (AWidth - 300);
ActiveControl := BOK;
end;
end.