CBasePane Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at CBasePane Class.

Base class for all panes in MFC.

class CBasePane : public CWnd  

Public Constructors

NameDescription
CBasePane::CBasePaneDefault constructor.
CBasePane::~CBasePaneDestructor.

Public Methods

NameDescription
CBasePane::accHitTestCalled by the framework to retrieve the child element or child object at a given point on the screen. (Overrides CWnd::accHitTest.)
CBasePane::accLocationCalled by the framework to retrieve the current screen location for the specified object. (Overrides CWnd::accLocation.)
CBasePane::AccNotifyObjectFocusEventCBasePane does not use this method.
CBasePane::accSelectCalled by the framework to modify the selection or move the keyboard focus of the specified object. (Overrides CWnd::accSelect.)
CBasePane::AddPaneAdds a pane to the docking manager.
CBasePane::AdjustDockingLayoutRedirects a call to the docking manager to adjust the docking layout.
CBasePane::AdjustLayoutCalled by the framework when the pane should adjust its internal layout.
CBasePane::CalcFixedLayoutCalculates the horizontal size of a control bar.
CBasePane::CanAcceptPaneDetermines whether another pane can be docked to the pane.
CBasePane::CanAutoHideDetermines whether the pane supports auto-hide mode.
CBasePane::CanBeAttachedDetermines whether the pane can be docked to another pane.
CBasePane::CanBeClosedDetermines whether the pane can be closed.
CBasePane::CanBeDockedDetermines whether the pane can be docked to another pane.
CBasePane::CanBeResizedDetermines whether the pane can be resized.
CBasePane::CanBeTabbedDocumentSpecifies whether the pane can be converted to an MDI tabbed document.
CBasePane::CanFloatDetermines whether the pane can float.
CBasePane::CanFocusSpecifies whether the pane can receive focus.
CBasePane::CopyStateCopies the state of a given pane.
CBasePane::CreateDefaultMiniframeIf the pane can float, creates a mini-frame window.
CBasePane::CreateExCreates the pane control.
CBasePane::DockPaneDocks a pane to another pane or to a frame window.
CBasePane::DockPaneUsingRTTIDocks the pane by using run-time type information.
CBasePane::DockToFrameWindowDocks a dockable pane to a frame.
CBasePane::DoesAllowDynInsertBeforeDetermines whether another pane can be dynamically inserted between this pane and the parent frame.
CBasePane::EnableDockingEnables docking of the pane to the main frame.
CBasePane::EnableGripperEnables or disables the gripper. If the gripper is enabled, the user can drag it to reposition the pane.
CBasePane::FillWindowRectUsed internally.
CBasePane::FloatPaneFloats the pane.
CBasePane::get_accChildCalled by the framework to retrieve the address of an IDispatch interface for the specified child. (Overrides CWnd::get_accChild.)
CBasePane::get_accChildCountCalled by the framework to retrieve the number of children that belong to this object. (Overrides CWnd::get_accChildCount.)
CBasePane::get_accDefaultActionCalled by the framework to retrieve a string that describes the default action for the object. (Overrides CWnd::get_accDefaultAction.)
CBasePane::get_accDescriptionCalled by framework to retrieve a string that describes the visual appearance of the specified object. (Overrides CWnd::get_accDescription.)
CBasePane::get_accFocusCalled by the framework to retrieve the object that has the keyboard focus. (Overrides CWnd::get_accFocus.)
CBasePane::get_accHelpCalled by the framework to retrieve a Help property string for the object. (Overrides CWnd::get_accHelp.)
CBasePane::get_accHelpTopicCalled by the framework to retrieve the full path of the WinHelp file that is associated with the specified object and the identifier of the appropriate topic in that file. (Overrides CWnd::get_accHelpTopic.)
CBasePane::get_accKeyboardShortcutCalled by the framework to retrieve the specified shortcut key for the object. (Overrides CWnd::get_accKeyboardShortcut.)
CBasePane::get_accNameCalled by the framework to retrieve the name of the specified object. (Overrides CWnd::get_accName.)
CBasePane::get_accParentCalled by the framework to retrieve the IDispatch interface for the parent of the object. (Overrides CWnd::get_accParent.)
CBasePane::get_accRoleCalled by the framework to retrieve information that describes the role of the specified object. (Overrides CWnd::get_accRole.)
CBasePane::get_accSelectionCalled by the framework to retrieve the selected children of this object. (Overrides CWnd::get_accSelection.)
CBasePane::get_accStateCalled by the framework to retrieve the current state of the specified object. (Overrides CWnd::get_accState.)
CBasePane::get_accValueCalled by the framework to retrieve the value of the specified object. (Overrides CWnd::get_accValue.)
CBasePane::GetCaptionHeightReturns the caption height.
CBasePane::GetControlBarStyleReturns the control bar style.
CBasePane::GetCurrentAlignmentReturns the current pane alignment.
CBasePane::GetDockingModeReturns the current docking mode for the pane.
CBasePane::GetDockSiteFrameWndReturns a pointer to the window that is the dock site for the pane.
CBasePane::GetEnabledAlignmentReturns the CBRS_ALIGN_ styles that are applied to the pane.
CBasePane::GetMFCStyleReturns the pane styles specific to MFC.
CBasePane::GetPaneIconReturns a handle to the pane icon.
CBasePane::GetPaneRectUsed internally.
CBasePane::GetPaneRowReturns a pointer to the CDockingPanesRowobject where the pane is docked.
CBasePane::GetPaneStyleReturns the pane style.
CBasePane::GetParentDockSiteReturns a pointer to the parent dock site.
CBasePane::GetParentMiniFrameReturns a pointer to the parent mini-frame window.
CBasePane::GetParentTabbedPaneReturns a pointer to the parent tabbed pane.
CBasePane::GetParentTabWndReturns a pointer to the parent window that is inside a tab.
CBasePane::GetRecentVisibleStateThe framework calls this method when a pane is restored from an archive.
CBasePane::HideInPrintPreviewModeSpecifies whether the pane is hidden in print preview.
CBasePane::InsertPaneRegisters the specified pane with the docking manager.
CBasePane::IsAccessibilityCompatibleSpecifies whether the pane supports Active Accessibility.
CBasePane::IsAutoHideModeDetermines whether a pane is in auto-hide mode.
CBasePane::IsDialogControlSpecifies whether the pane is a dialog control.
CBasePane::IsDockedDetermines whether the pane is docked.
CBasePane::IsFloatingDetermines whether the pane is floating.
CBasePane::IsHorizontalDetermines whether the pane is docked horizontally.
CBasePane::IsInFloatingMultiPaneFrameWndSpecifies whether the pane is in a multi-pane frame window.
CBasePane::IsMDITabbedDetermines whether the pane has been added to an MDI child window as a tabbed document.
CBasePane::IsPaneVisibleSpecifies whether the WS_VISIBLE flag is set for the pane.
CBasePane::IsPointNearDockSiteDetermines whether a specified point is near the dock site.
CBasePane::IsResizableDetermines whether the pane can be resized.
CBasePane::IsRestoredFromRegistryDetermines whether the pane is restored from the registry.
CBasePane::IsTabbedDetermines whether the pane has been inserted in the tab control of a tabbed window.
CBasePane::IsTooltipTopmostUsed internally.
CBasePane::IsVisibleDetermines whether the pane is visible.
CBasePane::LoadStateLoads the pane state from the registry.
CBasePane::MoveWindowMoves the pane.
CBasePane::OnAfterChangeParentCalled by the framework when the pane's parent has been changed.
CBasePane::OnBeforeChangeParentCalled by the framework just before the pane changes its parent window.
CBasePane::OnDrawCaptionThe framework calls this method when the caption is drawn.
CBasePane::OnMovePaneDividerThis method is currently not used.
CBasePane::OnPaneContextMenuCalled by the framework when it builds a menu that has a list of panes.
CBasePane::OnRemoveFromMiniFrameCalled by the framework when a pane is removed from its parent mini frame window.
CBasePane::OnSetAccDataCBasePane does not use this method.
CBasePane::OnUpdateCmdUIUsed internally.
CBasePane::PaneFromPointReturns the pane that contains the given point.
CBasePane::PreTranslateMessageUsed by class CWinApp to translate window messages before they are dispatched to the TranslateMessage and DispatchMessage Windows functions. (Overrides CWnd::PreTranslateMessage.)
CBasePane::RecalcLayoutCBasePane does not use this method.
CBasePane::RemovePaneFromDockManagerUnregisters a pane and removes it from the list in the docking manager.
CBasePane::SaveStateSaves the pane's state to the registry.
CBasePane::SelectDefaultFontSelects the default font for a given device context.
CBasePane::SerializeReads or writes this object from or to an archive. (Overrides CObject::Serialize.)
CBasePane::SetControlBarStyleSets the control bar style.
CBasePane::SetDockingModeSets the docking mode for the pane.
CBasePane::SetMDITabbedUsed internally.
CBasePane::SetPaneAlignmentSets the alignment for the pane.
CBasePane::SetPaneRectUsed internally.
CBasePane::SetPaneStyleSets the style of the pane.
CBasePane::SetRestoredFromRegistryUsed internally.
CBasePane::SetWindowPosChanges the size, position, and Z-order of a pane.
CBasePane::ShowPaneShows or hides the pane.
CBasePane::StretchPaneStretches a pane vertically or horizontally.
CBasePane::UndockPaneRemoves the pane from the dock site, default slider, or mini-frame window where it is currently docked.

