共用方式為


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

CDockablePane::CDockablePane

Constructs and initializes a CDockablePane object.

Public Methods

Name

Description

CDockablePane::AttachToTabWnd

Attaches a pane to another pane. This creates a tabbed pane.

CDockablePane::CalcFixedLayout

Returns the size of the pane rectangle.

CDockablePane::CanAcceptMiniFrame

Determines whether the specified mini frame can be docked to the pane.

CDockablePane::CanAcceptPane

Determines whether another pane can be docked to the current pane.

CDockablePane::CanAutoHide

Determines whether the pane supports auto-hide mode. (Overrides CBasePane::CanAutoHide.)

CDockablePane::CanBeAttached

Determines whether the current pane can be docked to another pane.

CDockablePane::ConvertToTabbedDocument

Converts one or more dockable panes to MDI tabbed documents.

CDockablePane::CopyState

Copies the state of a dockable pane.

CDockablePane::Create

Creates the Windows control and attaches it to the CDockablePane object.

CDockablePane::CreateDefaultPaneDivider

Creates a default divider for the pane as it is being docked to a frame window.

CDockablePane::CreateEx

Creates the Windows control and attaches it to the CDockablePane object.

CDockablePane::CreateTabbedPane

Creates a tabbed pane from the current pane.

CDockablePane::DockPaneContainer

Docks a container to the pane.

CDockablePane::DockPaneStandard

Docks a pane by using outline (standard) docking.

CDockablePane::DockToFrameWindow

Used internally. To dock a pane, use CPane::DockPane or CDockablePane::DockToWindow.

CDockablePane::DockToRecentPos

Docks a pane to its stored recent docking position.

CDockablePane::DockToWindow

Docks one docking pane to another docking pane.

CDockablePane::EnableAutohideAll

Enables or disables auto-hide mode for this pane together with other panes in the container.

CDockablePane::EnableGripper

Shows or hides the caption (gripper).

CDockablePane::GetAHRestoredRect

Specifies the position of the pane when visible in auto-hide mode.

CDockablePane::GetAHSlideMode

Retrieves the auto hide slide mode for the pane.

CDockablePane::GetAutoHideButton

Used internally.

CDockablePane::GetAutoHideToolBar

Used internally.

CDockablePane::GetCaptionHeight

Returns the height of the current caption.

CDockablePane::GetDefaultPaneDivider

Returns the default pane divider for the pane's container.

CDockablePane::GetDockingStatus

Determines the ability of a pane to be docked based on the provided pointer location.

CDockablePane::GetDragSensitivity

Returns the drag sensitivity of a docking pane.

CDockablePane::GetLastPercentInPaneContainer

Retrieves the percentage of space that a pane occupies within its container.

CDockablePane::GetTabArea

Retrieves the tab area for the pane.

CDockablePane::GetTabbedPaneRTC

Returns the runtime class information about a tabbed window that is created when another pane docks to the current pane.

CDockablePane::HasAutoHideMode

Specifies whether a docking pane can be switched to auto-hide mode.

CDockablePane::HitTest

Specifies the specific location in a pane where the user clicks a mouse.

CDockablePane::IsAccessibilityCompatible

Used internally.

CDockablePane::IsAutohideAllEnabled

Indicates whether the docking pane and all other panes in the container can be placed in auto-hide mode.

CDockablePane::IsAutoHideMode

Determines whether a pane is in auto-hide mode.

CDockablePane::IsChangeState

Used internally.

CDockablePane::IsDocked

Determines whether the current pane is docked.

CDockablePane::IsHideInAutoHideMode

Determines the behavior of a pane that is in auto-hide mode if it is shown (or hidden) by calling ShowPane.

CDockablePane::IsInFloatingMultiPaneFrameWnd

Specifies whether the pane is in a multi-pane frame window.

CDockablePane::IsResizable

Specifies whether the pane is resizable.

CDockablePane::IsTabLocationBottom

Specifies whether tabs are located at the top or bottom of the pane.

CDockablePane::IsTracked

Specifies whether a pane is being dragged by the user.

CDockablePane::IsVisible

Determines whether the current pane is visible.

CDockablePane::LoadState

Used internally.

CDockablePane::OnAfterChangeParent

Called by the framework when the parent of a pane has changed. (Overrides CPane::OnAfterChangeParent.)

CDockablePane::OnAfterDockFromMiniFrame

Called by the framework when a floating docking bar docks at a frame window.

CDockablePane::OnBeforeChangeParent

Called by the framework when the parent of the pane is about to change. (Overrides CPane::OnBeforeChangeParent.)

CDockablePane::OnBeforeFloat

Called by the framework when a pane is about to float. (Overrides CPane::OnBeforeFloat.)

CDockablePane::RemoveFromDefaultPaneDividier

The framework calls this method when a pane is being undocked.

CDockablePane::ReplacePane

Replaces the pane with a specified pane.

CDockablePane::RestoreDefaultPaneDivider

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.)

CDockablePane::SetAutoHideMode

Toggles the docking pane between visible and auto-hide mode.

CDockablePane::SetAutoHideParents

Sets the auto-hide button and auto-hide toolbar for the pane.

CDockablePane::SetDefaultPaneDivider

Used internally.

CDockablePane::SetLastPercentInPaneContainer

Sets the percentage of space that a pane occupies within its container.

CDockablePane::SetResizeMode

Used internally.

CDockablePane::SetRestoredDefaultPaneDivider

Sets the restored default pane divider.

CDockablePane::SetTabbedPaneRTC

Sets the runtime class information for a tabbed window that is created when two panes dock together.

CDockablePane::ShowPane

Shows or hides a pane.

CDockablePane::Slide

Shows or hides a pane with a sliding animation which displays only when the pane is in auto-hide mode.

CDockablePane::ToggleAutoHide

Toggles auto-hide mode. (Overrides CPane::ToggleAutoHide .)

CDockablePane::UndockPane

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

CDockablePane::CheckAutoHideCondition

Determines whether the docking pane is hidden (in auto-hide mode).

CDockablePane::CheckStopSlideCondition

Determines when an auto-hide docking pane should stop sliding.

CDockablePane::DrawCaption

Draws the docking pane caption (gripper).

CDockablePane::OnPressButtons

Called when the user presses a caption button other than the AFX_HTCLOSE and AFX_HTMAXBUTTON buttons.

CDockablePane::OnSlide

Called by the framework to render the auto-hide slide effect when the pane is either shown or hidden.

Data Members

Name

Description

CDockablePane::m_bDisableAnimation

Specifies whether auto-hide animation of the dockable pane is disabled.

CDockablePane::m_bHideInAutoHideMode

Determines the behavior of the pane when the pane is in auto-hide mode.

CDockablePane::m_nSlideSteps

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

CObject

   CCmdTarget

      CWnd

         CBasePane

            CPane

               CDockablePane

Requirements

Header: afxDockablePane.h

See Also

Reference

Hierarchy Chart

CPane Class

Other Resources

MFC Classes