共用方式為


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

  (Overrides CBasePane::CalcFixedLayout.)

CDockablePane::CanAcceptMiniFrame

 

CDockablePane::CanAcceptPane

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

CDockablePane::CanAdjustLayout

 

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

  (Overrides CPane::ConvertToTabbedDocument.)

CDockablePane::CopyState

  (Overrides CPane::CopyState.)

CDockablePane::Create

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

CDockablePane::CreateDefaultPaneDivider

 

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

 

CDockablePane::DockPaneStandard

  (Overrides CPane::DockPaneStandard.)

CDockablePane::DockToFrameWindow

  (Overrides CPane::DockToFrameWindow.)

CDockablePane::DockToRecentPos

 

CDockablePane::DockToWindow

Docks one docking pane to another docking pane.

CDockablePane::EnableAutohideAll

Enables or disables autohide mode for this pane together with other panes in the container.

CDockablePane::EnableGripper

Shows or hides the caption (gripper).

CDockablePane::GetAHRestoredRect

 

CDockablePane::GetAHSlideMode

 

CDockablePane::GetAutoHideButton

 

CDockablePane::GetAutoHideToolBar

 

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

 

CDockablePane::GetRecentSiblingPaneInfo

 

CDockablePane::GetTabArea

 

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 autohide mode.

CDockablePane::HitTest

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

CDockablePane::IsAccessibilityCompatible

  (Overrides CBasePane::IsAccessibilityCompatible.)

CDockablePane::IsAutoHideMode

Determines whether a pane is in autohide mode.

CDockablePane::IsAutohideAllEnabled

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

CDockablePane::IsChangeState

  (Overrides CPane::IsChangeState.)

CDockablePane::IsDocked

Determines whether the current pane is docked.

CDockablePane::IsDrawCaption

 

CDockablePane::IsHideDisabledButtons

 

CDockablePane::IsHideInAutoHideMode

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

CDockablePane::IsInFloatingMultiPaneFrameWnd

  (Overrides CPane::IsInFloatingMultiPaneFrameWnd.)

CDockablePane::IsResizable

  (Overrides CPane::IsResizable.)

CDockablePane::IsTabLocationBottom

 

CDockablePane::IsTracked

 

CDockablePane::IsVisible

Determines whether the current pane is visible.

CDockablePane::LoadState

  (Overrides CPane::LoadState.)

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::OnUpdateCmdUI

  (Overrides CBasePane::OnUpdateCmdUI.)

CDockablePane::PreTranslateMessage

  (Overrides CBasePane::PreTranslateMessage.)

CDockablePane::RemoveFromDefaultPaneDividier

 

CDockablePane::ReplacePane

 

CDockablePane::RestoreDefaultPaneDivider

 

CDockablePane::SaveState

  (Overrides CPane::SaveState.)

CDockablePane::Serialize

  (Overrides CBasePane::Serialize.)

CDockablePane::SetAutoHideMode

Toggles the docking pane between visible and autohide mode.

CDockablePane::SetAutoHideParents

 

CDockablePane::SetCaptionStyle

 

CDockablePane::SetDefaultPaneDivider

 

CDockablePane::SetLastPercentInPaneContainer

 

CDockablePane::SetResizeMode

 

CDockablePane::SetRestoredDefaultPaneDivider

 

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 autohide 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

 

Protected Methods

Name

Description

CDockablePane::CheckAutoHideCondition

Determines whether the docking pane is hidden (in autohide mode).

CDockablePane::CheckStopSlideCondition

Determines when an autohide 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 autohide slide effect when the pane is either shown or hidden.

Data Members

Name

Description

CDockablePane::m_bDisableAnimation

Specifies whether autohide animation of the dockable pane is disabled.

CDockablePane::m_bHideInAutoHideMode

Determines the behavior of the pane when the pane is in autohide mode.

CDockablePane::m_nSlideSteps

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

CObject

   CCmdTarget

      CWnd

         CBasePane

            CPane

               CDockablePane

Requirements

Header: afxDockablePane.h

See Also

Reference

Hierarchy Chart

CPane Class

Other Resources

MFC Classes