Protected Methods

NameDescription
CBasePane::DoPaintFills the background of the pane.

If you want to create a pane class that supports the extended docking features available in MFC, you must derive it from CBasePane or from CPane Class.

The following customization tips pertain to the CBasePane Class and any classes that inherit from it:

  • When you create a pane, you can apply several new styles:

    • AFX_CBRS_FLOAT makes the pane float.

    • AFX_CBRS_AUTOHIDE enables auto-hide mode.

    • AFX_CBRS_CLOSE enables the pane to be closed (hidden).

    These are flags that you can combine with a bitwise-OR operation.

CBasePane implements the following virtual Boolean methods to reflect these flags: CBasePane::CanBeClosed, CBasePane::CanAutoHide, CBasePane::CanFloat. You can override them in derived classes to customize their behavior.

  • You can customize docking behavior by overriding CBasePane::CanAcceptPane. Have your pane return FALSE from this method to prevent another pane from docking to it.

  • If you want to create a static pane that cannot float and that prevents any other pane from docking before it (similar to the Outlook bar in the OutlookDemo example), create it as non-floating and override CBasePane::DoesAllowDynInsertBefore to return FALSE. The default implementation returns FALSE if the pane is created without the AFX_CBRS_FLOAT style.

  • Create all panes with IDs other than -1.

  • To determine pane visibility, use CBasePane::IsVisible. It correctly handles the visibility state in tabbed and auto-hide modes.

  • If you want to create a non-floating resizable pane, create it without the AFX_CBRS_FLOAT style and call CFrameWnd::DockControlBar.

  • To exclude a pane from a docking layout or to remove a toolbar from its dock bar, call CBasePane::UndockPane. Do not call this method for panes in auto-hide mode or for panes that reside in tabs of tabbed windows.

  • If you want to float or undock a pane that is in auto-hide mode, you must call CDockablePane::SetAutoHideMode with FALSE as the first argument before you call CBasePane::FloatPane or CBasePane::UndockPane.

