My form is basically a center panel with several dkDocument clients in tabs. Around the that center panel I have a bunch of dkTool clients. Is there any way to prevent a dkTool client from docking to the panel containing all my dkDocument clients?
Not much documentation that I could find on this event, so I took a stab at it anyway with some help from your dock demo. Seems a bit lengthy but seems to work. Is there a better way?
if (Source.Control is TLMDDockPanel) and
(TLMDDockPanel(Source.Control).ClientKind = dkTool) and
(AZone.Kind = zkTabs) and (AZone.Tabs[0].Zone <> nil) and
(AZone.Tabs[0].Zone.Kind = zkPanel) and
(AZone.Tabs[0].Zone.Panel.ClientKind = dkDocument) then
You can use any other control property, which does not change over time. For this task Owner property will fit well (it set to panel's parent form, if you created dock panels at design-time in Delphi's form designer).
Comments