CDockablePane Class
Implements a pane that can either be docked in a dock site or included in a tabbed pane.
class CDockablePane : public CPane
Members
Public Constructors
Name |
Description |
---|---|
Constructs and initializes a CDockablePane object. |
Public Methods
Name |
Description |
---|---|
Attaches a pane to another pane. This creates a tabbed pane. |
|
Returns the size of the pane rectangle. |
|
Determines whether the specified mini frame can be docked to the pane. |
|
Determines whether another pane can be docked to the current pane. |
|
Determines whether the pane supports auto-hide mode. (Overrides CBasePane::CanAutoHide.) |
|
Determines whether the current pane can be docked to another pane. |
|
Converts one or more dockable panes to MDI tabbed documents. |
|
Copies the state of a dockable pane. |
|
Creates the Windows control and attaches it to the CDockablePane object. |
|
Creates a default divider for the pane as it is being docked to a frame window. |
|
Creates the Windows control and attaches it to the CDockablePane object. |
|
Creates a tabbed pane from the current pane. |
|
Docks a container to the pane. |
|
Docks a pane by using outline (standard) docking. |
|
CDockablePane::DockToFrameWindow |
Used internally. To dock a pane, use CPane::DockPane or CDockablePane::DockToWindow. |
Docks a pane to its stored recent docking position. |
|
Docks one docking pane to another docking pane. |
|
Enables or disables auto-hide mode for this pane together with other panes in the container. |
|
Shows or hides the caption (gripper). |
|
Specifies the position of the pane when visible in auto-hide mode. |
|
Retrieves the auto hide slide mode for the pane. |
|
CDockablePane::GetAutoHideButton |
Used internally. |
CDockablePane::GetAutoHideToolBar |
Used internally. |
Returns the height of the current caption. |
|
Returns the default pane divider for the pane's container. |
|
Determines the ability of a pane to be docked based on the provided pointer location. |
|
Returns the drag sensitivity of a docking pane. |
|
Retrieves the percentage of space that a pane occupies within its container. |
|
Retrieves the tab area for the pane. |
|
Returns the runtime class information about a tabbed window that is created when another pane docks to the current pane. |
|
Specifies whether a docking pane can be switched to auto-hide mode. |
|
Specifies the specific location in a pane where the user clicks a mouse. |
|
CDockablePane::IsAccessibilityCompatible |
Used internally. |
Indicates whether the docking pane and all other panes in the container can be placed in auto-hide mode. |
|
Determines whether a pane is in auto-hide mode. |
|
CDockablePane::IsChangeState |
Used internally. |
Determines whether the current pane is docked. |
|
Determines the behavior of a pane that is in auto-hide mode if it is shown (or hidden) by calling ShowPane. |
|
Specifies whether the pane is in a multi-pane frame window. |
|
Specifies whether the pane is resizable. |
|
Specifies whether tabs are located at the top or bottom of the pane. |
|
Specifies whether a pane is being dragged by the user. |
|
Determines whether the current pane is visible. |
|
Used internally. |
|
Called by the framework when the parent of a pane has changed. (Overrides CPane::OnAfterChangeParent.) |
|
Called by the framework when a floating docking bar docks at a frame window. |
|
Called by the framework when the parent of the pane is about to change. (Overrides CPane::OnBeforeChangeParent.) |
|
Called by the framework when a pane is about to float. (Overrides CPane::OnBeforeFloat.) |
|
The framework calls this method when a pane is being undocked. |
|
Replaces the pane with a specified pane. |
|
The framework calls this method as a pane is deserialized to restore the default pane divider. |
|
CDockablePane::SaveState |
Used internally. |
CDockablePane::Serialize |
Serializes the pane. (Overrides CBasePane::Serialize.) |
Toggles the docking pane between visible and auto-hide mode. |
|
Sets the auto-hide button and auto-hide toolbar for the pane. |
|
CDockablePane::SetDefaultPaneDivider |
Used internally. |
Sets the percentage of space that a pane occupies within its container. |
|
CDockablePane::SetResizeMode |
Used internally. |
Sets the restored default pane divider. |
|
Sets the runtime class information for a tabbed window that is created when two panes dock together. |
|
Shows or hides a pane. |
|
Shows or hides a pane with a sliding animation which displays only when the pane is in auto-hide mode. |
|
Toggles auto-hide mode. (Overrides CPane::ToggleAutoHide .) |
|
Undocks a pane from either the main frame window or a miniframe window container. |
|
CDockablePane::UnSetAutoHideMode |
Used internally. To set the auto-hide mode, use CDockablePane::SetAutoHideMode |
Protected Methods
Name |
Description |
---|---|
Determines whether the docking pane is hidden (in auto-hide mode). |
|
Determines when an auto-hide docking pane should stop sliding. |
|
Draws the docking pane caption (gripper). |
|
Called when the user presses a caption button other than the AFX_HTCLOSE and AFX_HTMAXBUTTON buttons. |
|
Called by the framework to render the auto-hide slide effect when the pane is either shown or hidden. |
Data Members
Name |
Description |
---|---|
Specifies whether auto-hide animation of the dockable pane is disabled. |
|
Determines the behavior of the pane when the pane is in auto-hide mode. |
|
Specifies the animation speed of the pane when it is being shown or hidden when in auto-hide mode. |
Remarks
CDockablePane implements the following functionality:
Docking a pane to a main frame window.
Switching a pane to auto-hide mode.
Attaching a pane to a tabbed window.
Floating a pane in a miniframe window.
Docking a pane to another pane that is floating in a miniframe window.
Resizing a pane.
Loading and saving state for a docking pane.
Note
State information is saved to the Windows registry.
Creating a pane with or without a caption. The caption can have a text label and it can be filled with a gradient color.
Dragging a pane while displaying the contents of the pane
Dragging a pane while displaying a drag rectangle.
To use a docking pane in your application, derive your pane class from the CDockablePane class. Either embed the derived object into the main frame window object or into a window object that controls the instance of your pane. Then call the CDockablePane::Create method or the CDockablePane::CreateEx method when you process the WM_CREATE message in the main frame window. Finally, set up the pane object by calling CBasePane::EnableDocking, CBasePane::DockPane, or CDockablePane::AttachToTabWnd.
Customization Tips
The following tips apply to CDockablePane objects:
If you call CDockablePane::AttachToTabWnd for two non-tabbed, dockable panes, a pointer to a tabbed window will be returned in the ppTabbedControlBar parameter. You can continue to add tabs to the tabbed window by using this parameter.
The kind of tabbed pane that is created by CDockablePane::AttachToTabWnd is determined by the CDockablePane object in the pTabControlBarAttachTo parameter. You can call CDockablePane::SetTabbedPaneRTC to set the kind of tabbed pane that the CDockablePane will create. The default type is determined by the dwTabbedStyle of CDockablePane::Create when you first create the CDockablePane. If dwTabbedStyle is AFX_CBRS_OUTLOOK_TABS the default type is CMFCOutlookBar Class; if dwTabbedStyle is AFX_CBRS_REGULAR_TABS the default type is CTabbedPane Class.
If you want to dock one dockable pane to another, call the CDockablePane::DockToWindow method. The original pane must be docked somewhere before you call this method.
The member variable CDockablePane::m_bHideInAutoHideMode controls how dockable panes behave in auto hide mode when you call CDockablePane::ShowPane. If this member variable is set to TRUE, dockable panes and their auto hide buttons will be hidden. Otherwise, they will slide in and out.
You can disable auto-hide animation by setting the CDockablePane::m_bDisableAnimation member variable to TRUE.
Example
The following example demonstrates how to configure a CDockablePane object by using various methods in the CDockablePane class. The example illustrates how to enable the auto-hide all feature for the dockable pane, enable the caption or the gripper, enable the auto-hide mode, show the pane, and animate a pane that is in auto-hide mode. This code snippet is part of the Visual Studio Demo sample.
// GetOwner is an inherited method.
CDockablePane* pParentBar = DYNAMIC_DOWNCAST(CDockablePane, GetOwner());
...
pParentBar->EnableAutohideAll();
pParentBar->EnableGripper(true);
pParentBar->SetAutoHideMode(true, CBRS_ALIGN_LEFT);
pParentBar->ShowPane(true,false,true);
pParentBar->Slide(true);
Inheritance Hierarchy
Requirements
Header: afxDockablePane.h