The following example demonstrates how to use various methods in the CBasePane class. The example demonstrates how to retrieve a pane from the CFrameWndEx class and how to set the docking mode, the pane alignment, and the pane style. The code is from the Word Pad sample.

			// This CMainFrame class extends the CFrameWndEx class.
			// GetPane is a method in the CFrameWndEx class which 
			// Returns a pointer to the pane that has the specified ID.
			CBasePane* pBar = GetPane(ID_VIEW_FORMATBAR);
			if (pBar != NULL)
			{
				// Set the docking mode, the pane alignment, and the pane style.
				pBar->SetDockingMode(DT_STANDARD);
				pBar->SetPaneAlignment(CBRS_ALIGN_LEFT);
				pBar->SetPaneStyle(pBar->GetCurrentAlignment() | CBRS_TOOLTIPS);
				pBar->ShowPane(TRUE, FALSE, FALSE);
			}

CObject

CCmdTarget

CWnd

CBasePane

Header: afxbasepane.h

CBasePane does not use this method.

virtual void AccNotifyObjectFocusEvent(int);

Parameters

[in] int
Not used.

Adds a pane to the docking manager.

void AddPane(CBasePane* pBar);

Parameters

[in] pBar
A pointer to a pane to add.

Remarks

This is a convenience method that adds a pane to a docking manager. By using this method, you do not have to write code that analyzes the type of the parent frame.

For more information, see CDockingManager Class and CMDIFrameWndEx::AddPane.

Redirects a call to the docking manager to adjust the docking layout.

virtual void AdjustDockingLayout(HDWP hdwp=NULL);

Parameters

[out] hdwp
A handle to a structure containing multiple window positions.

Remarks

This is a convenience method that adjusts the docking layout. By using this method, you do not have to write code that analyzes the type of the parent frame.

For more information, see CDockingManager::AdjustDockingLayout

Called by the framework to adjust the internal layout of a pane.

virtual void AdjustLayout();

Remarks

The framework calls this method when a pane has to adjust its internal layout. The base implementation does nothing.

Calculates the horizontal size of a control bar.

virtual CSize CalcFixedLayout(
    BOOL bStretch,  
    BOOL bHorz);

Parameters

[in] bStretch
Indicates whether the bar should be stretched to the size of the frame. The bStretch parameter is nonzero when the bar is not a docking bar (not available for docking) and is 0 when it is docked or floating (available for docking).

[in] bHorz
Indicates that the bar is horizontally or vertically oriented. The bHorz parameter is nonzero if the bar is horizontally oriented and is 0 if it is vertically oriented.

Return Value

The control bar size, in pixels, of a CSize object.

Remarks

See the remarks section in CControlBar::CalcFixedLayout

Determines whether another pane can be docked to the pane.

virtual BOOL CanAcceptPane(const CBasePane* pBar) const;  

Parameters

[in] pBar
A pointer to the pane to dock.

Return Value

TRUE if another pane can be accepted; otherwise FALSE.

Remarks

The framework calls this method before it docks the pane specified by pBar to the current pane.

Use this method and the CBasePane::CanBeDocked method to control how panes dock to other panes in your application.

The default implementation returns FALSE.

Determines whether the pane supports auto-hide mode.

virtual BOOL CanAutoHide() const;  

Return Value

TRUE if this pane supports auto-hide mode; otherwise FALSE.

Remarks

The framework calls this function to determine whether the pane supports auto-hide mode.

During construction, you can set this ability by passing the AFX_CBRS_AUTOHIDE flag to CBasePane::CreateEx.

The default implementation checks for the AFX_CBRS_AUTOHIDE flag. Override this method in a derived class to customize this behavior.

Determines whether the pane can be docked to another pane or frame window.

virtual BOOL CanBeAttached() const;  

Return Value

TRUE if the pane can be docked to another pane or frame window; otherwise FALSE.

Remarks

The default implementation returns FALSE. Override this method in a derived class to enable or disable the ability to dock without calling CBasePane::EnableDocking.

Determines whether the pane can be closed.

virtual BOOL CanBeClosed() const;  

Return Value

TRUE if the pane can be closed; otherwise FALSE.

Remarks

The framework calls this method to determine whether the pane can be closed. If the method returns TRUE, a Close button is added to the pane's title bar or, if the pane is floating, to the title bar of the pane's miniframe window.

During construction, you can set this ability by passing the AFX_CBRS_CLOSE flag to CBasePane::CreateEx.

The default implementation checks for the AFX_CBRS_CLOSE flag.

Determines whether the pane can be docked to another pane.

virtual BOOL CanBeDocked(CBasePane* pDockBar) const;  

Parameters

[in] pDockBar
A pointer to another pane.

Return Value

TRUE if this pane can be docked to another pane; otherwise FALSE.

Remarks

The framework calls this method before it docks the pane specified by pDockBar to the current pane.

Use this method and the CBasePane::CanAcceptPane method to control how panes dock to other panes in your application.

The default implementation returns FALSE.

Determines whether the pane can be resized.

virtual BOOL CanBeResized() const;  

Return Value

TRUE if the pane can be resized; otherwise, FALSE.

Remarks

This method checks for the AFX_CBRS_RESIZE flag, which is specified by default in CBasePane::OnCreate. If this flag is not specified, the docking manager flags the pane internally as immovable instead of docking it.

Specifies whether the pane can be converted to an MDI tabbed document.

virtual BOOL CanBeTabbedDocument() const;  

Return Value

TRUE if the pane can be converted to a tabbed document; otherwise, FALSE. CBasePane::CanBeTabbedDocument always returns FALSE.

Remarks

Only objects of certain CBasePane-derived types, such as the CDockablePane Class, can be converted to tabbed documents.

Determines whether the pane can float.

virtual BOOL CanFloat() const;  

Return Value

TRUE if the pane can float; otherwise FALSE.

Remarks

The framework calls this method to determine whether the pane can float.

During construction, you can set this ability by passing the AFX_CBRS_FLOAT flag to CBasePane::CreateEx.

System_CAPS_ICON_note.jpg Note

The framework assumes that non-floating panes are static and that their docking state cannot change. Therefore, the framework does not save the docking state of non-floating panes.

The default implementation checks for the AFX_CBRS_FLOAT style.

Specifies whether the pane can receive focus.

