LMD DockingPack Guide
Tabbed documents feature provides a built-in way to organize application documents. It allows to show documents in special central tabbed zone, several tabbed zones split horizontally or vertically or in a floating window.
The feature is enabled by default, but can be disabled using UseTabDocs property of TLMDDockManager component:
Usually, users open many application documents at a time, so, the corresponding document tab zone has no space to show all document tabs. LMD-DockingPack provides two different strategies to deal with big tabs count. The default way is Delphi like way of document tabs scrolling:
Scroll buttons allow to scroll tab area, thus, making possible to navigate to any existing tab. They are shown if TLMDDockManager.ScrollDocTabs property is True (default). If the property value has been changed to False, then the only way to locate required tab, is to use tab list button and its popup menu:
The later strategy, is more a Visual Studio like way. Among shown buttons, these two strategies differs in a way they use to show required tab. Required tab can be shows using tab list popup menu, or using corresponding panel's Show method. If TLMDDockManager.ScrollDocTabs property is True, then tab area will be scrolled to show required tab, otherwise, if required tab is not shows, tabs will be re-ordered to make showing tab a first tab.
To support tabs scrolling idea the following API has been added to LMD-DockingPack:
•TLMDDockZone.FirstTab property allows to retrieve or set the index of the tab, which will be drawn first in tab area.
•TLMDDockZone.ScrollToTab method allows to ensure that specified tab is visible in tab area.
•TLMDDockZone.IsTabInView method allows to check, whether the tab is visible in tab area.
If tabbed documents are enabled, LMD DockPack library distinguish between two kinds of panels:
•Tools panels.
•Document panels.
Panel kind can be specified using ClientKind property of TLMDDockPanel control. Since LMD DockingPack is compatible with VCl docking, and non-panel docking clients are possible (though not recommended), the client kind of non-panel dock clients can be specified using OnGetClientKind event of TLMDDockManager component.
Document panels are different from tools panels in the following aspects:
•By default document panels can be docked only into tabbed document host zones (read more about tabbed document host zones below). For example, document can't be docked to the left of the site. This can be though overridden using OnUpdateHotSpots event of TLMDDockSite control.
•The style of floating document form is different from floating tool form; moreover, in current version there are no possibility to dock additional panel into floating document form.
As opposed to document panels, tool panels can be docked anywhere, including docking them as tabbed documents. This as well can be overridden using OnUpdateHotSpots event. Also, additional tool panels can be docked into floating tool panel to organize floating panel groups.
Setting ClientKind property at run-time never result in an automatic rearrangement of a panel inside its parent site. Generally, if a docked tool panel becomes a document because of changing ClientKind property value at run-time, it will continue to be docked where it was before, and will look as it looked before. This aspect clearly distinguishes panel client kind and tabbed document host zones.
When tabbed documents feature is turned on, space zone becomes a main tabbed document host zone. Because of possible complex tabbed zone structure the space zone can contain child zones. LMD DockingPack automatically maintains integrity of these zones, disabling some hotspot areas:
Actually, the following structures are possible:
•Empty space zone;
•Tabs space zone with one or more panels inside it. For tabbed document zones tabs are shown even if tab zone has only one child;
•Horizontal split space zone with tabs zones inside it;
•Vertical split space zone with tabs zones inside it.
All other combinations are invalid. Basically, provided public API allows to violate structure restrictions; for example, its possible to set any existing zone as a space zone at run-time. In this case, if the structure will not much, the space zone will not be considered as a tabbed documents zone, and will not look like it.
Document tabs provides close buttons, which can be used to close document panels. Pressing these buttons will trigger panel's OnCloseQuery and potentially OnClose events. These events can be used to prevent document from closing or specify close action. Usually, dynamically created document panels should use at least OnClose event and specify caFree close action to asynchronously destroy closing document panel. This concept is very similar to OnCloseQuery, OnClose and Release of VCL TForm class.