ArcFM Engine Developer Guide
DockManager Class
Members 


Product Availability
Required Licenses
.NET Assembly
Provides the framework dock window manager.
Syntax
'Declaration
 
Public Class DockManager 
'Usage
 
Dim instance As DockManager
public class DockManager 
Remarks
The DockManager class provides the facilities to display information in the main window area or in dockable windows. The window area which remains after all dockable windows have taken their space is called the "filler area." This area is filled with a System.Windows.Forms Panel. Access to this panel is available via the docking manager's FillPanel property: Panel fillPanel = MainApp.MainWin.DockManager.FillPanel; Typically, a single control is assigned as the only child control of the FillPanel. This control is specified in an application extension with the custom attribute [FrameworkFillControl] and is known as the framework's FillControl. The framework will automatically assign the first class it finds with the custom attribute to be the single child control of the FillPanel. In addition, it will automatically set the Dock property to DockStyle.Fill so that the control will be automatically resized whenever the FillPanel is resized.

A TabControl is typically used as the FillControl because it allows multiple pages of information to be displayed in the main area. Typically each TabPage contains a UserControl that encapsulates one of the features to be displayed in the main window area. The tab pages will be automatically resized whenever the parent tab control is resized. However, a UserControl on a tab page will not necessarily be resized when the tab page is resized. To ensure that the UserControl always fills the TabPage, the programmer should set the Dock property of the UserControl to DockStyle.Fill. This is not done automatically by the framework to allow for the case where it is not desired for the UserControl to be resized when the TabPage is resized. The following shows an example of typical code used to create a TabControl for the main filler area. The example assumes that two tabs are desired, one for stocks and one for bonds (each of which is a UserControl that is located elsewhere). ///

/// Provides the FillControl for this program. ///[FrameworkFillControl] public class FillControl : System.Windows.Forms.TabControl { // Load the bitmaps to use on the tabs. this.ImageList = MainApp.LoadBitmapStrip(_thisAssembly, "TabImages"); // Define stocks page. System.Windows.Forms.TabPage tabStocks = new System.Windows.Forms.TabPage("Stocks"); tabStocks.ImageIndex = 0; tabStocks.Controls.Add(new StocksControl()); this.TabPages.Add(tabStocks); // Define bonds page. System.Windows.Forms.TabPage tabBonds = new System.Windows.Forms.TabPage("Bonds"); tabBonds.ImageIndex = 1; tabBonds.Controls.Add(new BondsControl()); this.TabPages.Add(tabBonds); }

The dockable window provided by the framework is similar to the FillPanel but more complex. A dockable window is specified in an application extension with the custom attribute [FrameworkDockWindow]. During program initialization each application extension class with the custom attribute is instantiated to create its dockable window. Similar to the FillPanel, a dockable window starts with a UserControl (or a standard Control) that will show the information desired for that dockable window. The Control is then assigned as the single control of a DockControlPane. One or more DockControlPane panes can be assigned as child panes of a DockGroupPane. This allows multiple "windows" to be grouped together into a single dockable area. How the various child panes are displayed, relative to each other, is defined by the ChildPaneStyle property. They can be displayed as

A vertical splitter between each pane, A horizontal splitter between each pane, A set of tab pages, or A set of sliding group bars (similar to Microsoft Outlook). The DockGroupPane can also hold a child pane which is itself a DockGroupPane thus allowing for an arbitrary amount of grouping complexity in the docking system.

The highest level in the docking system is the DockAreaPane. The DockAreaPane is derived from the DockGroupPane and provides the actual window which can be docked or floated. Typically, a single DockGroupPane is assigned as the child pane of the DockAreaPane. The following example shows typical code to create a window docked on the right side of the main window. The example assumes that it is desired to have the window display two tab pages with one control per page. One page shows the status of trucks and the other shows the status of crews (which are defined as UserControls elsewhere). ///

/// Defines the dockable Status Window for this program. ///[FrameworkDockWindow] public class DockWindowStatus { public DockWindowStatus() { Assembly thisAssembly = Assembly.GetAssembly(typeof(DockWindowStatus)); DockControlPane dcpTrucks = new DockControlPane("trucks", "Trucks", new TrucksControl(), MainApp.LoadBitmap(thisAssembly, "Trucks")); DockControlPane dcpCrews = new DockControlPane("crews", "Crews", new CrewsControl(), MainApp.LoadBitmap(thisAssembly, "Crews")); DockGroupPane dgpStatus = new DockGroupPane(ChildPaneStyle.TabGroup); dgpStatus.Panes.Add(dcpTrucks); dgpStatus.Panes.Add(dcpCrews); DockAreaPane dapLeft = new DockAreaPane(DockLocation.DockLeft); dapLeft.Panes.Add(dgpStatus); MainApp.MainWin.DockManager.DockAreas.Add(dapLeft); } } The DockedLocation enumeration defines where the DockAreaPane is to be docked. Both a docked location and a float location is maintained by the DockAreaPane. By simply double-clicking on the caption bar of the window, the window will toggle between its docked location and its float location. The framework DockManager keeps a list of all DockAreaPane panes.When a new DockAreaPane is added to the list, it will be displayed in its specified location.

Inheritance Hierarchy

System.Object
   Miner.Windows.Docking.DockManager

Requirements

Target Platforms: Windows XP SP3 (32-bit and 64-bit), Windows 7 (32-bit and 64-bit)

Not all Operating Systems are supported on all products. Visit the ArcFM Solution Supported Versions page for full details.

See Also

Reference

DockManager Members
Miner.Windows.Docking Namespace

 

 


Send Comment