virtual BOOL CanFocus() const;  

Return Value

TRUE if the pane can receive focus; otherwise FALSE.

Remarks

Override this method in a derived class to control focus. For example, because toolbars cannot receive focus, this method returns FALSE when it is called on toolbar objects.

The framework tries to set the input focus when a pane is docked or floated.

Copies the state of a given pane.

virtual void CopyState(CBasePane* pOrgBar);

Parameters

[in] pOrgBar
A pointer to another pane.

Remarks

This method copies the state from pOrgBar to this pane.

If the pane can float, this method creates a mini-frame window for it.

virtual CPaneFrameWnd* CreateDefaultMiniframe(CRect rectInitial);

Parameters

[in] rectInitial
Specifies the initial coordinates of the mini-frame window.

Return Value

A pointer to the new mini-frame window or NULL if the creation failed.

Remarks

The framework calls this method when a pane switches to a floating state. The method creates a mini-frame window and attaches the pane to this window.

The default implementation returns NULL.

Creates the pane control.

virtual BOOL CreateEx(
    DWORD dwStyleEx,  
    LPCTSTR lpszClassName,  
    LPCTSTR lpszWindowName,  
    DWORD dwStyle,  
    const RECT& rect,  
    CWnd* pParentWnd,  
    UINT nID,  
    DWORD dwControlBarStyle=0,  
    CCreateContext* pContext=NULL);

Parameters

[in] dwStyleEx
The extended styles (see CWnd::CreateEx for more information).

[in] lpszClassName
The window class name.

[in] lpszWindowName
The window name.

[in] dwStyle
The window style (see CWnd::CreateEx).

[in] rect
The initial rectangle.

[in] pParentWnd
A pointer to the parent window.

[in] nID
Specifies the pane ID. Must be unique.

[in] dwControlBarStyle
Style flags for panes.

[in] pContext
A pointer to CcreateContext

Return Value

TRUE if the pane is created successfully; otherwise FALSE.

Remarks

Creates a window of class lpszClassName. If you specify WS_CAPTION, this method clears the WS_CAPTION style bit and sets CBasePane::m_bHasCaption to TRUE, because the library does not support panes with captions.

You can use any combination of child window styles and MFC control bar (CBRS_) styles.

The library adds several new styles for panes. The following table describes the new styles:

StyleDescription
AFX_CBRS_FLOATThe pane can float.
AFX_CBRS_AUTOHIDEThe pane supports auto-hide mode
AFX_CBRS_RESIZEThe pane can be resized. Important: This style is not implemented.
AFX_CBRS_CLOSEThe pane can be closed.
AFX_CBRS_AUTO_ROLLUPThe pane can be rolled up when it floats.
AFX_CBRS_REGULAR_TABSWhen one pane docks to another pane that has this style, a regular tabbed window is created. (For more information, see CTabbedPane Class.)
AFX_CBRS_OUTLOOK_TABSWhen one pane docks to another pane that has this style, an Outlook-style tabbed window is created. (For more information, see CMFCOutlookBar Class.)

To use the new styles, specify them in dwControlBarStyle.

Docks a pane to another pane or to a frame window.

virtual BOOL DockPane(
    CBasePane* pDockBar,  
    LPCRECT lpRect,  
    AFX_DOCK_METHOD dockMethod);

Parameters

[in] pDockBar
A pointer to another pane.

[in] lpRect
Specifies the destination rectangle.

[in] dockMethod
Specifies the docking method.

Return Value

TRUE if the control bar was docked successfully; otherwise, FALSE.

Remarks

Call this function to dock a pane to another pane or a dock bar ( CDockSite Class) that is specified by pDockBar, or to a main frame if pDockBar is NULL.

dockMethod specifies how the pane is docked. See CPane::DockPane for a list of possible values.

Docks the pane by using run-time type information.

void DockPaneUsingRTTI(BOOL bUseDockSite);

Parameters

[in] bUseDockSite
If TRUE, dock to the docking site. If FALSE, dock to the parent frame.

Docks a dockable pane to a frame.

virtual BOOL DockToFrameWindow(
    DWORD dwAlignment,  
    LPCRECT lpRect = NULL,  
    DWORD dwDockFlags = DT_DOCK_LAST,  
    CBasePane* pRelativeBar = NULL,  
    int nRelativeIndex = -1,  
    BOOL bOuterEdge = FALSE);

Parameters

[in] dwAlignment
The side of the parent frame that you want to dock the pane to.

[in] lpRect
The desired size.

[in] dwDockFlags
Ignored.

[in] pRelativeBar
Ignored.

[in] nRelativeIndex
Ignored.

[in] bOuterEdge
If TRUE and there are other dockable panes at the side specified by dwAlignment, the pane is docked outside the other panes, closer to the edge of the parent frame. If FALSE, the pane is docked closer to the center of the client area.

Return Value

TRUE if the method was successful; otherwise FALSE.

Remarks

This method fails if a pane divider ( CPaneDivider Class) cannot be created. Otherwise, it always returns TRUE.

Determines whether another pane can be dynamically inserted between this pane and the parent frame.

virtual BOOL DoesAllowDynInsertBefore() const;  

Return Value

TRUE if a user can insert another pane; otherwise FALSE.

Remarks

The framework calls this method to determine whether a user can dynamically insert a pane before this pane.

For example, suppose your application creates a pane docked at the left side of the frame (such as the Outlook bar). To prevent the user from docking another pane to the left of the first pane, override this method and return FALSE.

We recommend that you override this method and return FALSE for non-floating panes derived from CDockablePane Class.

The default implementation returns TRUE.

Fills the background of the pane.

virtual void DoPaint(CDC* pDC);

Parameters

[in] pDC
A pointer to a device context.

Remarks

The default implementation calls the current visual manager to fill the background ( CMFCVisualManager::OnFillBarBackground).

Enables docking of the pane to the main frame.

virtual void EnableDocking(DWORD dwAlignment);

