CFrameWndEx Class
Implements the functionality of a Windows single document interface (SDI) overlapped or popup frame window, and provides members for managing the window. It extends the CFrameWnd class.
class CFrameWndEx : public CFrameWnd
Members
Public Methods
Name |
Description |
---|---|
Adjusts the layout of the OLE client item and the frame's client area. |
|
CFrameWndEx::AddDockSite |
This method is not used. |
Registers a control bar with the docking manager. |
|
Recalculates the layout of all panes that are docked to the frame window. |
|
Sets the frame menu and then updates it when command processing is idle. |
|
Docks the specified pane to the frame window. |
|
Docks one pane to the left of another pane. |
|
Enables the auto-hide mode for the panes when they are docked to the specified sides of the main frame window. |
|
Enables the docking of the panes that belong to the frame window. |
|
Shows or hides the main menu in a full screen mode. |
|
Enables the full screen mode for the frame window. |
|
Enables or disables the loading of the docking state. |
|
Enables or disables the automatic handling of the pane menu. |
|
Returns a pointer to the currently displayed pop-up menu. |
|
Returns the resource ID that you specified when the framework loaded the frame window. |
|
Retrieves the CDockingManager Class object for the frame window. |
|
Returns a pointer to the menu bar object attached to the frame window. |
|
Returns a pointer to the pane that has the specified ID. |
|
Retrieves the ribbon bar control for the frame. |
|
Returns a list of pane objects that are in a tear-off state. |
|
Called by the framework when the application displays the tooltip for a toolbar button. |
|
Registers a pane with the docking manager. |
|
Determines whether the frame window is in full screen mode. |
|
Determines whether the pointer to the menu bar object is valid. |
|
Indicates whether the point is located in an alignment zone. |
|
Indicates whether the frame window is in print preview mode. |
|
This method is called after construction to create the frame window and load its resources. |
|
Implements OLE client border negotiation. |
|
The framework calls this method when user input is switched to or away from the frame. |
|
Called by the framework when the application is either selected or deselected. |
|
Called by the framework when a change to the frame requires a change to the visual manager. |
|
The framework calls this method to close the frame. |
|
Called by the framework when the user clicks the Close button on a docking pane. |
|
Called by the framework when the user clicks the Close button on a floating mini frame window. |
|
Called by the framework when an active pop-up menu processes a WM_DESTROY message. |
|
Dispatches command messages. |
|
Called by the framework to display context related help. |
|
Called by the framework after the frame is created. |
|
Called by the framework when the frame is destroyed. |
|
Called by the framework when the application draws the image associated with a menu item. |
|
Called by the framework when a CMFCPopupMenu object processes a WM_PAINT message. |
|
Called by the framework when Desktop Window Manager (DWM) composition has been enabled or disabled. |
|
Called by the framework when the frame stops moving or resizing. |
|
Called by the framework when the frame is resized to set window dimension limits. |
|
Called by the framework to update the frame display when command processing is idle. |
|
The framework calls this method when the user presses the left mouse button. |
|
The framework calls this method when the user releases the left mouse button. |
|
Called by the framework when a CMFCToolBarButton object processes a WM_NCHITTEST message. |
|
Called by the framework when a menu is displayed and the user presses a key that does not correspond to a command. |
|
The framework calls this method when the pointer moves. |
|
Called by the framework when a pane window moves. |
|
Called by the framework when the non-client area of the frame must be redrawn to indicate a change in the active state. |
|
Called by the framework when the size and position of the client area must be calculated. |
|
Called by the framework when the pointer moves or when a mouse button is pressed or released. |
|
Called by the framework when the pointer moves in a non-client area. |
|
Called by the framework when the non-client area must be painted. |
|
Called by the framework to control the visibility of a pane. |
|
Called by the framework when the user has changed the print preview mode. |
|
Called by the framework when a power management event occurs. |
|
Called by the framework to replace the frame window menu. |
|
Called by the framework to set the print preview mode for the frame. |
|
Called by the framework to set the text of a window. |
|
Called by the framework when a quick customize pane is enabled. |
|
Called by the framework to show or hide panes. |
|
Called by the framework when a pop-up menu is enabled. |
|
The framework calls this method after the frame's size changes. |
|
The framework calls this method when the user resizes the frame. |
|
Called by the framework when the system colors change. |
|
Called by the framework when a menu that has a tear-off bar is enabled. |
|
Called by the framework to build a toolbar context menu. |
|
The framework calls this method to create a new toolbar. |
|
Called by the framework when a toolbar is deleted. |
|
Called by the framework to set the frame menu. |
|
The framework calls this method to update the title bar of the frame window. |
|
Called by the framework to update the pane menu. |
|
Called by the framework when the frame size, position, or z-order has changed because of a call to a window management method. |
|
Returns the docking pane that contains the specified point. |
|
Handles specific window messages before they are dispatched. |
|
Adjusts the layout of the frame and its child windows. |
|
Unregisters a pane and removes it from the internal list in the docking manager. |
|
Restores the docking layout to the docking state stored in the registry. |
|
Sets the print preview frame window. |
|
Inserts user-defined commands into a toolbar menu. |
|
Switches the main frame between the full screen and the regular modes. |
|
Shows or hides the specified pane. |
|
Called by the framework to update the window frame caption. |
|
Invokes either the WinHelp application or context related help. |
Example
The following example demonstrates how to inherit a class from the CFrameWndEx class. The example illustrates the method signatures in the subclass, and how to override the OnShowPopupMenu method. This code snippet is part of the WordPad Sample: MFC WordPad Application.
class CMainFrame : public CFrameWndEx
{
protected: // create from serialization only
CMainFrame();
DECLARE_DYNCREATE(CMainFrame)
// Attributes
public:
HICON m_hIconDoc;
HICON m_hIconText;
HICON m_hIconWrite;
HICON GetIcon(int nDocType);
// Operations
public:
void UpdateMRUFilesList ()
{
m_wndTaskPane.UpdateMRUFilesList ();
}
void OnChangeLook ();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainFrame)
public:
virtual void ActivateFrame(int nCmdShow = -1);
virtual BOOL LoadFrame(UINT nIDResource, DWORD dwDefaultStyle = WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, CWnd* pParentWnd = NULL, CCreateContext* pContext = NULL);
protected:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
virtual BOOL OnShowPopupMenu (CMFCPopupMenu* pMenuPopup);
virtual BOOL OnTearOffMenu (CMFCPopupMenu* pMenuPopup, CPane* pBar);
protected:
void AdjustObjectSubmenu (CMFCPopupMenu* pMenuPopup);
void AdjustColorsMenu (CMFCPopupMenu* pMenuPopup, UINT uiId);
// Implementation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
public:
CMFCMenuBar m_wndMenuBar;
CMFCToolBar m_wndToolBar;
CMFCStatusBar m_wndStatusBar;
CFormatBar m_wndFormatBar;
CRulerBar m_wndRulerBar;
CTaskPane m_wndTaskPane;
protected: // control bar embedded members
BOOL CreateMenuBar();
BOOL CreateToolBar();
BOOL CreateFormatBar();
BOOL CreateStatusBar();
BOOL CreateRulerBar();
BOOL CreateTaskPane ();
// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnSysColorChange();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnMove(int x, int y);
afx_msg void OnHelpFinder();
afx_msg void OnDropFiles(HDROP hDropInfo);
afx_msg void OnFontChange();
afx_msg BOOL OnQueryNewPalette();
afx_msg void OnPaletteChanged(CWnd* pFocusWnd);
afx_msg void OnDevModeChange(LPTSTR lpDeviceName);
afx_msg void OnViewCustomize();
afx_msg void OnViewFullScreen();
//}}AFX_MSG
afx_msg LRESULT OnBarState(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnOpenMsg(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnHelpCustomizeToolbars(WPARAM wp, LPARAM lp);
afx_msg LRESULT OnStartCustomize(WPARAM wp, LPARAM lp);
afx_msg LRESULT OnToolbarCreateNew(WPARAM,LPARAM);
afx_msg LRESULT OnGetDocumentColors(WPARAM,LPARAM);
afx_msg void OnDummy();
afx_msg void OnAskQuestion();
DECLARE_MESSAGE_MAP()
};
...
BOOL CMainFrame::OnShowPopupMenu (CMFCPopupMenu* pMenuPopup)
{
BOOL bRes = CFrameWndEx::OnShowPopupMenu (pMenuPopup);
if (pMenuPopup != NULL && !pMenuPopup->IsCustomizePane())
{
AdjustObjectSubmenu (pMenuPopup);
AdjustColorsMenu (pMenuPopup, ID_CHAR_COLOR);
}
return bRes;
}
Inheritance Hierarchy
Requirements
Header: afxframewndex.h