The Docking Controller and Docking Managers
- 2 minutes to read
The ExpressDocking Library includes a docking manager component (TdxDockingManager) which can be used to provide centralized control over the appearance and behavior of dock controls. The image below shows this component on the component palette.
Control over docking operations together with the appearance and behavior of dock controls is provided by the docking controller – an instance of the TdxDockingController class. There is always a single docking controller instance in an application and it can be accessed via the dxDockingController global function call. The docking controller introduces a set of methods that return settings for the dock controls residing on a particular form. Thus, dock controls call the docking controller’s methods passing their parent form as the parameter. If the docking controller finds a docking manager component on the form specified, this docking manager’s settings are returned. This enables you to provide centralized control over the docking controls on each form by placing docking manager components on each.
The image below illustrates the approach described:
Note that each time a docking manager is placed onto a form, it is registered in the docking controller’s DockManagers collection. The first manager registered is used as the default docking manager. This manager’s settings are used for dock controls owned by forms that do not have their own docking managers. This enables you to provide centralized control over dock controls on all forms using a single docking manager component. For this purpose, you only need to have a single docking manager in the application.
The image below shows how dock controls obtain their settings when there is a single docking manager in the application:
Note that if there are no docking managers in an application the docking controller’s methods return default values and thus, all dock controls have default behavior.
Note that the docking controller doesn’t only provide a means for interaction between dock controls and docking managers. It also introduces members which allow you to manage individual dock controls. For instance, you can specify the currently active dock control using the ActiveDockControl property or obtain the dock control located at a specified position using the GetDockControlAtPos method. Please refer to the TdxDockingController class description for more information on the docking controller’s abilities.
Please refer to the Docking Manager Features topic for a detailed description of features provided by the docking manager component.