Parameters

[in] dwAlignment
Specifies the docking alignment to enable.

Remarks

Call this method to enable docking alignment to the main frame. You can pass a combination of CBRS_ALIGN_ flags (for more information, see CControlBar::EnableDocking).

EnableDocking sets the internal flag CBasePane::m_dwEnabledAlignment and the framework checks this flag when a pane is docked.

Call CBasePane::GetEnabledAlignment to determine the docking alignment for a pane.

Enables or disables the gripper. If the gripper is enabled, the user can drag it to reposition the pane.

virtual void EnableGripper(BOOL bEnable);

Parameters

[in] bEnable
TRUE to enable the gripper; FALSE to disable it.

Remarks

The framework uses this method to enable a gripper instead of using the WS_CAPTION style.

Floats the pane.

virtual BOOL FloatPane(
    CRect rectFloat,  
    AFX_DOCK_METHOD dockMethod=DM_UNKNOWN,  
    bool bShow=true);

Parameters

[in] rectFloat
Specifies the screen coordinates where the floating pane appears.

[in] dockMethod
Specifies the dock method to use to float the pane.

[in] bShow
Specifies whether the floating pane is visible ( TRUE) or hidden ( FALSE).

Return Value

TRUE if the pane was floated successfully; otherwise FALSE.

Remarks

Call this method to float a pane at the screen position specified by rectFloat.

The framework calls this method to retrieve the full path of the WinHelp file that is associated with the specified object and the identifier of the appropriate topic in that file.

virtual HRESULT get_accHelpTopic(
    BSTR* pszHelpFile,  
    VARIANT varChild,  
    long* pidTopic);

Parameters

[in] pszHelpFile
Address of a BSTR that receives the full path of the WinHelp file that is associated with the specified object, if any.

[in] varChild
Specifies whether the Help topic to be retrieved is that of the object or one of the child elements of the object. This parameter can be either CHILDID_SELF (to obtain a Help topic for the object) or a child ID (to obtain a Help topic for one of the child elements of the object).

[in] pidTopic
Identifies the Help file topic that is associated with the specified object.

Return Value

CBasePane does not implement this method. Therefore, CBasePane::get_accHelpTopic always returns S_FALSE.

Remarks

This function is part of the Active Accessibility support in MFC. Override this function in a derived class to provide help information about your object.

The framework calls this method to retrieve the selected children of this object.

virtual HRESULT get_accSelection(VARIANT* pvarChildren);

Parameters

[in] pvarChildren
Receives information that identifies the selected children.

Return Value

CBasePane does not implement this method. If pvarChildren is NULL, this method returns E_INVALIDARG. Otherwise, this method returns DISP_E_MEMBERNOTFOUND.

Remarks

This function is part of the Active Accessibility support in MFC. Override this function in a derived class if you have non-windowed user interface elements other than windowless ActiveX controls.

Returns the caption height.

virtual int GetCaptionHeight() const;  

Return Value

The caption height.

Returns the control bar style.

virtual DWORD GetControlBarStyle() const 

Return Value

A bitwise-OR combination of AFX_CBRS_ flags.

Remarks

The return value is a combination of the following possible values.

StyleDescription
AFX_CBRS_FLOATMakes the control bar float.
AFX_CBRS_AUTOHIDEEnables auto-hide mode.
AFX_CBRS_RESIZEEnables resizing of the control bar. When this flag is set, the control bar can be placed in a dockable pane.
AFX_CBRS_CLOSEEnables hiding of the control bar.

Returns the current pane alignment.

virtual DWORD GetCurrentAlignment() const;  

Return Value

The current alignment of the control bar. The following table shows the possible values:

ValueAlignment
CBRS_ALIGN_LEFTLeft alignment.
CBRS_ALIGN_RIGHTRight alignment.
CBRS_ALIGN_TOPTop alignment.
CBRS_ALIGN_BOTTOMBottom alignment.

Returns the current docking mode for the pane.

virtual AFX_DOCK_TYPE GetDockingMode() const;  

Return Value

DT_STANDARD if dragging the pane is indicated on the screen by a drag rectangle. DT_IMMEDIATE if the contents of the pane are dragged.

Remarks

The framework calls this method to determine the current docking mode of the pane.

If CBasePane::m_dockMode is undefined (DT_UNDEFINED), then the docking mode is taken from the global docking mode ( AFX_GLOBAL_DATA::m_dockModeGlobal).

By setting m_dockMode or overriding GetDockingMode you can control the docking mode for each pane.

Returns a pointer to the CDockingPanesRowobject where the pane is docked.

virtual CWnd* GetDockSiteFrameWnd() const;  

Return Value

A pointer to the dock site of the pane.

Remarks

Call this method to retrieve a pointer to the dock site of the pane. The dock site can be either a main frame window if the pane is docked to the main frame, or a mini-frame window if the pane is floating.

Returns the CBRS_ALIGN_ styles that are applied to the pane.

virtual DWORD GetEnabledAlignment() const;  

Return Value

A combination of CBRS_ALIGN_ styles. The following table shows the possible styles:

FlagEnabled alignment
CBRS_ALIGN_LEFTLeft.
CBRS_ALIGN_RIGHTRight.
CBRS_ALIGN_TOPTop.
CBRS_ALIGN_BOTTOMBottom.
CBRS_ALIGN_ANYCombination of all flags.

Remarks

Call this method to determine the enabled alignment for the pane. Enabled alignment means the sides of the main frame window that a pane can be docked to.

Enable docking alignment by using CBasePane::EnableDocking.

Returns the pane styles that are specific to MFC.

virtual DWORD GetMFCStyle() const;  

Return Value

A combination of library-specific (AFX_CBRS_) pane styles.

Returns a handle to the pane icon.

virtual HICON GetPaneIcon(BOOL bBigIcon);

Parameters

[in] bBigIcon
Specifies a 32 pixel by 32 pixel icon if TRUE; specifies a 16 pixel by 16 pixel icon if FALSE.

