CMDIFrameWndEx Class
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
Extends the functionality of CMDIFrameWnd, a Windows Multiple Document Interface (MDI) frame window.
class CMDIFrameWndEx : public CMDIFrameWnd
Public Methods
Name | Description |
|---|---|
Recalculates the layout of the active item. | |
| |
Registers a pane with the docking manager. | |
Reduces the client area to allow for a border. | |
Recalculates the layout of all docked panes. | |
Determines whether the MDI Tabs feature or the MDI Tabbed Groups feature is enabled. | |
Called by the framework to determine whether the frame window can convert docking panes to tabbed documents. | |
Converts the specified docking pane to a tabbed document. | |
Creates a child document window. | |
Called by the framework to create a new window. | |
CMDIFrameWndEx::CreateObject | Used by the framework to create a dynamic instance of this class type. |
Docks the specified pane to the frame window. | |
Docks one pane to the left of another pane. | |
Enables auto-hide mode for panes when they are docked at specified sides of the main frame window. | |
Enables docking of the panes that belong to the MDI frame window. | |
| |
| |
| |
Enables or disables the MDI Tabbed Groups feature. | |
Enables or disables the MDI Tabs feature. When enabled, the frame window displays a tab for each MDI child window. | |
Specifies whether the last active tab should be activated when the user closes the current tab. | |
Enables or disables automatic creation and management of the pop-up pane menu, which displays a list of application panes. . | |
Inserts a menu item whose command ID calls a CMFCWindowsManagerDialog dialog box. | |
Returns a pointer to the currently displayed popup menu. | |
Returns a pointer to the pane that has the specified control ID. | |
Returns the ID of shared resources of the MDI frame window. | |
Returns a list of MDI tabbed windows. | |
Returns a reference to the underlined tabbed window. | |
Returns a combination of flags that determines what context menu items are valid when the MDI Tabbed Groups feature is enabled. | |
Returns a pointer to a menu bar object attached to the frame window. | |
| |
Returns a list of CPane-derived objects that are in a tear-off state. | |
CMDIFrameWndEx::GetThisClass | Called by the framework to obtain a pointer to the CRuntimeClass object that is associated with this class type. |
| |
Registers the specified pane with the docking manager. | |
| |
Determines whether the MDI Tabbed Groups feature is enabled. | |
Determines whether the specified tabbed window is in the list of windows that are in MDI Tabbed Groups. | |
Determines whether the frame window has a menu bar. | |
Determines whether a specified point is near the dock site. | |
| |
Creates a frame window from resource information. (Overrides CMDIFrameWnd::LoadFrame.) | |
Loads the specified layout of MDI Tabbed Groups and the list of previously opened documents. | |
Moves the active tab from the currently active tabbed window to the next or previous tabbed group. | |
Creates a new tabbed group that has a single window. | |
Negotiates border space in a frame window during OLE in-place activation. | |
Called by the framework when the user clicks the Close button on a dockable 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. | |
Called by the framework to route and dispatch command messages and to update command user-interface objects. (Overrides CMDIFrameWnd::OnCmdMsg.) | |
Called by the framework when the image associated with a menu item is drawn. | |
Called by the framework when a CMFCPopupMenuprocesses a WM_PAINT message. | |
Called by the framework when the MDI frame window processes a WM_ERASEBKGND message. | |
Called by the framework when a CMFCToolBarButtonobject processes a WM_NCHITTEST message. | |
Called by the framework to move a mini-frame window. | |
Sets the application's main frame window print-preview mode. (Overrides CFrameWnd::OnSetPreviewMode.) | |
Called by the framework when a Quick Customize pane is activated. | |
Called by the framework when a context menu should be displayed on one of the tabs. (Valid for MDI Tabbed Groups only.) | |
Called by the framework to show or hide panes. | |
Called by the framework when a pop-up menu is activated. | |
| |
Called by the framework when a menu that has a tear-off bar is activated. | |
Called by the framework to update the frame menu. (Overrides CMDIFrameWnd::OnUpdateFrameMenu.) | |
Returns the docking pane that contains the specified point. | |
CMDIFrameWndEx::PreTranslateMessage | Used by class CWinApp to translate window messages before they are dispatched to the TranslateMessage and DispatchMessage Windows functions. (Overrides CMDIFrameWnd::PreTranslateMessage.) |
Called by the framework to recalculate the layout of the frame window. (Overrides CFrameWnd::RecalcLayout.) | |
Unregisters a pane and removes it from the docking manager. | |
Saves the current layout of MDI Tabbed Groups and the list of previously opened documents. | |
| |
Modifies a toolbar object by searching for dummy items and replacing them with the specified user-defined items. | |
| |
Shows or hides the specified pane. | |
Creates a CMFCWindowsManagerDialog box and opens it. | |
Converts the specified tabbed document to a docking pane. | |
| |
Sets the icon for each MDI tabbed pane. | |
Called by the framework to initiate the WinHelp application or context help. (Overrides CWnd::WinHelp.) |
Data Members
Name | Description |
|---|---|
Determines whether docking panes can be converted to MDI child windows. | |
Enables or disables redraw optimization for MDI child windows. |
The following example derives a class from CMDIFrameWndEx. This code snippet comes from the DrawClient Sample: MFC Ribbon-Based OLE Object Drawing Application.
class CMainFrame : public CMDIFrameWndEx { DECLARE_DYNAMIC(CMainFrame) public: struct XStyle { COLORREF clrFill; COLORREF clrLine; }; public: CMainFrame(); // Attributes public: CMFCRibbonBar* GetRibbonBar() {return &m_wndRibbonBar;} // Operations public: void UpdateUI(CDrawView* pCurrView); void UpdateContextTab(CDrawView* pCurrView); void UpdateContextTabFromObject(CDrawObjList& list); COLORREF GetColorFromColorButton(int nButtonID); int GetWeightFromLineWeight(int nButtonID); BOOL GetStyleFromStyles(XStyle& style); void SetRibbonContextCategory(UINT uiCategoryID); void ActivateRibbonContextCategory(UINT uiCategoryID); // Implementation public: virtual ~CMainFrame(); #ifdef _DEBUG virtual void AssertValid() const; virtual void Dump(CDumpContext& dc) const; #endif protected: // control bar embedded members CMFCRibbonStatusBar m_wndStatusBar; CMFCRibbonBar m_wndRibbonBar; CMFCRibbonApplicationButton m_MainButton; // panel images CMFCToolBarImages m_PanelImages; // Document colors for demo: CList<COLORREF,COLORREF> m_lstMainColors; CList<COLORREF,COLORREF> m_lstAdditionalColors; CList<COLORREF,COLORREF> m_lstStandardColors; // Generated message map functions protected: //{{AFX_MSG(CMainFrame) afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnAppLook(UINT id); afx_msg void OnUpdateAppLook(CCmdUI* pCmdUI); afx_msg void OnWindowManager(); afx_msg void OnMdiMoveToNextGroup(); afx_msg void OnMdiMoveToPrevGroup(); afx_msg void OnMdiNewHorzTabGroup(); afx_msg void OnMdiNewVertGroup(); afx_msg void OnMdiCancel(); afx_msg LRESULT OnRibbonCustomize(WPARAM wp, LPARAM lp); afx_msg LRESULT OnHighlightRibbonListItem(WPARAM wp, LPARAM lp); afx_msg void OnToolsOptions(); afx_msg void OnDummy(); afx_msg void OnSysColorChange(); //}}AFX_MSG DECLARE_MESSAGE_MAP() virtual BOOL OnShowMDITabContextMenu(CPoint point, DWORD dwAllowedItems, BOOL bDrop); virtual BOOL OnShowPopupMenu(CMFCPopupMenu* pMenuPopup); void ShowOptions(int nPage); void CreateDocumentColors(); private: BOOL CreateRibbonBar(); BOOL CreateStatusBar(); void InitMainButton(); void InitHomeCategory(); void InitViewCategory(); void InitTabButtons(); void AddContextTab_Format(); void AdjustObjectSubmenu(CMFCPopupMenu* pMenuPopup); void UpdateStatusBarCountPane(int nID, CString strText, int nCount); UINT m_nAppLook; };