RAD Studio VCL Reference
|
Specifies the number of controls that are docked on the windowed control.
property DockClientCount: Integer;
__property int DockClientCount;
Use DockClientCount to get the number of controls that are docked to the windowed control. This value can be used as an upper bound when iterating through the DockClients property.
C++ Examples:
/* The following example is taken from the docking demo. It shows how the OnUnDock event handler of the conjoinment docking site re-enables docking in the control that is undocked (if it is a dockable form). In addition, when the next to last docked control is undocked, the conjoinment docking site sends itself a close message so that the last docked control is undocked to its old position and size. */ void __fastcall TConjoinDockHost::FormUnDock(TObject *Sender, TControl *Client, TWinControl *NewTarget, bool &Allow) { // Only 2 dock clients means the host must be destroyed and // the remaining window undocked to its old position and size. // Recall that OnUnDock gets called before the undocking // actually occurs. if (Client->ClassNameIs("TDockableForm")) dynamic_cast<TDockableForm *>(Client)->DockSite = True; if ((DockClientCount == 2) && (NewTarget != this)) // Self? PostMessage(dynamic_cast<TConjoinDockHost *>(this)->Handle, WM_CLOSE, 0, 0); UpdateCaption(Client); }
Delphi Examples:
{ The following example is taken from the docking demo. It shows how the OnUnDock event handler of the conjoinment docking site re-enables docking in the control that is undocked (if it is a dockable form). In addition, when the next to last docked control is undocked, the conjoinment docking site sends itself a close message so that the last docked control is undocked to its old position and size. } procedure TConjoinDockHost.FormUnDock(Sender: TObject; Client: TControl; NewTarget: TWinControl; var Allow: Boolean); begin // Only 2 dock clients means the host must be destroyed and // the remaining window undocked to its old position and size. // Recall that OnUnDock gets called before the undocking // actually occurs. if Client is TDockableForm then TDockableForm(Client).DockSite := True; if (DockClientCount = 2) and (NewTarget <> Self) then PostMessage(Self.Handle, WM_CLOSE, 0, 0); UpdateCaption(Client); end;
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|