Return Value

A handle to the pane icon. If unsuccessful, returns NULL.

Remarks

The default implementation calls CWnd::GetIcon.

Returns a pointer to the CDockingPanesRowobject where the pane is docked.

CDockingPanesRow* GetPaneRow();

Return Value

A pointer to CDockingPanesRow if the pane is docked, or NULL if it is floating.

Remarks

Call this method to access the row where a pane is docked. For example, to arrange the panes in a particular row, call GetPaneRow and then call CDockingPanesRow::ArrangePanes.

Returns the pane style.

virtual DWORD GetPaneStyle() const;  

Return Value

A combination of control bar styles (including CBRS_ styles) that was set by the CBasePane::SetPaneStyle method at creation time.

Returns a pointer to the parent dock site.

virtual CDockSite* GetParentDockSite() const;  

Return Value

The parent dock site.

Returns a pointer to the parent mini-frame window.

virtual CPaneFrameWnd* GetParentMiniFrame(BOOL bNoAssert=FALSE) const;  

Parameters

[in] bNoAssert
If TRUE, this method does not check for non-valid pointers. If you call this method when your application exits, set this parameter to TRUE.

Return Value

A valid pointer to the parent mini-frame window if the pane is floating; otherwise NULL.

Remarks

Call this function to retrieve a pointer to the parent mini-frame window. This method iterates through all parents and checks for an object derived from CPaneFrameWnd Class.

Use GetParentMiniFrame to determine whether the pane is floating.

Returns a pointer to the parent tabbed pane.

CBaseTabbedPane* GetParentTabbedPane() const;  

Return Value

A pointer to the parent tabbed pane if it exists; otherwise NULL.

Returns a pointer to the parent window that is inside a tab.

CMFCBaseTabCtrl* GetParentTabWnd(HWND& hWndTab) const;  

Parameters

[out] hWndTab
If the return value is not NULL, this parameter contains the handle to the parent tabbed window.

Return Value

A valid pointer to the parent tabbed window or NULL.

Remarks

Use this function to retrieve a pointer to the parent tabbed window. Sometimes it is not enough to call GetParent, because a pane may be inside a docking wrapper ( CDockablePaneAdapter Class) or inside a pane adapter ( CDockablePaneAdapter Class). By using GetParentTabWnd you will be able to retrieve a valid pointer in those cases (assuming that the parent is a tabbed window).

The framework calls this method when a pane is restored from an archive.

virtual BOOL GetRecentVisibleState() const;  

Return Value

A BOOL that specifies the recent visible state. If TRUE, the pane was visible when serialized and should be visible when restored. If FALSE, the pane was hidden when serialized and should be hidden when restored.

Specifies whether the pane is hidden in print preview.

virtual BOOL HideInPrintPreviewMode() const;  

Return Value

TRUE if the pane is not shown in print preview; otherwise, FALSE.

Remarks

Base panes are not shown in print preview. Therefore, this method always returns TRUE.

Registers the specified pane with the docking manager.

BOOL InsertPane(
    CBasePane* pControlBar,  
    CBasePane* pTarget,  
    BOOL bAfter = TRUE);

Parameters

[in] pControlBar
A pointer to the pane to insert.

[in] pTarget
A pointer to the adjacent pane.

[in] bAfter
If TRUE, pControlBar is inserted after pTarget. If FALSE, pControlBar is inserted before pTarget.

Return Value

TRUE if the method succeeds, FALSE otherwise.

Specifies whether the pane supports Active Accessibility.

virtual BOOL IsAccessibilityCompatible();

Return Value

TRUE if the pane supports Active Accessibility; otherwise, FALSE.

Determines whether a pane is in auto-hide mode.

virtual BOOL IsAutoHideMode() const;  

Return Value

TRUE if the pane is in auto-hide mode; otherwise, FALSE.

Remarks

Base panes cannot auto-hide. This method always returns FALSE.

Specifies whether the pane is a dialog box control.

BOOL IsDialogControl() const;  

Return Value

TRUE if the pane is a dialog box control; otherwise, FALSE.

Remarks

The framework uses this method to ensure layout consistency for all panes.

Determines whether the pane is docked.

virtual BOOL IsDocked() const;  

Return Value

TRUE if the parent of the pane is not a mini-frame or if the pane is floating in a mini-frame with another pane; otherwise, FALSE.

Determines whether the pane is floating.

virtual BOOL IsFloating() const;  

Return Value

TRUE if the pane is floating; otherwise, FALSE.

Remarks

This method returns the opposite value of CBasePane::IsDocked.

Determines whether the pane is docked horizontally.

virtual BOOL IsHorizontal() const;  

Return Value

TRUE if the pane is docked horizontally; otherwise FALSE.

Remarks

The default implementation checks the current docking alignment for CBRS_ORIENT_HORZ.

Specifies whether the pane is in a multi-pane frame window ( CMultiPaneFrameWnd Class).

virtual BOOL IsInFloatingMultiPaneFrameWnd() const;  

Return Value

TRUE if the pane is in a multi-pane frame window; otherwise, FALSE.

Remarks

Only dockable panes can float in a multi-pane frame window. Therefore, CBasePane::IsInFloatingMultiPaneFrameWnd always returns FALSE.

Determines whether the pane has been added to an MDI child window as a tabbed document.

virtual BOOL IsMDITabbed() const;  

Return Value

TRUE if the pane was added to an MDI child window as a tabbed document; otherwise, FALSE.

Specifies whether the WS_VISIBLE flag is set for the pane.

BOOL IsPaneVisible() const;  

Return Value

TRUE if WS_VISIBLE is set; otherwise, FALSE.

Remarks

Use CBasePane::IsVisible to determine pane visibility.

Determines whether a specified point is near the dock site.

BOOL IsPointNearDockSite(
    CPoint point,  
    DWORD& dwBarAlignment,  
    BOOL& bOuterEdge) const;  

Parameters

