source: Docking/CoolDocking/UCDConjoinForm.pas

Last change on this file was 430, checked in by chronos, 12 years ago
  • Fixed: CoolDock show wrong tab focused if tab was invisible.
File size: 2.2 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 protected
15 procedure SetName(const NewName: TComponentName); override;
16 public
17 FreeIfEmpty: Boolean;
18 CoolDockClient: TCDClientBase;
19 UpdateCaptionEnable: Boolean;
20 procedure UpdateCaption;
21 procedure FormShow(Sender : TObject);
22 procedure FormHide(Sender : TObject);
23 constructor Create(TheOwner: TComponent); override;
24 destructor Destroy; override;
25 end;
26
27
28implementation
29
30uses
31 UCDManager, UCDClient;
32
33{ TCDConjoinForm }
34
35procedure TCDConjoinForm.UpdateCaption;
36var
37 NewCaption: string;
38 I: Integer;
39begin
40 if UpdateCaptionEnable then begin
41 NewCaption := '';
42 for I := 0 to DockClientCount - 1 do begin
43 //if DockClients[I] is TCDConjoinForm then
44 // TCDConjoinForm(DockClients[I]).UpdateCaption;
45 NewCaption := NewCaption + DockClients[I].Caption + ', ';
46 end;
47 Caption := Copy(NewCaption, 1, Length(NewCaption) - 2);
48
49 if Assigned(HostDockSite) and (HostDockSite is TCDConjoinForm) then
50 TCDConjoinForm(HostDockSite).UpdateCaption;
51 //if Assigned(HostDockSite) and (HostDockSite is TCDConjoinForm) then
52 TCDManager(DockManager).Update;
53 end;
54end;
55
56procedure TCDConjoinForm.FormShow(Sender: TObject);
57begin
58 TCDManager(DockManager).Visible := True;
59end;
60
61procedure TCDConjoinForm.FormHide(Sender: TObject);
62begin
63 TCDManager(DockManager).Visible := False;
64end;
65
66constructor TCDConjoinForm.Create(TheOwner: TComponent);
67begin
68 inherited;
69 CoolDockClient := TCDClient.Create(Self);
70 with TCDClient(CoolDockClient) do begin
71 Dockable := True;
72 end;
73 OnShow := FormShow;
74 OnHide := FormHide;
75 UpdateCaptionEnable := True;
76 FreeIfEmpty := True;
77end;
78
79destructor TCDConjoinForm.Destroy;
80begin
81 inherited;
82end;
83
84procedure TCDConjoinForm.SetName(const NewName: TComponentName);
85begin
86 inherited SetName(NewName);
87 CoolDockClient.Name := Name + 'CoolDockClient';
88end;
89
90initialization
91
92RegisterClass(TCDConjoinForm);
93
94
95finalization
96
97UnRegisterClass(TCDConjoinForm);
98
99
100
101end.
102
Note: See TracBrowser for help on using the repository browser.