-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslaveseldlg.pas
67 lines (49 loc) · 1.21 KB
/
slaveseldlg.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
unit SlaveSelDlg;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, SlvSelFm;
type
{ TSlaveSelDlg }
TSlaveSelDlg = class(TCommonDialog)
private
FDialogForm: TSlaveSelForm;
function GetDialogForm: TSlaveSelForm;
protected
public
constructor Create(AOwner: TComponent); override;
function Execute: Boolean; override;
property DialogForm: TSlaveSelForm read GetDialogForm;
published
end;
procedure Register;
implementation
uses FormEx;
procedure Register;
begin
RegisterComponents('Dialogs',[TSlaveSelDlg]);
end;
{ TSlaveSelDlg }
function TSlaveSelDlg.GetDialogForm: TSlaveSelForm;
begin
if not Assigned(FDialogForm) then begin
FDialogForm := TSlaveSelForm.Create(Self);
end;
Result := FDialogForm
end;
constructor TSlaveSelDlg.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
end;
function TSlaveSelDlg.Execute: Boolean;
begin
Result := DialogForm.ShowModal = mrOK;
if Result then
with DialogForm.FormListBox do
if ItemIndex >= 0 then begin
(Items.Objects[ItemIndex] as TForm).Show;
FormAdjust((Items.Objects[ItemIndex] as TForm));
end
else Result := False;
end;
end.