[in] point
The specified point.

[out] dwBarAlignment
Specifies which edge the point is near. Possible values are CBRS_ALIGN_LEFT, CBRS_ALIGN_RIGHT, CBRS_ALIGN_TOP, and CBRS_ALIGN_BOTTOM

[out] bOuterEdge
TRUE if the point is near the outer border of the dock site; FALSE otherwise.

Return Value

TRUE if the point is near the dock site; otherwise FALSE.

Remarks

The point is near the dock site when it is within the sensitivity set in the docking manager. The default sensitivity is 15 pixels.

Determines whether the pane can be resized.

virtual BOOL IsResizable() const;  

Return Value

TRUE if the pane can be resized by the user; otherwise, FALSE.

Remarks

Panes of CDockablePane Class can be resized.

The status bar ( CMFCStatusBar Class) and the dock bar ( CDockSite Class) cannot be resized.

Determines whether the pane is restored from the registry.

virtual BOOL IsRestoredFromRegistry() const;  

Return Value

TRUE if the pane is restored from the registry; otherwise, FALSE.

Determines whether the pane has been inserted in the tab control of a tabbed window.

virtual BOOL IsTabbed() const;  

Return Value

TRUE if the control bar is inserted in a tab of a tabbed window; otherwise FALSE.

Remarks

This method retrieves a pointer to the immediate parent and determines if the parent's runtime class is CMFCBaseTabCtrl Class.

Determines whether the pane is visible.

virtual BOOL IsVisible() const;  

Return Value

TRUE if the pane is visible; otherwise FALSE.

Remarks

Use this method to determine the visibility of a pane. Do not use ::IsWindowVisible.

If the pane is not tabbed (see CBasePane::IsTabbed), this method checks for the WS_VISIBLE style. If the pane is tabbed, this method checks the visibility of the parent tabbed window. If the parent window is visible, the function checks the visibility of the pane tab using CMFCBaseTabCtrl::IsTabVisible.

Loads the pane's state from the registry.

virtual BOOL LoadState(
    LPCTSTR lpszProfileName=NULL,  
    int nIndex=-1,  
    UINT uiID=(UINT)-1);

Parameters

[in] lpszProfileName
Profile name.

[in] nIndex
Profile index.

[in] uiID
Pane ID.

Return Value

TRUE if the pane state was loaded successfully; otherwise FALSE.

Remarks

The framework calls this method to load the pane state from the registry. Override it in a derived class to load additional information saved by CBasePane::SaveState.

Moves the pane.

virtual HDWP MoveWindow(
    CRect& rect,  
    BOOL bRepaint = TRUE,  
    HDWP hdwp = NULL);

Parameters

[in] rect
A rectangle specifying the new location and size of the pane.

[in] bRepaint
If TRUE, the pane is repainted. If FALSE, the pane is not repainted.

[in] hdwp
Handle to a deferred window position structure.

Return Value

A handle to a deferred window position structure, or NULL.

Remarks

If you pass NULL as the hdwp parameter, this method moves the window normally. If you pass a handle, this method performs a deferred window move. You can obtain a handle by calling BeginDeferWindowPos or by storing the return value of a previous call to this method.

Called by the framework after the pane's parent changes.

virtual void OnAfterChangeParent(CWnd* pWndOldParent);

Parameters

[in] pWndOldParent
A pointer to the previous parent.

Remarks

The framework calls this method after the pane's parent changes, usually because of a docking or floating operation.

The default implementation does nothing.

Called by the framework just before the pane changes its parent window.

virtual void OnBeforeChangeParent(
    CWnd* pWndNewParent,  
    BOOL bDelay=FALSE);

Parameters

[in] pWndNewParent
A pointer to a new parent window.

[in] bDelay
Specifies whether layout adjustments must be delayed.

Remarks

The framework calls this method just before the pane's parent changes, usually because of a docking, floating, or auto-hide operation.

The default implementation does nothing.

The framework calls this method when the caption is drawn.

virtual void OnDrawCaption();

Remarks

This method has no functionality for the CBasePane class.

This method is currently not used.

virtual void OnMovePaneDivider(CPaneDivider*);

Parameters

[in] CPaneDivider*
Not used.

Called by the framework when it builds a menu that has a list of panes.

virtual void OnPaneContextMenu(
    CWnd* pParentFrame,  
    CPoint point);

Parameters

[in] pParentFrame
A pointer to the parent frame.

[in] point
Specifies the location of the shortcut menu.

Remarks

OnPaneContextMenu calls the docking manager, which maintains the list of panes that belong to the current frame window. This method adds the names of the panes to a shortcut menu and displays it. The commands on the menu show or hide individual panes.

Override this method to customize this behavior.

Called by the framework when a pane is removed from its parent mini frame window.

virtual void OnRemoveFromMiniFrame(CPaneFrameWnd* pMiniFrame);

Parameters

[in] pMiniFrame
A pointer to a mini-frame window from which the pane is removed.

Remarks

The framework calls this method when a pane is removed from its parent mini-frame window (as a result of docking, for example).

The default implementation does nothing.

CBasePane does not use this method.

virtual BOOL OnSetAccData(long lVal);

Parameters

[in] lVal
Not used.

Return Value

This method always returns TRUE.

Remarks

Returns the pane that contains the given point.

CBasePane* PaneFromPoint(
    CPoint point,  
    int nSensitivity,  
    bool bExactBar = false,  
    CRuntimeClass* pRTCBarType = NULL) const;  

Parameters

[in] point
Specifies the point, in screen coordinates, to check.

[in] nSensitivity
Increase the search area by this amount. A pane will satisfy the search criteria if the given point falls in the increased area.

[in] bExactBar
TRUE to ignore the nSensitivity parameter; otherwise, FALSE.

[in] pRTCBarType
If not NULL, the method searches only panes of the specified type.

Return Value

The CBasePane-derived object that contains the given point, or NULL if no pane was found.

CBasePane does not use this method.

