source: trunk/Packages/CoolDocking/UCDConjoinForm.pas

Last change on this file was 73, checked in by chronos, 12 years ago
  • Modified: Packages are now stored as uncomporessed and are linked with relative path to project.
File size: 2.0 KB
Line 
1unit UCDConjoinForm;
2
3{$mode Delphi}{$H+}
4
5interface
6
7uses
8 Classes, SysUtils, UCDCommon;
9
10type
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
27implementation
28
29uses
30 UCDManager, UCDClient;
31
32{ TCDConjoinForm }
33
34procedure TCDConjoinForm.UpdateCaption;
35var
36 NewCaption: string;
37 I: Integer;
38begin
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;
51end;
52
53procedure TCDConjoinForm.FormShow(Sender: TObject);
54begin
55 TCDManager(DockManager).Visible := True;
56end;
57
58procedure TCDConjoinForm.FormHide(Sender: TObject);
59var
60 I: Integer;
61begin
62 TCDManager(DockManager).Visible := False;
63end;
64
65constructor TCDConjoinForm.Create(TheOwner: TComponent);
66begin
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;
74end;
75
76destructor TCDConjoinForm.Destroy;
77begin
78 inherited;
79end;
80
81procedure TCDConjoinForm.SetName(const NewName: TComponentName);
82begin
83 inherited SetName(NewName);
84 CoolDockClient.Name := Name + 'CoolDockClient';
85end;
86
87initialization
88
89RegisterClass(TCDConjoinForm);
90
91
92finalization
93
94UnRegisterClass(TCDConjoinForm);
95
96
97
98end.
99
Note: See TracBrowser for help on using the repository browser.