CDockingManager Class
Implements the core functionality that controls docking layout in a main frame window.
class CDockingManager : public CObject
Name | Description |
---|---|
CDockingManager::AddDockSite | Creates a dock pane and adds it to the list of control bars. |
CDockingManager::AddHiddenMDITabbedBar | Adds a handle to a bar pane to the list of hidden MDI tabbed bar panes. |
CDockingManager::AddMiniFrame | Adds a frame to the list of mini frames. |
CDockingManager::AddPane | Registers a pane with the docking manager. |
CDockingManager::AdjustDockingLayout | Recalculates and adjusts the layout of all panes in a frame window. |
CDockingManager::AdjustPaneFrames | Causes the WM_NCCALCSIZE message to be sent to all panes and CPaneFrameWnd windows. |
CDockingManager::AdjustRectToClientArea | Adjusts the alignment of a rectangle. |
CDockingManager::AlignAutoHidePane | Resizes a docking pane in autohide mode so that it takes the full width or height of the frame's client area surrounded by dock sites. |
CDockingManager::AutoHidePane | Creates an autohide toolbar. |
CDockingManager::BringBarsToTop | Brings the docked bars that have the specified alignment to the top. |
CDockingManager::BuildPanesMenu | Adds names of docking panes and toolbars to a menu. |
CDockingManager::CalcExpectedDockedRect | Calculates the expected rectangle of a docked window. |
CDockingManager::Create | Creates a docking manager. |
CDockingManager::DeterminePaneAndStatus | Determines the pane that contains a given point and its docking status. |
CDockingManager::DisableRestoreDockState | Enables or disables loading of docking layout from the registry. |
CDockingManager::DockPane | Docks a pane to another pane or to a frame window. |
CDockingManager::DockPaneLeftOf | Docks a pane to the left of another pane. |
CDockingManager::EnableAutoHidePanes | Enables docking of the pane to the main frame, creates a dock pane, and adds it to the list of control bars. |
CDockingManager::EnableDocking | Creates a dock pane and enables docking of the pane to the main frame. |
CDockingManager::EnableDockSiteMenu | Displays an additional button that opens a pop-up menu on the captions of all docking panes. |
CDockingManager::EnablePaneContextMenu | Tells the library to display a special context menu that has a list of application toolbars and docking panes when the user clicks the right mouse button and the library is processing the WM_CONTEXTMENU message. |
CDockingManager::FindDockSite | Retrieves the bar pane that is at the specified position and that has the specified alignment. |
CDockingManager::FindDockSiteByPane | Returns the bar pane that has the id of the target bar pane. |
CDockingManager::FindPaneByID | Finds a pane by the specified control ID. |
CDockingManager::FixupVirtualRects | Commits all current toolbar positions to virtual rectangles. |
CDockingManager::FrameFromPoint | Returns the frame that contains the given point. |
CDockingManager::GetClientAreaBounds | Gets the rectangle that contains the bounds of the client area. |
CDockingManager::GetDockingMode | Returns the current docking mode. |
CDockingManager::GetDockSiteFrameWnd | Gets a pointer to the parent window frame. |
CDockingManager::GetEnabledAutoHideAlignment | Returns the enabled alignment of the panes. |
CDockingManager::GetMiniFrames | Gets a list of miniframes. |
CDockingManager::GetOuterEdgeBounds | Gets a rectangle that contains the outer edges of the frame. |
CDockingManager::GetPaneList | Returns a list of panes that belong to the docking manager. This includes all floating panes. |
CDockingManager::GetSmartDockingManager | Retrieves a pointer to the smart docking manager. |
CDockingManager::GetSmartDockingManagerPermanent | Retrieves a pointer to the smart docking manager. |
CDockingManager::GetSmartDockingParams | Returns the smart docking parameters for the docking manager. |
CDockingManager::GetSmartDockingTheme | A static method that returns a theme used to display smart docking markers. |
CDockingManager::HideAutoHidePanes | Hides a pane that is in autohide mode. |
CDockingManager::InsertDockSite | Creates a dock pane and inserts it into the list of control bars. |
CDockingManager::InsertPane | Inserts a control pane into the list of control bars. |
CDockingManager::IsDockSiteMenu | Specifies whether a pop-up menu is displayed on the captions of all panes. |
CDockingManager::IsInAdjustLayout | Determines if the layouts of all panes are adjusted. |
CDockingManager::IsOLEContainerMode | Specifies whether the docking manager is in OLE container mode. |
CDockingManager::IsPointNearDockSite | Determines whether a specified point is near the dock site. |
CDockingManager::IsPrintPreviewValid | Determines if the print preview mode is set. |
CDockingManager::LoadState | Loads the docking manager's state from the registry. |
CDockingManager::LockUpdate | Locks the given window. |
CDockingManager::OnActivateFrame | Called by the framework when the frame window is made active or is deactivated. |
CDockingManager::OnClosePopupMenu | Called by the framework when an active pop-up menu processes a WM_DESTROY message. |
CDockingManager::OnMoveMiniFrame | Called by the framework to move a mini-frame window. |
CDockingManager::OnPaneContextMenu | Called by the framework when it builds a menu that has a list of panes. |
CDockingManager::PaneFromPoint | Returns the pane that contains the given point. |
CDockingManager::ProcessPaneContextMenuCommand | Called by the framework to select or to clear a check box for the specified command and recalculate the layout of a shown pane. |
CDockingManager::RecalcLayout | Recalculates the internal layout of the controls present in the list of controls. |
CDockingManager::ReleaseEmptyPaneContainers | Releases the empty pane containers. |
CDockingManager::RemoveHiddenMDITabbedBar | Removes the specified hidden bar pane. |
CDockingManager::RemoveMiniFrame | Removes a specified frame from the list of mini frames. |
CDockingManager::RemovePaneFromDockManager | Unregisters a pane and removes it from the list in the docking manager. |
CDockingManager::ReplacePane | Replaces one pane with another. |
CDockingManager::ResortMiniFramesForZOrder | Resorts the frames in the list of mini frames. |
CDockingManager::SaveState | Saves the docking manager's state to the registry. |
CDockingManager::SendMessageToMiniFrames | Sends the specified message to all mini frames. |
CDockingManager::Serialize | Writes the docking manager to an archive. (Overrides CObject::Serialize.) |
CDockingManager::SetAutohideZOrder | Sets the size, width, and height of the control bars and the specified pane. |
CDockingManager::SetDockingMode | Sets the docking mode. |
CDockingManager::SetDockState | Sets the docking state of the control bars, the mini frames, and the autohide bars. |
CDockingManager::SetPrintPreviewMode | Sets the print preview mode of the bars that are displayed in the print preview. |
CDockingManager::SetSmartDockingParams | Sets the parameters that define the behavior of smart docking. |
CDockingManager::ShowDelayShowMiniFrames | Shows or hides the windows of the mini frames. |
CDockingManager::ShowPanes | Shows or hides the panes of the control and autohide bars. |
CDockingManager::StartSDocking | Starts the smart docking of the specified window according to the alignment of the smart docking manager. |
CDockingManager::StopSDocking | Stops smart docking. |
Name | Description |
---|---|
CDockingManager::m_bHideDockingBarsInContainerMode | Specifies whether the docking manager hides panes in OLE container mode. |
CDockingManager::m_dockModeGlobal | Specifies the global docking mode. |
CDockingManager::m_nDockSensitivity | Specifies the docking sensitivity. |
CDockingManager::m_nTimeOutBeforeDockingBarDock | Specifies the time, in milliseconds, before a docking pane is docked in immediate docking mode. |
CDockingManager::m_nTimeOutBeforeToolBarDock | Specifies the time, in milliseconds, before a toolbar is docked to the main frame window. |
The main frame window creates and initializes this class automatically.
The docking manager object holds a list of all panes that are in the docking layout, and also a list of all CPaneFrameWnd windows that belong to the main frame window.
The CDockingManager
class implements some services that you can use to find a pane or a CPaneFrameWnd
window. You usually do not call these services directly because they are wrapped in the main frame window object. For more information, see CPaneFrameWnd Class.
The following tips apply to CDockingManager
objects:
CDockingManager Class supports these docking modes:
AFX_DOCK_TYPE::DT_IMMEDIATE
AFX_DOCK_TYPE::DT_STANDARD
AFX_DOCK_TYPE::DT_SMART
These docking modes are defined by CDockingManager::m_dockModeGlobal and are set by calling CDockingManager::SetDockingMode.
If you want to create a non-floating, non-resizable pane, call the CDockingManager::AddPane method. This method registers the pane with the docking manager, which is responsible for the layout of the pane.
The following example demonstrates how to use various methods in the CDockingManager
class to configure a CDockingManager
object. The example shows how to display an additional button that opens a pop-up menu on the captions of all docking panes and how to set the docking mode of the object. This code snippet is part of the Visual Studio Demo sample.
CDockingManager *pDockManager = GetDockingManager();
ASSERT_VALID(pDockManager);
pDockManager->AdjustPaneFrames();
pDockManager->EnableDockSiteMenu();
pDockManager->SetDockingMode(DT_STANDARD);
Header: afxDockingManager.h
Creates a dock pane and adds it to the list of control bars.
BOOL AddDockSite(
const AFX_DOCKSITE_INFO& info,
CDockSite** ppDockBar = NULL);
info
[in] A reference to an info structure that contains dock pane alignment.
ppDockBar
[out] A pointer to a pointer to the new dock pane.
TRUE if the dock pane was created successfully; FALSE otherwise.
Adds a handle to a bar pane to the list of hidden MDI tabbed bar panes.
void AddHiddenMDITabbedBar(CDockablePane* pBar);
pBar
[in] A pointer to a bar pane
Registers a pane with the docking manager.
BOOL AddPane(
CBasePane* pWnd,
BOOL bTail = TRUE,
BOOL bAutoHide = FALSE,
BOOL bInsertForOuterEdge = FALSE);
pWnd
[in, out] Specifies the pane to add to the docking manager.
bTail
[in] TRUE to add the pane to the end of the list of panes for the docking manager; otherwise, FALSE.
bAutoHide
[in] For internal use only. Always use the default value FALSE.
bInsertForOuterEdge
[in] For internal use only. Always use the default value FALSE.
TRUE if the pane was successfully registered with the docking manager; otherwise, FALSE.
Call this method to register non-floating, non-resizable panes with the docking manager. If you do not register the panes, they will not appear correctly when the docking manager is laid out.
Recalculates and adjusts the layout of all panes in a frame window.
virtual void AdjustDockingLayout(HDWP hdwp = NULL);
hdwp
[in] Specifies the deferred window position structure. For more information, see Windows Data Types.
Adds a frame to the list of mini frames.
virtual BOOL AddMiniFrame(CPaneFrameWnd* pWnd);
pWnd
[in] A pointer to a frame.
TRUE if the frame is not in the list of mini frames and was added successfully; FALSE otherwise.
Causes the WM_NCCALCSIZE message to be sent to all panes and CPaneFrameWnd
windows.
virtual void AdjustPaneFrames();
Adjusts the alignment of a rectangle.
virtual BOOL AdjustRectToClientArea(
CRect& rectResult,
DWORD dwAlignment);
rectResult
[in] A reference to a CRect
object
dwAlignment
[in] The alignment of the CRect
object
TRUE if the alignment of the CRect
object was adjusted; FALSE otherwise.
The dwAlignment parameter can have one of the following values:
CBRS_ALIGN_TOP
CBRS_ALIGN_BOTTOM
CBRS_ALIGN_LEFT
CBRS_ALIGN_RIGHT
Resizes a docking pane in autohide mode so that it takes the full width or height of the frame's client area surrounded by dock sites.
void AlignAutoHidePane(
CPaneDivider* pDefaultSlider,
BOOL bIsVisible = TRUE);
pDefaultSlider
[in] The docking slider pane.
bIsVisible
[in] TRUE if the docking pane is visible; FALSE otherwise.
Creates an autohide toolbar.
CMFCAutoHideToolBar* AutoHidePane(
CDockablePane* pBar,
CMFCAutoHideToolBar* pCurrAutoHideToolBar = NULL);
pBar
[in] A pointer to the bar pane.
pCurrAutoHideToolBar
[in] A pointer to an auto hide toolbar.
NULL if the auto hide toolbar was not created; otherwise a pointer to the new toolbar.
Brings the docked bars that have the specified alignment to the top.
void BringBarsToTop(
DWORD dwAlignment = 0,
BOOL bExcludeDockedBars = TRUE);
dwAlignment
[in] The alignment of the dock bars that are brought to the top of other windows.
bExcludeDockedBars
[in] TRUE to exclude the docked bars from being on top; otherwise FALSE.
Adds names of docking panes and toolbars to a menu.
void BuildPanesMenu(
CMenu& menu,
BOOL bToolbarsOnly);
menu
[in] A menu to add the names of docking panes and toolbars to.
bToolbarsOnly
[in] TRUE to add only toolbar names to the menu; FALSE otherwise.
Calculates the expected rectangle of a docked window.
void CalcExpectedDockedRect(
CWnd* pWnd,
CPoint ptMouse,
CRect& rectResult,
BOOL& bDrawTab,
CDockablePane** ppTargetBar);
pWnd
[in] A pointer to the window to dock.
ptMouse
[in] The mouse location.
rectResult
[out] The calculated rectangle.
bDrawTab
[in] TRUE to draw a tab; otherwise FALSE.
ppTargetBar
[out] A pointer to a pointer to the target pane.
This method calculates the rectangle that a window would occupy if a user dragged the window to the point specified by ptMouse and docked it there.
Creates a docking manager.
BOOL Create(CFrameWnd* pParentWnd);
pParentWnd
[in] A pointer to the parent frame of the docking manager. This value must not be NULL.
TRUE always.
Determines the pane that contains a given point and its docking status.
virtual AFX_CS_STATUS DeterminePaneAndStatus(
CPoint pt,
int nSensitivity,
DWORD dwEnabledAlignment,
CBasePane** ppTargetBar,
const CBasePane* pBarToIgnore,
const CBasePane* pBarToDock);
pt
[in] The location of the pane to check.
nSensitivity
[in] The value to increase the window rectangle of each checked pane. A pane satisfies the search criteria if the given point is in this increased region.
dwEnabledAlignment
[in] The alignment of the docking pane.
ppTargetBar
[out] A pointer to a pointer to the target pane.
pBarToIgnore
[in] The pane that the method ignores.
pBarToDock
[in] The pane that is docked.
The docking status.
The docking status can be one of the following values:
AFX_CS_STATUS value | Meaning |
---|---|
CS_NOTHING | The pointer is not over a dock site. Therefore, keep the pane floating. |
CS_DOCK_IMMEDIATELY | The pointer is over the dock site in the immediate mode (DT_IMMEDIATE style is enabled), so the pane must be docked immediately. |
CS_DELAY_DOCK | The pointer is over a dock site that is another docking pane or is an edge of the main frame. |
CS_DELAY_DOCK_TO_TAB | The pointer is over a dock site that causes the pane to be docked in a tabbed window. This occurs when the mouse is over a caption of another docking pane or over a tab area of a tabbed pane. |
Enables or disables loading of docking layout from the registry.
void DisableRestoreDockState(BOOL bDisable = TRUE);
bDisable
[in] TRUE to disable loading of docking layout from the registry; otherwise, FALSE.
Call this method when you must preserve the current layout of docking panes and toolbars when the application state is loading.
Docks a pane to another pane or to a frame window.
void DockPane(
CBasePane* pBar,
UINT nDockBarID = 0,
LPCRECT lpRect = NULL);
pBar
[in] A pointer to a bar pane to dock to.
nDockBarID
[in] The id of the bar to dock.
lpRect
[in] The destination rectangle.
Docks a pane to the left of another pane.
BOOL DockPaneLeftOf(
CPane* pBarToDock,
CPane* pTargetBar);
pBarToDock
[in] A pointer to the pane to be docked to the left of pTargetBar.
pTargetBar
[in] A pointer to the target pane.
TRUE if the pane was docked successfully; otherwise, FALSE.
Enables docking of the pane to the main frame, creates a dock pane, and adds it to the list of control bars.
BOOL EnableAutoHidePanes(DWORD dwStyle);
dwStyle
[in] The docking alignment.
TRUE if the dock pane was created successfully; FALSE otherwise.
Creates a dock pane and enables docking of the pane to the main frame.
BOOL EnableDocking(DWORD dwStyle);
dwStyle
[in] The docking alignment.
TRUE if the dock pane was created successfully; FALSE otherwise.
Displays an additional button that opens a pop-up menu on the captions of all docking panes.
static void EnableDockSiteMenu(BOOL bEnable = TRUE);
bEnable
[in] TRUE to enable the dock site menu; otherwise, FALSE.
The dock site menu displays the following options for changing the docking state of the pane:
Floating
- Floats a paneDocking
- Docks a pane at the main frame at the location where the pane was last dockedAutoHide
- Switches the pane to autohide modeHide
- Hides a pane
By default, this menu is not displayed.
Tells the library to display a special context menu that has a list of application toolbars and docking panes when the user clicks the right mouse button and the library is processing the WM_CONTEXTMENU message.
void EnablePaneContextMenu(
BOOL bEnable,
UINT uiCustomizeCmd,
const CString& strCustomizeText,
BOOL bToolbarsOnly = FALSE);
bEnable
[in] If TRUE, the library turns on the support for automatic context menu; if FALSE the library turns off the support for automatic context menu.
uiCustomizeCmd
[in] A command id for the Customize item in the menu.
strCustomizeText
[in] The text of the Customize item.
bToolbarsOnly
[in] If TRUE, the menu displays only a list of application toolbars; if FALSE, the library adds application docking panes to this list.
Retrieves the bar pane that is at the specified position and that has the specified alignment.
virtual CDockSite* FindDockSite(
DWORD dwAlignment,
BOOL bOuter);
dwAlignment
[in] The alignment of the bar pane.
bOuter
[in] If TRUE, retrieve the bar in the head position in the list of control bars. Otherwise, retrieve the bar in the tail position in the list of control bars.
The docking pane that has the specified alignment; NULL otherwise.
Finds a pane by the specified control ID.
virtual CBasePane* FindPaneByID(
UINT uBarID,
BOOL bSearchMiniFrames = FALSE);
uBarID
[in] Specifies the control ID of the pane to find.
bSearchMiniFrames
[in] TRUE to include all floating panes in the search. FALSE to include only the docked panes.
The CBasePane object that has the specified control ID, or NULL if the specified pane cannot be found.
Returns the bar pane that has the id of the target bar pane.
virtual CDockSite* FindDockSiteByPane(CPane* pTargetBar);
pTargetBar
[in] A pointer to the target bar pane.
The bar pane that has the id of the target bar pane; NULL if no such bar pane exists.
Commits all current toolbar positions to virtual rectangles.
virtual void FixupVirtualRects();
When the user starts to drag a toolbar, the application remembers its original position in the virtual rectangle. When the user moves a toolbar across its dock site, the toolbar may shift other toolbars. The original positions of the other toolbars are stored in the corresponding virtual rectangles.
Returns the frame that contains the given point.
virtual CPaneFrameWnd* FrameFromPoint(
CPoint pt,
CPaneFrameWnd* pFrameToExclude,
BOOL bFloatMultiOnly) const;
pt
[in] Specifies the point, in screen coordinates, to check.
pFrameToExclude
[in] A pointer to a frame to exclude.
bFloatMultiOnly
[in] TRUE to exclude frames that are not instances of CMultiPaneFrameWnd
; FALSE otherwise.
The frame that contains the given point; NULL otherwise.
Gets the rectangle that contains the bounds of the client area.
CRect GetClientAreaBounds() const;
void GetClientAreaBounds(CRect& rcClient);
rcClient
[out] A reference to the rectangle that contains the bounds of the client area.
The rectangle that contains the bounds of the client area.
Returns the current docking mode.
static AFX_DOCK_TYPE GetDockingMode();
An enumerator value that represents the current docking mode. It can be one of the following values:
DT_STANDARD
DT_IMMEDIATE
DT_SMART
To set the docking mode, call CDockingManager::SetDockingMode.
Gets a pointer to the parent window frame.
CFrameWnd* GetDockSiteFrameWnd() const;
A pointer to the parent window frame.
Returns the enabled alignment of the panes.
DWORD GetEnabledAutoHideAlignment() const;
A bitwise combination of CBRS_ALIGN_ flags, or 0 if autohide panes are not enabled. For more information, see CFrameWnd::EnableDocking.
The method returns the enabled alignment for autohide control bars. To enable autohide bars, call CFrameWndEx::EnableAutoHidePanes.
Gets a list of miniframes.
const CObList& GetMiniFrames() const;
A list of miniframes that contain the control bars that belong to the docking manager.
Gets a rectangle that contains the outer edges of the frame.
CRect GetOuterEdgeBounds() const;
A rectangle that contains the outer edges of the frame.
Returns a list of panes that belong to the docking manager. This includes all floating panes.
void GetPaneList(
CObList& lstBars,
BOOL bIncludeAutohide = FALSE,
CRuntimeClass* pRTCFilter = NULL,
BOOL bIncludeTabs = FALSE);
lstBars
[in, out] Contains all the panes of the current docking manager.
bIncludeAutohide
[in] TRUE to include the panes that are in autohide mode; otherwise, FALSE.
pRTCFilter
[in] If not NULL, the returned list contains panes only of the specified runtime class.
bIncludeTabs
[in] TRUE to include tabs; otherwise, FALSE.
If there are any tabbed panes in the docking manager, the method returns pointers to CBaseTabbedPane Class objects and you must enumerate the tabs explicitly.
Use pRTCFilter to obtain a particular class of panes. For example, you can obtain only toolbars by setting this value appropriately.
Retrieves a pointer to the smart docking manager.
CSmartDockingManager* GetSmartDockingManager();
A pointer to the smart docking manager.
Retrieves a pointer to the smart docking manager.
CSmartDockingManager* GetSmartDockingManagerPermanent() const;
A pointer to the smart docking manager.
Returns the smart docking parameters for the docking manager.
static CSmartDockingInfo& GetSmartDockingParams();
The class that contains the smart docking parameters for the current docking manager. For more information, see CSmartDockingInfo Class.
Hides a pane that is in autohide mode.
void HideAutoHidePanes(
CDockablePane* pBarToExclude = NULL,
BOOL bImmediately = FALSE);
pBarToExclude
[in] A pointer to a bar to exclude from hiding.
bImmediately
[in] TRUE to hide the pane immediately; FALSE to hide the pane with the autohide effect.
Creates a dock pane and inserts it into the list of control bars.
BOOL InsertDockSite(
const AFX_DOCKSITE_INFO& info,
DWORD dwAlignToInsertAfter,
CDockSite** ppDockBar = NULL);
info
[in] A structure that contains the alignment information about the dock pane.
dwAlignToInsertAfter
[in] Alignment of the dock pane.
ppDockBar
[out] A pointer to a pointer to a dock pane.
TRUE if the dock pane was created successfully; FALSE otherwise.
Inserts a control pane into the list of control bars.
BOOL InsertPane(
CBasePane* pControlBar,
CBasePane* pTarget,
BOOL bAfter = TRUE);
pControlBar
[in] A pointer to a control pane.
pTarget
[in] A pointer to a target pane.
bAfter
[in] TRUE to insert the pane after the position of the target pane; FALSE otherwise.
TRUE if the control pane is successfully added to the list of control bars; FALSE otherwise.
This method returns false if the control pane is already in the list of control bars or if the target pane does not exist in the list of control bars.
Specifies whether a pop-up menu is displayed on the captions of all panes.
static BOOL IsDockSiteMenu();
TRUE if a dock site menu is displayed on the captions of all docking panes; otherwise FALSE.
You can enable the dock site menu by calling CDockingManager::EnableDockSiteMenu.
Determines if the layouts of all panes are adjusted.
BOOL IsInAdjustLayout() const;
TRUE if the layouts of all panes are adjusted; FALSE otherwise.
Specifies whether the docking manager is in OLE container mode.
BOOL IsOLEContainerMode() const;
TRUE if the docking manager is in OLE container mode; otherwise, FALSE.
In OLE container mode, all docking panes and application toolbars are hidden. The panes are also hidden in this mode if you have set CDockingManager::m_bHideDockingBarsInContainerMode to TRUE.
Determines whether a specified point is near the dock site.
BOOL IsPointNearDockSite(
CPoint point,
DWORD& dwBarAlignment,
BOOL& bOuterEdge) const;
point
[in] The specified point.
dwBarAlignment
[out] Specifies which edge the point is near. Possible values are CBRS_ALIGN_LEFT, CBRS_ALIGN_RIGHT, CBRS_ALIGN_TOP, and CBRS_ALIGN_BOTTOM.
bOuterEdge
[out] TRUE if the point is near the outer border of the dock site; FALSE otherwise.
TRUE if the point is near the dock site; otherwise FALSE.
Determines if the print preview mode is set.
BOOL IsPrintPreviewValid() const;
TRUE if the print preview mode is set; FALSE otherwise.
Loads the docking manager's state from the registry.
virtual BOOL LoadState(
LPCTSTR lpszProfileName = NULL,
UINT uiID = (UINT) -1);
lpszProfileName
[in] Profile name.
uiID
[in] The id of the docking manager.
TRUE if the docking manager state was loaded successfully; otherwise FALSE.
Locks the given window.
void LockUpdate(BOOL bLock);
bLock
[in] TRUE if the window is locked; FALSE otherwise.
When a window is locked, it cannot be moved and it cannot be redrawn.
Specifies whether the docking manager hides panes in OLE container mode.
AFX_IMPORT_DATA static BOOL m_bHideDockingBarsInContainerMode;
Set this value to FALSE if you want to keep all panes docked to the main frame visible when the application is in OLE container mode. By default, this value is TRUE.
Specifies the global docking mode.
AFX_IMPORT_DATA static AFX_DOCK_TYPE m_dockModeGlobal;
By default, each docking pane uses this docking mode. For more information about the values that this field can be set to, see CBasePane::GetDockingMode.
Specifies the docking sensitivity.
AFX_IMPORT_DATA static int m_nDockSensitivity;
The docking sensitivity defines how close a floating pane can approach a docking pane, docking site, or another pane before the framework changes its state to docked.
Specifies the time, in milliseconds, before a docking pane is docked in immediate docking mode.
static UINT m_nTimeOutBeforeDockingBarDock;
Before a pane is docked, the framework waits the specified length of time. This prevents the pane from being accidentally docked to a location while the user is still dragging it.
Specifies the time, in milliseconds, before a toolbar is docked to the main frame window.
static UINT m_nTimeOutBeforeToolBarDock;
Before a toolbar is docked, the framework waits the specified length of time. This prevents the toolbar from being accidentally docked to a location while the user is still dragging it.
Called by the framework when the frame window is made active or is deactivated.
virtual void OnActivateFrame(BOOL bActivate);
bActivate
[in] If TRUE, the frame window is made active; if FALSE, the frame window is deactivated.
Called by the framework when an active pop-up menu processes a WM_DESTROY message.
void OnClosePopupMenu();
The framework sends a WM_DESTROY message when it is about to close the current main window. Override this method to handle notifications from CMFCPopupMenu
objects that belong to the frame window when a CMFCPopupMenu
object processes a WM_DESTROY message.
Called by the framework to move a mini-frame window.
virtual BOOL OnMoveMiniFrame(CWnd* pFrame);
pFrame
[in] A pointer to a mini-frame window.
TRUE if the method succeeds; otherwise FALSE.
Called by the framework when it builds a menu that has a list of panes.
void OnPaneContextMenu(CPoint point);
point
[in] Specifies the location of the menu.
Returns the pane that contains the given point.
virtual CBasePane* PaneFromPoint(
CPoint point,
int nSensitivity,
bool bExactBar = false,
CRuntimeClass* pRTCBarType = NULL,
BOOL bCheckVisibility = FALSE,
const CBasePane* pBarToIgnore = NULL) const;
virtual CBasePane* PaneFromPoint(
CPoint point,
int nSensitivity,
DWORD& dwAlignment,
CRuntimeClass* pRTCBarType = NULL,
const CBasePane* pBarToIgnore = NULL) const;
point
[in] Specifies the point, in screen coordinates, to check.
nSensitivity
[in] The value to inflate the window rectangle of each checked pane. A pane satisfies the search criteria if the given point is in this inflated region.
bExactBar
[in] TRUE to ignore the nSensitivity parameter; otherwise, FALSE.
pRTCBarType
[in] If not NULL, the method searches only the panes of the specified type.
bCheckVisibility
[in] TRUE to check only visible panes; otherwise, FALSE.
dwAlignment
[out] If a pane is found at the specified point, this parameter contains the side of the pane that was closest to the specified point. For more information, see the Remarks section.
pBarToIgnore
[in] If not NULL, the method ignores panes specified by this parameter.
The CBasePane-derived object that contains the given point, or NULL if no pane was found.
When the function returns and a pane was found, dwAlignment contains the alignment of the specified point. For example, if the point was closest to the top of the pane, dwAlignment is set to CBRS_ALIGN_TOP.
Called by the framework to select or to clear a check box for the specified command and recalculate the layout of a shown pane.
BOOL ProcessPaneContextMenuCommand(
UINT nID,
int nCode,
void* pExtra,
AFX_CMDHANDLERINFO* pHandlerInfo);
nID
[in] The id of a control bar in the menu.
nCode
[in] The command notification code.
pExtra
[in] A pointer to void that is casted to a pointer to CCmdUI
if nCode is CN_UPDATE_COMMAND_UI.
pHandlerInfo
[in] A pointer to an info structure. This parameter is not used.
TRUE if pEXtra is not NULL and nCode equals CN_UPDATE_COMMAND_UI, or if there is a control bar with the specified nID.
Recalculates the internal layout of the controls present in the list of controls.
virtual void RecalcLayout(BOOL bNotify = TRUE);
bNotify
[in] This parameter is not used.
Releases the empty pane containers.
void ReleaseEmptyPaneContainers();
Removes the specified hidden bar pane.
void RemoveHiddenMDITabbedBar(CDockablePane* pBar);
pBar
[in] A pointer to a bar pane to remove.
Removes a specified frame from the list of mini frames.
virtual BOOL RemoveMiniFrame(CPaneFrameWnd* pWnd);
pWnd
[in] A pointer to a frame to remove.
TRUE if the specified frame is removed; FALSE otherwise.
Unregisters a pane and removes it from the list in the docking manager.
void RemovePaneFromDockManager(
CBasePane* pWnd,
BOOL bDestroy,
BOOL bAdjustLayout,
BOOL bAutoHide = FALSE,
CBasePane* pBarReplacement = NULL);
pWnd
[in] A pointer to a pane to be removed.
bDestroy
[in] If TRUE, the removed pane is destroyed.
bAdjustLayout
[in] If TRUE, adjust the docking layout immediately.
bAutoHide
[in] If TRUE, the pane is removed from the list of autohide bars. If FALSE, the pane is removed from the list of regular panes.
pBarReplacement
[in] A pointer to a pane that replaces the removed pane.
Replaces one pane with another.
BOOL ReplacePane(
CDockablePane* pOriginalBar,
CDockablePane* pNewBar);
pOriginalBar
[in] A pointer to the original pane.
pNewBar
[in] A pointer to the pane that replaces the original pane.
TRUE if the pane is successfully replaced; FALSE otherwise.
Resorts the frames in the list of mini frames.
void ResortMiniFramesForZOrder();
Saves the docking manager's state to the registry.
virtual BOOL SaveState(
LPCTSTR lpszProfileName = NULL,
UINT uiID = (UINT) -1);
lpszProfileName
[in] A path to a registry key.
uiID
[in] The docking manager ID.
TRUE if the state was saved successfully; otherwise FALSE.
Saving the docking manager's state to the registry involves saving the states of the control bars, the states of the autohide bars, and the states of the mini frames present in the docking manager.
Sends the specified message to all mini frames.
BOOL SendMessageToMiniFrames(
UINT uMessage,
WPARAM wParam = 0,
LPARAM lParam = 0);
uMessage
[in] The message to be sent.
wParam
[in] Additional message dependent information.
lParam
[in] Additional message dependent information.
TRUE always.
Writes the docking manager to an archive.
void Serialize(CArchive& ar);
ar
[in] A reference to an archive object.
Writing the docking manager to an archive involves determining the number of docking control bars and sliders, and writing the control bars, the mini frames, the autohide bars, and the MDI tabbed bars to the archive.
Sets the size, width, and height of the control bars and the specified pane.
void SetAutohideZOrder(CDockablePane* pAHDockingBar);
pAHDockingBar
[in] A pointer to a dockable pane.
Sets the docking mode.
static void SetDockingMode(
AFX_DOCK_TYPE dockMode,
AFX_SMARTDOCK_THEME theme = AFX_SDT_DEFAULT);
dockMode
Specifies the new docking mode. For more information, see the Remarks section.
theme
Specifies the theme to be used for smart docking markers. It can be one of the following enumerated values: AFX_SDT_DEFAULT, AFX_SDT_VS2005, AFX_SDT_VS2008.
Call this static method to set the docking mode.
dockMode can be one of following values:
DT_STANDARD - Standard docking mode as implemented in Visual Studio .NET 2003. Panes are dragged without a dragging context.
DT_IMMEDIATE - Immediate docking mode as implemented in Microsoft Visio. Panes are dragged with a dragging context, but no markers are displayed.
DT_SMART - Smart docking mode as implemented in Visual Studio 2005. Panes are dragged with a dragging context and smart markers are displayed that show where the pane can be docked.
Sets the docking state of the control bars, the mini frames, and the autohide bars.
virtual void SetDockState();
Sets the print preview mode of the bars that are displayed in the print preview.
void SetPrintPreviewMode(
BOOL bPreview,
CPrintPreviewState* pState);
bPreview
[in] TRUE if print preview mode is set; FALSE otherwise.
pState
[in] A pointer to a preview state. This parameter is not used.
Sets the parameters that define the behavior of smart docking.
static void SetSmartDockingParams(CSmartDockingInfo& params);
params
[in, out] Defines the parameters for smart docking.
Call this method if you want to customize the appearance, color, or shape of the smart docking markers.
To use the default look for smart docking markers, pass an uninitialized instance of CSmartDockingInfo Class to params.
Shows or hides the windows of the mini frames.
void ShowDelayShowMiniFrames(BOOL bshow);
bShow
[in] TRUE to make the window of the shown frame active; FALSE to hide the window of the frame.
Shows or hides the panes of the control and autohide bars.
virtual BOOL ShowPanes(BOOL bShow);
bShow
[in] TRUE to show the panes; FALSE to hide the panes.
Always FALSE.
Starts the smart docking of the specified window according to the alignment of the smart docking manager.
void StartSDocking(CWnd* pDockingWnd);
pDockingWnd
[in] A pointer to a window to dock.
Stops smart docking.
void StopSDocking();
A static method that returns a theme used to display smart docking markers.
static AFX_SMARTDOCK_THEME __stdcall GetSmartDockingTheme();
Returns one of the following enumerated values: AFX_SDT_DEFAULT, AFX_SDT_VS2005, AFX_SDT_VS2008.
Hierarchy Chart
Classes
CObject Class
CFrameWndEx Class
CDockablePane Class
CPaneFrameWnd Class