Understanding the Dock Controls Internal Layout
- 3 minutes to read
This topic explains the basic principles of dock control arrangement. It provides a set of rules that will help you to understand how and when dock controls are automatically created and destroyed as the result of docking operations.
Site Related Rules
Dock panels (and containers) can only reside on sites. The ExpressDocking Library provides three site types: dock sites, layout sites and float sites. Dock sites are controls that you place on forms to allow docking panels and containers to them. Layout sites are created on dock sites as the result of docking operations and they allow flexible dock control layout customization. Finally, float sites are used to accommodate dock controls on floating forms.
Float sites are created automatically when a dock control is made to float. They are automatically destroyed when docking a control on a dock site or layout site.
Layout sites are created automatically when docking a panel or container on a dock site. They fill the area not occupied by docked controls. Note: controls can also be docked to layout sites and this results in creating a layout site that fills the area not occupied by the control just docked.
The points above can be illustrated by using the Object TreeView window. Consider the following dock control layout customization steps:
The form contains a dock site. Two dock panels are floating (reside on float sites).
The first panel is now docked to the dock site. This destroys the panel’s underlying float site, places the panel on the dock site and creates a neighboring layout site.
The second panel is docked to the layout site. This destroys the panel’s underlying float site, places the panel on the layout site and creates a neighboring layout site. Now the second panel and its neighboring layout site belong to the first layout site.
Container Related Rules
Docking a panel to the left, right, top or bottom edge of another panel creates a side container. The container created becomes the parent of the two panels. Its position within the object tree is determined by the target panel’s position.
Docking a panel to the center of another panel creates a tab container. The container created becomes the parent of the two panels. Its position within the object tree is the target panel’s position.
Dragging a panel away from a container destroys the container (if only a single panel is left within it).
Docking a panel to an existing container adds the panel to the container’s child list.
The following sample steps illustrate some of the rules above.
First, there are three individual dock panels (each residing on its own float site).
The second panel is docked to the first panel to form a tab container. The first panel’s underlying float site has been destroyed as a result. The tab container’s position within the object tree is the previous position of the target panel.
The third panel is docked to the tab container to create a vertical side container. The third panel’s underlying float site is destroyed as a result. The side container’s position within the object tree is the previous position of the tab container (the target of the docking operation).