virtual void RecalcLayout();

Unregisters a pane and removes it from the list in the docking manager.

void RemovePaneFromDockManager(
    CBasePane* pBar,  
    BOOL bDestroy = TRUE,  
    BOOL bAdjustLayout = FALSE,  
    BOOL bAutoHide = FALSE,  
    CBasePane* pBarReplacement = NULL);

Parameters

[in] pBar
A pointer to a pane to be removed.

[in] bDestroy
If TRUE, the removed pane is destroyed.

[in] bAdjustLayout
If TRUE, adjust the docking layout immediately.

[in] bAutoHide
If TRUE, the docking layout is related to the list of autohide bars. If FALSE, the docking layout is related to the list of regular panes.

[in] pBarReplacement
A pointer to a pane that replaces the removed pane.

Saves the pane's state to the registry.

virtual BOOL SaveState(
    LPCTSTR lpszProfileName=NULL,  
    int nIndex=-1,  
    UINT uiID=(UINT)-1);

Parameters

[in] lpszProfileName
Profile name.

[in] nIndex
Profile index.

[in] uiID
Pane ID.

Return Value

TRUE if the state was saved successfully; otherwise FALSE.

Remarks

The framework calls this method when it saves the pane's state to the registry. Override SaveState in a derived class to store additional information.

Selects the default font for a given device context.

CFont* SelectDefaultFont(CDC* pDC);

Parameters

[in] pDC
A device context.

Return Value

A pointer to the default CFont Class object.

Sets the control bar style.

virtual void SetControlBarStyle(DWORD dwNewStyle);

Parameters

[in] dwNewStyle
A bitwise-OR combination of the following possible values.

StyleDescription
AFX_CBRS_FLOATMakes the control bar float.
AFX_CBRS_AUTOHIDEEnables auto-hide mode.
AFX_CBRS_RESIZEEnables resizing of the control bar. When this flag is set, the control bar can be placed in a dockable pane.
AFX_CBRS_CLOSEEnables hiding of the control bar.

Sets the docking mode for the pane.

void SetDockingMode(AFX_DOCK_TYPE dockModeNew);

Parameters

[in] dockModeNew
Specifies the new docking mode for the pane.

Remarks

The framework supports two docking modes: standard and immediate.

In the standard docking mode, panes and mini-frame windows are moved around using a drag rectangle. In the immediate docking mode, control bars and mini-frame windows are moved immediately with their context.

Initially, the docking mode is defined globally by CDockingManager::m_dockModeGlobal. You can set the docking mode for each pane individually using the SetDockingMode method.

Sets the alignment for the pane.

virtual void SetPaneAlignment(DWORD dwAlignment);

Parameters

[in] dwAlignment
Specifies the new alignment.

Remarks

Usually, the framework calls this method when a pane is docked from one side of the main frame to another.

The following table shows the possible values for dwAlignment:

ValueAlignment
CBRS_ALIGN_LEFTLeft alignment.
CBRS_ALIGN_RIGHTRight alignment.
CBRS_ALIGN_TOPTop alignment.
CBRS_ALIGN_BOTTOMBottom alignment.

Sets the style of the pane.

virtual void SetPaneStyle(DWORD dwNewStyle);

Parameters

[in] dwNewStyle
Specifies the new style to set.

Remarks

This method can be used to set any of the CBRS_ styles that are defined in afxres.h. Because pane style and pane alignment are stored together, set the new style by combining it with the current alignment as follows.

pPane->SetPaneStyle (pPane->GetCurrentAlignment() | CBRS_TOOLTIPS);

Changes the size, position, and Z-order of a pane.

virtual HDWP SetWindowPos(
    const CWnd* pWndInsertAfter,  
    int x,  
    int y,  
    int cx,  
    int cy,  
    UINT nFlags,  
    HDWP hdwp = NULL);

Parameters

[in] pWndInsertAfter
Identifies the CWnd object that comes before this CWnd object in the Z-order. For more information, see CWnd::SetWindowPos.

[in] x
Specifies the position of the left side of the window.

[in] y
Specifies the position of the top of the window.

[in] cx
Specifies the width of the window.

[in] cy
Specifies the height of the window.

[in] nFlags
Specifies size and position options. For more information, see CWnd::SetWindowPos.

[in] hdwp
Handle to a structure that contains size and position information for one or more windows.

Return Value

A handle to an updated deferred window position structure, or NULL.

Remarks

If pWndInsertAfter is NULL, this method calls CWnd::SetWindowPos. If pWndInsertAfter is non- NULL, this method calls DeferWindowPos.

Shows or hides the pane.

virtual void ShowPane(
    BOOL bShow,  
    BOOL bDelay,  
    BOOL bActivate);

Parameters

[in] bShow
Specifies whether to show ( TRUE) or hide ( FALSE) a pane.

[in] bDelay
If TRUE, recalculating the docking layout is delayed.

[in] bActivate
If TRUE, the pane is active when shown.

Remarks

This method shows or hides a pane. Use this method instead of ShowWindow because this method notifies the relevant docking managers about changes in the pane's visibility.

Use CBasePane::IsVisible to determine the current visibility of a pane.

Stretches a pane vertically or horizontally.

virtual CSize StretchPane(
    int nLength,  
    BOOL bVert);

Parameters

[in] nLength
The length by which to stretch the pane.

[in] bVert
If TRUE, stretch the pane vertically. If FALSE, stretch the pane horizontally.

Return Value

The size of the stretched pane.

Removes the pane from the dock site, default slider, or mini-frame window where it is currently docked.

virtual void UndockPane(BOOL bDelay=FALSE);

Parameters

bDelay
If TRUE, the docking layout is not recalculated immediately.

Remarks

Call this method to manipulate the pane state or exclude the pane from the docking layout.

If you want to continue to use this pane, call either CBasePane::DockPane or CBasePane::FloatPane before calling this method.

Hierarchy Chart
Classes
CPane
CWnd Class

Show: