CPaneFrameWnd Class
For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
Implements a mini-frame window that contains one pane. The pane fills the client area of the window.
class CPaneFrameWnd : public CWnd
Name | Description |
---|---|
CPaneFrameWnd::AddPane | Adds a pane. |
CPaneFrameWnd::AddRemovePaneFromGlobalList | Adds or removes a pane from the global list. |
CPaneFrameWnd::AdjustLayout | Adjusts the layout of the mini-frame window. |
CPaneFrameWnd::AdjustPaneFrames | |
CPaneFrameWnd::CalcBorderSize | Calculates the size of the borders for a mini-frame window. |
CPaneFrameWnd::CalcExpectedDockedRect | Calculate the expected rectangle of a docked window. |
CPaneFrameWnd::CanBeAttached | Determines whether the current pane can be docked to another pane or frame window. |
CPaneFrameWnd::CanBeDockedToPane | Determines whether the mini-frame window can be docked to a pane. |
CPaneFrameWnd::CheckGripperVisibility | |
CPaneFrameWnd::ConvertToTabbedDocument | Converts the pane to a tabbed document. |
CPaneFrameWnd::Create | Creates a mini-frame window and attaches it to the CPaneFrameWnd object. |
CPaneFrameWnd::CreateEx | Creates a mini-frame window and attaches it to the CPaneFrameWnd object. |
CPaneFrameWnd::DockPane | Docks the pane. |
CPaneFrameWnd::FindFloatingPaneByID | Finds a pane with the specified control ID in the global list of floating panes. |
CPaneFrameWnd::FrameFromPoint | Finds the mini-frame window containing a user-supplied point. |
CPaneFrameWnd::GetCaptionHeight | Returns the height of the mini-frame window caption. |
CPaneFrameWnd::GetCaptionRect | Calculates the bounding rectangle of a mini-frame window caption. |
CPaneFrameWnd::GetCaptionText | Returns the caption text. |
CPaneFrameWnd::GetDockingManager | |
CPaneFrameWnd::GetDockingMode | Returns the docking mode. |
CPaneFrameWnd::GetFirstVisiblePane | Returns the first visible pane that is contained in a mini-frame window. |
CPaneFrameWnd::GetHotPoint | |
CPaneFrameWnd::GetPane | Returns a pane that is contained in the mini-frame window. |
CPaneFrameWnd::GetPaneCount | Returns the number of panes that are contained in a mini-frame window. |
CPaneFrameWnd::GetParent | |
CPaneFrameWnd::GetPinState | |
CPaneFrameWnd::GetRecentFloatingRect | |
CPaneFrameWnd::GetVisiblePaneCount | Returns the number of visible panes that are contained in a mini-frame window. |
CPaneFrameWnd::HitTest | Determines what part of a mini-frame window is at a given point. |
CPaneFrameWnd::IsCaptured | |
CPaneFrameWnd::IsDelayShow | |
CPaneFrameWnd::IsRollDown | Determines whether a mini-frame window should be rolled down. |
CPaneFrameWnd::IsRollUp | Determines whether a mini-frame window should be rolled up. |
CPaneFrameWnd::KillDockingTimer | Stops the docking timer. |
CPaneFrameWnd::LoadState | Loads the pane's state from the registry. |
CPaneFrameWnd::OnBeforeDock | Determines if docking is possible. |
CPaneFrameWnd::OnDockToRecentPos | Docks the mini-frame window at its most recent position. |
CPaneFrameWnd::OnKillRollUpTimer | Stops the rollup timer. |
CPaneFrameWnd::OnMovePane | Moves the mini-frame window by a specified offset. |
CPaneFrameWnd::OnPaneRecalcLayout | Adjusts the layout of a contained pane. |
CPaneFrameWnd::OnSetRollUpTimer | Sets the rollup timer. |
CPaneFrameWnd::OnShowPane | Called by the framework when a pane in the mini-frame window is hidden or displayed. |
CPaneFrameWnd::PaneFromPoint | Returns a pane if it contains a user-supplied point inside a mini-frame window. |
CPaneFrameWnd::Pin | |
CPaneFrameWnd::PreTranslateMessage |
Used by class CWinApp to translate window messages before they are dispatched to the TranslateMessage and DispatchMessage Windows functions. |
CPaneFrameWnd::RedrawAll | Redraws all mini-frame windows. |
CPaneFrameWnd::RemoveNonValidPanes | Called by the framework to remove non-valid panes. |
CPaneFrameWnd::RemovePane | Removes a pane from the mini-frame window. |
CPaneFrameWnd::ReplacePane | Replaces one pane with another. |
CPaneFrameWnd::SaveState | Saves the pane's state to the registry. |
CPaneFrameWnd::Serialize |
Reads or writes this object from or to an archive. |
CPaneFrameWnd::SetCaptionButtons | Sets caption buttons. |
CPaneFrameWnd::SetDelayShow | |
CPaneFrameWnd::SetDockingManager | |
CPaneFrameWnd::SetDockingTimer | Sets the docking timer. |
CPaneFrameWnd::SetDockState | Sets the docking state. |
CPaneFrameWnd::SetHotPoint | |
CPaneFrameWnd::SetPreDockState | Called by the framework to set the predocking state. |
CPaneFrameWnd::SizeToContent | Adjusts the size of a mini-frame window so that it is equivalent in size to a contained pane. |
CPaneFrameWnd::StartTearOff | Tears off a menu. |
CPaneFrameWnd::StoreRecentDockSiteInfo | |
CPaneFrameWnd::StoreRecentTabRelatedInfo |
Name | Description |
---|---|
CPaneFrameWnd::OnCheckRollState | Determines whether a mini-frame window should be rolled up or down. |
CPaneFrameWnd::OnDrawBorder | Draws the borders of a mini-frame window. |
Name | Description |
---|---|
CPaneFrameWnd::m_bUseSaveBits | Specifies whether to register the window class with the CS_SAVEBITS class style. |
The framework automatically creates a CPaneFrameWnd
object when a pane is switched from a docked state to a floating state.
A mini-frame window can be dragged with its contents visible (immediate docking) or using a drag rectangle (standard docking). The docking mode of the mini-frame's container pane determines the mini-frame's dragging behavior. For more information, see CBasePane::GetDockingMode.
A mini-frame window displays buttons on the caption in accordance with the contained pane style. If the pane can be closed ( CBasePane::CanBeClosed), it displays a Close button. If the pane has the AFX_CBRS_AUTO_ROLLUP style, it displays a pin.
If you derive a class from CPaneFrameWnd
, you must tell the framework how to create it. Either create the class by overriding CPane::CreateDefaultMiniframe, or set the CPane::m_pMiniFrameRTC
member so that it points to the runtime class information for your class.
CPaneFrameWnd
Header: afxPaneFrameWnd.h
Adds a pane.
virtual void AddPane(CBasePane* pWnd);
pWnd
[in] The pane to add.
Adds or removes a pane from the global list.
static BOOL __stdcall AddRemovePaneFromGlobalList(
CBasePane* pWnd,
BOOL bAdd);
pWnd
[in] The pane to add or remove.
bAdd
[in] If non-zero, add the pane. If 0, remove the pane.
Nonzero if the method was successful; otherwise 0.
Adjusts the layout of the mini-frame window.
virtual void AdjustLayout();
virtual void AdjustPaneFrames();
Calculates the size of the borders for a miniframe window.
virtual void CalcBorderSize(CRect& rectBorderSize) const;
rectBorderSize
[out] Contains the size, in pixels, of the border of the miniframe window.
This method is called by the framework to calculate the size of the border of a miniframe window. The returned size depends on whether a miniframe window contains a toolbar or a CDockablePane.
Calculate the expected rectangle of a docked window.
virtual void CalcExpectedDockedRect(
CWnd* pWndToDock,
CPoint ptMouse,
CRect& rectResult,
BOOL& bDrawTab,
CDockablePane** ppTargetBar);
pWndToDock
[in] A pointer to the window to dock.
ptMouse
[in] The mouse location.
rectResult
[out] The calculated rectangle.
bDrawTab
[out] If TRUE, draw a tab. If FALSE, do not draw a tab.
ppTargetBar
[out] 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.
Determines whether the current pane can be docked to another pane or frame window.
virtual BOOL CanBeAttached() const;
TRUE if the pane can be docked to another pane or frame window; otherwise FALSE.
Determines whether the mini-frame window can be docked to a pane.
virtual BOOL CanBeDockedToPane(const CDockablePane* pDockingBar) const;
pDockingBar
[in] A pane.
Nonzero if the mini-frame can be docked to pDockingBar; otherwise 0.
virtual void CheckGripperVisibility();
Converts the pane to a tabbed document.
virtual void ConvertToTabbedDocument();
Creates a miniframe window and attaches it to the CPaneFrameWnd object.
virtual BOOL Create(
LPCTSTR lpszWindowName,
DWORD dwStyle,
const RECT& rect,
CWnd* pParentWnd,
CCreateContext* pContext = NULL);
lpszWindowName
[in] Specifies the text to display on the miniframe window.
dwStyle
[in] Specifies the window style. For more information, see Window Styles.
rect
[in] Specifies the initial size and position of the miniframe window.
pParentWnd
[in, out] Specifies the parent frame of the miniframe window. This value must not be NULL.
pContext
[in, out] Specifies user-defined context.
TRUE if the window was created successfully; otherwise, FALSE.
A miniframe window is created in two steps. First, the framework creates a CPaneFrameWnd
object. Second, it calls Create
to create the Windows miniframe window and attach it to the CPaneFrameWnd
object.
Creates a miniframe window and attaches it to the CPaneFrameWnd object.
virtual BOOL CreateEx(
DWORD dwStyleEx,
LPCTSTR lpszWindowName,
DWORD dwStyle,
const RECT& rect,
CWnd* pParentWnd,
CCreateContext* pContext=NULL);
dwStyleEx
[in] Specifies the extended window style. For more information, see Extended Window Styles
lpszWindowName
[in] Specifies the text to display on the miniframe window.
dwStyle
[in] Specifies the window style. For more information, see Window Styles.
rect
[in] Specifies the initial size and position of the miniframe window.
pParentWnd
[in, out] Specifies the parent frame of the miniframe window. This value must not be NULL.
pContext
[in, out] Specifies user-defined context.
TRUE if the window was created successfully; otherwise, FALSE.
A miniframe window is created in two steps. First, the framework creates a CPaneFrameWnd
object. Second, it calls Create
to create the Windows miniframe window and attach it to the CPaneFrameWnd
object.
Docks the pane.
virtual CDockablePane* DockPane(BOOL& bWasDocked);
bWasDocked
[out] TRUE if the pane was already docked; otherwise FALSE.
If the operation was successful, the CDockablePane
that the pane was docked to; otherwise NULL.
Finds a pane with the specified control ID in the global list of floating panes.
static CBasePane* FindFloatingPaneByID(UINT nID);
nID
[in] Represents the control ID of the pane to find.
The pane with the specified control ID; otherwise, NULL, if no pane has the specified control ID.
Finds the mini-frame window that contains the specified point.
static CPaneFrameWnd* __stdcall FrameFromPoint(
CPoint pt,
int nSensitivity,
CPaneFrameWnd* pFrameToExclude = NULL,
BOOL bFloatMultiOnly = FALSE);
pt
[in] The point, in screen coordinates.
nSensitivity
[in] Increase the search area of the mini-frame window by this size. A mini-frame window satisfies the search criteria if the given point falls in the increased area.
pFrameToExclude
[in] Specifies a mini-frame window to exclude from the search.
bFloatMultiOnly
[in] If TRUE, only search mini-frame windows that have the CBRS_FLOAT_MULTI style. If FALSE, search all mini-frame windows.
A pointer to the mini-frame window that contains pt; otherwise NULL.
Returns the height of the mini-frame window caption.
virtual int GetCaptionHeight() const;
The height, in pixels, of the mini-frame window.
Call this method to determine the height of a mini-frame window. By default, the height is set to SM_CYSMCAPTION. For more information, see GetSystemMetrics Function.
Calculates the bounding rectangle of a mini-frame window caption.
virtual void GetCaptionRect(CRect& rectCaption) const;
rectCaption
[out] Contains the size and position of the mini-frame window caption, in screen coordinates.
This method is called by the framework to calculate the bounding rectangle of a mini-frame window caption.
Returns the caption text.
virtual CString GetCaptionText();
The caption text of the mini-frame window.
This method is called by the framework when it displays the caption text.
CDockingManager* GetDockingManager() const;
Returns the docking mode.
virtual AFX_DOCK_TYPE GetDockingMode() const;
The docking mode. One of the following values:
DT_STANDARD
DT_IMMEDIATE
DT_SMART
Returns the first visible pane that is contained in a mini-frame window.
virtual CWnd* GetFirstVisiblePane() const;
The first pane in the mini-frame window, or NULL if the mini-frame window contains no panes.
CPoint GetHotPoint() const;
Returns a pane that is contained in the mini-frame window.
virtual CWnd* GetPane() const;
The pane that is contained in the mini-frame, or NULL if the mini-frame window contains no panes.
Returns the number of panes that are contained in a mini-frame window.
virtual int GetPaneCount() const;
The number of panes in the mini-frame window. This value can be zero.
CWnd* GetParent();
BOOL GetPinState() const;
CRect GetRecentFloatingRect() const;
Returns the number of visible panes that are contained in a mini-frame window.
virtual int GetVisiblePaneCount() const;
The number of visible panes.
Determines what part of a mini-frame window is at a given point.
virtual LRESULT HitTest(
CPoint point,
BOOL bDetectCaption);
point
[in] The point to test.
bDetectCaption
[in] If TRUE, check the point against the caption. If FALSE, ignore the caption.
One of the following values:
Value | Meaning |
---|---|
HTNOWHERE | The point is outside the mini-frame window. |
HTCLIENT | The point is in the client area. |
HTCAPTION | The point is on the caption. |
HTTOP | The point is at the top. |
HTTOPLEFT | The point is at the top left. |
HTTOPRIGHT | The point is at the top right. |
HTLEFT | The point is at the left. |
HTRIGHT | The point is at the right. |
HTBOTTOM | The point is at the bottom. |
HTBOTTOMLEFT | The point is at the bottom left. |
HTBOTTOMRIGHT | The point is at the bottom right. |
BOOL IsCaptured() const;
BOOL IsDelayShow() const;
Determines whether a mini-frame window should be rolled down.
virtual BOOL IsRollDown() const;
TRUE if the mini-frame window must be rolled down; otherwise, FALSE.
This method is called by the framework to determine whether a mini-frame window should be rolled down. The rollup/rolldown feature is enabled for a mini-frame window if it contains at least one pane that has the AFX_CBRS_AUTO_ROLLUP flag. This flag is set when a pane is created. For more information, see CBasePane::CreateEx.
By default, the framework checks whether the mouse pointer is inside the mini-frame window bounding rectangle to determine whether the window has to be rolled down. You can override this behavior in a derived class.
Determines whether a mini-frame window should be rolled up.
virtual BOOL IsRollUp() const;
TRUE if the mini-frame window must be rolled up; otherwise, FALSE.
This method is called by the framework to determine whether a mini-frame window should be rolled up. The rollup/rolldown feature is enabled for a mini-frame window if it contains at least one pane that has the AFX_CBRS_AUTO_ROLLUP flag. This flag is set when a pane is created. For more information, see CBasePane::CreateEx.
By default, the framework checks whether the mouse pointer is inside the mini-frame window bounding rectangle to determine whether the window has to be rolled up. You can override this behavior in a derived class.
Stops the docking timer.
void KillDockingTimer();
Loads the pane's state from the registry.
virtual BOOL LoadState(
LPCTSTR lpszProfileName = NULL,
UINT uiID = (UINT) -1);
lpszProfileName
[in] The profile name.
uiID
[in] The pane ID.
TRUE if the pane state was loaded successfully; otherwise FALSE.
Specifies whether to register the window class that has the CS_SAVEBITS class style.
AFX_IMPORT_DATA static BOOL m_bUseSaveBits;
Set this static member to TRUE to register the mini-frame window class that has the CS_SAVEBITS style. This may help reduce flickering when a user drags the mini-frame window.
Determines if docking is possible.
virtual BOOL OnBeforeDock();
TRUE if docking is possible; otherwise, FALSE.
Determines whether a mini-frame window should be rolled up or down.
virtual void OnCheckRollState();
This method is called by the framework to determine whether a mini-frame window should be rolled up or down.
By default, the framework calls CPaneFrameWnd::IsRollUp and CPaneFrameWnd::IsRollDown and just stretches or restores the mini-frame window. You can override this method in a derived class to use a different visual effect.
Docks the mini-frame window at its most recent position.
virtual void OnDockToRecentPos();
Draws the borders of a mini-frame window.
virtual void OnDrawBorder(CDC* pDC);
pDC
[in] The device context used to draw the border.
This method is called by the framework to draw the borders of the mini-frame window.
Stops the rollup timer.
virtual void OnKillRollUpTimer();
Moves the mini-frame window by a specified offset.
virtual void OnMovePane(
CPane* pBar,
CPoint ptOffset);
pBar
[in] A pointer to a pane (ignored).
ptOffset
[in] The offset by which to move the pane.
Adjusts the layout of a pane inside a mini-frame window.
virtual void OnPaneRecalcLayout();
The framework calls this method when it must adjust the layout of a pane inside the mini-frame window.
By default, the pane is positioned to cover the complete client area of the mini-frame window.
Sets the rollup timer.
virtual void OnSetRollUpTimer();
Called by the framework when a pane in the mini-frame window is hidden or displayed.
virtual void OnShowPane(
CDockablePane* pBar,
BOOL bShow);
pBar
[in] The pane that is being shown or hidden.
bShow
[in] TRUE if the pane is being shown; FALSE if the pane is being hidden.
Called by the framework when a pane in the mini-frame window is shown or hidden. The default implementation does nothing.
void Pin(BOOL bPin = TRUE);
[in] bPin
Returns a pane if it contains a user-supplied point inside a mini-frame window.
virtual CBasePane* PaneFromPoint(
CPoint point,
int nSensitivity,
BOOL bCheckVisibility);
point
[in] The point that the user clicked, in screen coordinates.
nSensitivity
[in] This parameter is not used.
bCheckVisibility
[in] TRUE to specify that only visible panes should be returned; otherwise, FALSE.
The pane that the user clicked, or NULL if no pane exists at that location.
Call this method to obtain a pane that contains the given point.
Redraws all mini-frame windows.
static void RedrawAll();
This method updates all mini-frame windows by calling CWnd::RedrawWindow for each window.
Called by the framework to remove non-valid panes.
virtual void RemoveNonValidPanes();
Removes a pane from the mini-frame window.
virtual void RemovePane(
CBasePane* pWnd,
BOOL bDestroy = FALSE,
BOOL bNoDelayedDestroy = FALSE);
pWnd
[in] A pointer to the pane to remove.
bDestroy
[in] Specifies what happens to the mini-frame window. If bDestroy is TRUE, this method destroys the mini-frame window immediately. If it is FALSE, this method destroys the mini-frame window after a certain delay.
bNoDelayedDestroy
[in] If TRUE, delayed destruction is disabled. If FALSE, delayed destruction is enabled.
The framework can destroy mini-frame windows immediately or after a certain delay. If you want to delay destruction of mini-frame windows, pass FALSE in the bNoDelayedDestroy parameter. Delayed destruction occurs when the framework processes the AFX_WM_CHECKEMPTYMINIFRAME message.
Replaces one pane with another.
virtual void ReplacePane(
CBasePane* pBarOrg,
CBasePane* pBarReplaceWith);
pBarOrg
[in] A pointer to the original pane.
pBarReplaceWith
[in] A pointer to the pane that replaces the original pane.
Saves the pane's state to the registry.
virtual BOOL SaveState(
LPCTSTR lpszProfileName = NULL,
UINT uiID = (UINT) -1);
lpszProfileName
[in] The profile name.
uiID
[in] The pane ID.
TRUE if the pane state was saved successfully; otherwise FALSE.
Sets caption buttons.
virtual void SetCaptionButtons(DWORD dwButtons);
dwButtons
[in] Bitwise-OR combination of the following values:
AFX_CAPTION_BTN_CLOSE
AFX_CAPTION_BTN_PIN
AFX_CAPTION_BTN_MENU
AFX_CAPTION_BTN_CUSTOMIZE
void SetDelayShow(BOOL bDelayShow);
[in] bDelayShow
void SetDockingManager(CDockingManager* pManager);
[in] pManager
Sets the docking timer.
void SetDockingTimer(UINT nTimeOut);
nTimeOut
[in] Timeout value in milliseconds.
Sets the docking state.
virtual void SetDockState(CDockingManager* pDockManager);
pDockManager
[in] A pointer to a docking manager.
void SetHotPoint(CPoint& ptNew);
[in] ptNew
Called by the framework to set the predocking state.
virtual BOOL SetPreDockState(
AFX_PREDOCK_STATE preDockState,
CBasePane* pBarToDock = NULL,
AFX_DOCK_METHOD dockMethod = DM_MOUSE);
preDockState
[in] Possible values:
PDS_NOTHING,
PDS_DOCK_REGULAR,
PDS_DOCK_TO_TAB
pBarToDock
[in] A pointer to the pane to dock.
dockMethod
[in] The docking method. (This parameter is ignored.)
TRUE if the mini-frame window is undocked; FALSE if it is docked.
Adjusts the size of a mini-frame window so that it is equivalent to a contained pane.
virtual void SizeToContent();
Call this method to adjust the size of a mini-frame window to the size of a contained pane.
Tears off a menu.
BOOL StartTearOff(CMFCPopu* pMenu);
pMenu
[in] A pointer to a menu.
TRUE if the method was successful; otherwise, FALSE.
virtual void StoreRecentDockSiteInfo(CPane* pBar);
[in] pBar
virtual void StoreRecentTabRelatedInfo(
CDockablePane* pDockingBar,
CDockablePane* pTabbedBar);
[in] pDockingBar
[in] pTabbedBar