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. |
|
(Overrides CBasePane::CalcFixedLayout.) |
|
|
|
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. |
|
(Overrides CPane::ConvertToTabbedDocument.) |
|
(Overrides CPane::CopyState.) |
|
Creates the Windows control and attaches it to the CDockablePane object. |
|
|
|
Creates the Windows control and attaches it to the CDockablePane object. |
|
Creates a tabbed pane from the current pane. |
|
|
|
(Overrides CPane::DockPaneStandard.) |
|
(Overrides CPane::DockToFrameWindow.) |
|
|
|
Docks one docking pane to another docking pane. |
|
Enables or disables autohide mode for this pane together with other panes in the container. |
|
Shows or hides the caption (gripper). |
|
|
|
|
|
|
|
|
|
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. |
|
|
|
|
|
|
|
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 autohide mode. |
|
Specifies the specific location in a pane where the user clicks a mouse. |
|
(Overrides CBasePane::IsAccessibilityCompatible.) |
|
Determines whether a pane is in autohide mode. |
|
Indicates whether the docking pane and all other panes in the container can be placed in autohide mode. |
|
(Overrides CPane::IsChangeState.) |
|
Determines whether the current pane is docked. |
|
|
|
|
|
Determines the behavior of a pane that is in autohide mode if it is shown (or hidden) by calling ShowPane. |
|
(Overrides CPane::IsInFloatingMultiPaneFrameWnd.) |
|
(Overrides CPane::IsResizable.) |
|
|
|
|
|
Determines whether the current pane is visible. |
|
(Overrides CPane::LoadState.) |
|
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.) |
|
(Overrides CBasePane::OnUpdateCmdUI.) |
|
(Overrides CBasePane::PreTranslateMessage.) |
|
|
|
|
|
|
|
(Overrides CPane::SaveState.) |
|
(Overrides CBasePane::Serialize.) |
|
Toggles the docking pane between visible and autohide mode. |
|
|
|
|
|
|
|
|
|
|
|
|
|
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 autohide mode. |
|
Toggles auto-hide mode. (Overrides CPane::ToggleAutoHide .) |
|
Undocks a pane from either the main frame window or a miniframe window container. |
|
|
Protected Methods
Name |
Description |
---|---|
Determines whether the docking pane is hidden (in autohide mode). |
|
Determines when an autohide 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 autohide slide effect when the pane is either shown or hidden. |
Data Members
Name |
Description |
---|---|
Specifies whether autohide animation of the dockable pane is disabled. |
|
Determines the behavior of the pane when the pane is in autohide mode. |
|
Specifies the animation speed of the pane when it is being shown or hidden when in autohide mode. |
Remarks
CDockablePane implements the following functionality:
Docking a pane to a main frame window.
Switching a pane to autohide 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.
注意
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 autohide 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 autohide all feature for the dockable pane, enable the caption or the gripper, enable the autohide mode, show the pane, and animate a pane that is in autohide 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