1 | unit UCDConjoinForm;
|
---|
2 |
|
---|
3 | {$mode Delphi}{$H+}
|
---|
4 |
|
---|
5 | interface
|
---|
6 |
|
---|
7 | uses
|
---|
8 | Classes, SysUtils, UCDCommon;
|
---|
9 |
|
---|
10 | type
|
---|
11 | { TCDConjoinForm }
|
---|
12 |
|
---|
13 | TCDConjoinForm = class(TCDConjoinFormBase)
|
---|
14 | public
|
---|
15 | CoolDockClient: TCDClientBase;
|
---|
16 | UpdateCaptionEnable: Boolean;
|
---|
17 | procedure UpdateCaption;
|
---|
18 | procedure FormShow(Sender : TObject);
|
---|
19 | procedure FormHide(Sender : TObject);
|
---|
20 | constructor Create(TheOwner: TComponent); override;
|
---|
21 | destructor Destroy; override;
|
---|
22 | private
|
---|
23 | procedure SetName(const NewName: TComponentName); override;
|
---|
24 | end;
|
---|
25 |
|
---|
26 |
|
---|
27 | implementation
|
---|
28 |
|
---|
29 | uses
|
---|
30 | UCDManager, UCDClient;
|
---|
31 |
|
---|
32 | { TCDConjoinForm }
|
---|
33 |
|
---|
34 | procedure TCDConjoinForm.UpdateCaption;
|
---|
35 | var
|
---|
36 | NewCaption: string;
|
---|
37 | I: Integer;
|
---|
38 | begin
|
---|
39 | if UpdateCaptionEnable then begin
|
---|
40 | NewCaption := '';
|
---|
41 | for I := 0 to DockClientCount - 1 do begin
|
---|
42 | //if DockClients[I] is TCDConjoinForm then
|
---|
43 | // TCDConjoinForm(DockClients[I]).UpdateCaption;
|
---|
44 | NewCaption := NewCaption + DockClients[I].Caption + ', ';
|
---|
45 | end;
|
---|
46 | Caption := Copy(NewCaption, 1, Length(NewCaption) - 2);
|
---|
47 |
|
---|
48 | if Assigned(HostDockSite) and (HostDockSite is TCDConjoinForm) then
|
---|
49 | TCDConjoinForm(HostDockSite).UpdateCaption;
|
---|
50 | end;
|
---|
51 | end;
|
---|
52 |
|
---|
53 | procedure TCDConjoinForm.FormShow(Sender: TObject);
|
---|
54 | begin
|
---|
55 | TCDManager(DockManager).Visible := True;
|
---|
56 | end;
|
---|
57 |
|
---|
58 | procedure TCDConjoinForm.FormHide(Sender: TObject);
|
---|
59 | var
|
---|
60 | I: Integer;
|
---|
61 | begin
|
---|
62 | TCDManager(DockManager).Visible := False;
|
---|
63 | end;
|
---|
64 |
|
---|
65 | constructor TCDConjoinForm.Create(TheOwner: TComponent);
|
---|
66 | begin
|
---|
67 | inherited CreateNew(TheOwner);
|
---|
68 | CoolDockClient := TCDClient.Create(Self);
|
---|
69 | with CoolDockClient do begin
|
---|
70 | end;
|
---|
71 | OnShow := FormShow;
|
---|
72 | OnHide := FormHide;
|
---|
73 | UpdateCaptionEnable := True;
|
---|
74 | end;
|
---|
75 |
|
---|
76 | destructor TCDConjoinForm.Destroy;
|
---|
77 | begin
|
---|
78 | inherited;
|
---|
79 | end;
|
---|
80 |
|
---|
81 | procedure TCDConjoinForm.SetName(const NewName: TComponentName);
|
---|
82 | begin
|
---|
83 | inherited SetName(NewName);
|
---|
84 | CoolDockClient.Name := Name + 'CoolDockClient';
|
---|
85 | end;
|
---|
86 |
|
---|
87 | initialization
|
---|
88 |
|
---|
89 | RegisterClass(TCDConjoinForm);
|
---|
90 |
|
---|
91 |
|
---|
92 | finalization
|
---|
93 |
|
---|
94 | UnRegisterClass(TCDConjoinForm);
|
---|
95 |
|
---|
96 |
|
---|
97 |
|
---|
98 | end.
|
---|
99 |
|
---|