Export (0) Print
Expand All
MFC
Expand Minimize

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

CMDIFrameWndEx::ActiveItemRecalcLayout

Recalculates the layout of the active item.

CMDIFrameWndEx::AddDockSite

 

CMDIFrameWndEx::AddPane

Registers a pane with the docking manager.

CMDIFrameWndEx::AdjustClientArea

Reduces the client area to allow for a border.

CMDIFrameWndEx::AdjustDockingLayout

Recalculates the layout of all docked panes.

CMDIFrameWndEx::AreMDITabs

Determines whether the MDI Tabs feature or the MDI Tabbed Groups feature is enabled.

CMDIFrameWndEx::CanCovertControlBarToMDIChild

Called by the framework to determine whether the frame window can convert docking panes to tabbed documents.

CMDIFrameWndEx::ControlBarToTabbedDocument

Converts the specified docking pane to a tabbed document.

CMDIFrameWndEx::CreateDocumentWindow

Creates a child document window.

CMDIFrameWndEx::CreateNewWindow

Called by the framework to create a new window.

CMDIFrameWndEx::CreateObject

Used by the framework to create a dynamic instance of this class type.

CMDIFrameWndEx::DockPane

Docks the specified pane to the frame window.

CMDIFrameWndEx::DockPaneLeftOf

Docks one pane to the left of another pane.

CMDIFrameWndEx::EnableAutoHidePanes

Enables auto-hide mode for panes when they are docked at specified sides of the main frame window.

CMDIFrameWndEx::EnableDocking

Enables docking of the panes that belong to the MDI frame window.

CMDIFrameWndEx::EnableFullScreenMainMenu

 

CMDIFrameWndEx::EnableFullScreenMode

 

CMDIFrameWndEx::EnableLoadDockState

 

CMDIFrameWndEx::EnableMDITabbedGroups

Enables or disables the MDI Tabbed Groups feature.

CMDIFrameWndEx::EnableMDITabs

Enables or disables the MDI Tabs feature. When enabled, the frame window displays a tab for each MDI child window.

CMDIFrameWndEx::EnableMDITabsLastActiveActivation

Specifies whether the last active tab should be activated when the user closes the current tab.

CMDIFrameWndEx::EnablePaneMenu

Enables or disables automatic creation and management of the pop-up pane menu, which displays a list of application panes. .

CMDIFrameWndEx::EnableWindowsDialog

Inserts a menu item whose command ID calls a CMFCWindowsManagerDialog dialog box.

CMDIFrameWndEx::GetActivePopup

Returns a pointer to the currently displayed popup menu.

CMDIFrameWndEx::GetPane

Returns a pointer to the pane that has the specified control ID.

CMDIFrameWndEx::GetDefaultResId

Returns the ID of shared resources of the MDI frame window.

CMDIFrameWndEx::GetMDITabGroups

Returns a list of MDI tabbed windows.

CMDIFrameWndEx::GetMDITabs

Returns a reference to the underlined tabbed window.

CMDIFrameWndEx::GetMDITabsContextMenuAllowedItems

Returns a combination of flags that determines what context menu items are valid when the MDI Tabbed Groups feature is enabled.

CMDIFrameWndEx::GetMenuBar

Returns a pointer to a menu bar object attached to the frame window.

CMDIFrameWndEx::GetRibbonBar

 

CMDIFrameWndEx::GetTearOffBars

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.

CMDIFrameWndEx::GetToolbarButtonToolTipText

 

CMDIFrameWndEx::InsertPane

Registers the specified pane with the docking manager.

CMDIFrameWndEx::IsFullScreen

 

CMDIFrameWndEx::IsMDITabbedGroup

Determines whether the MDI Tabbed Groups feature is enabled.

CMDIFrameWndEx::IsMemberOfMDITabGroup

Determines whether the specified tabbed window is in the list of windows that are in MDI Tabbed Groups.

CMDIFrameWndEx::IsMenuBarAvailable

Determines whether the frame window has a menu bar.

CMDIFrameWndEx::IsPointNearDockSite

Determines whether a specified point is near the dock site.

CMDIFrameWndEx::IsPrintPreview

 

CMDIFrameWndEx::LoadFrame

Creates a frame window from resource information. (Overrides CMDIFrameWnd::LoadFrame.)

CMDIFrameWndEx::LoadMDIState

Loads the specified layout of MDI Tabbed Groups and the list of previously opened documents.

CMDIFrameWndEx::MDITabMoveToNextGroup

Moves the active tab from the currently active tabbed window to the next or previous tabbed group.

CMDIFrameWndEx::MDITabNewGroup

Creates a new tabbed group that has a single window.

CMDIFrameWndEx::NegotiateBorderSpace

Negotiates border space in a frame window during OLE in-place activation.

CMDIFrameWndEx::OnCloseDockingPane

Called by the framework when the user clicks the Close button on a dockable pane.

CMDIFrameWndEx::OnCloseMiniFrame

Called by the framework when the user clicks the Close button on a floating mini frame window.

CMDIFrameWndEx::OnClosePopupMenu

Called by the framework when an active pop-up menu processes a WM_DESTROY message.

CMDIFrameWndEx::OnCmdMsg

Called by the framework to route and dispatch command messages and to update command user-interface objects. (Overrides CMDIFrameWnd::OnCmdMsg.)

CMDIFrameWndEx::OnDrawMenuImage

Called by the framework when the image associated with a menu item is drawn.

CMDIFrameWndEx::OnDrawMenuLogo

Called by the framework when a CMFCPopupMenuprocesses a WM_PAINT message.

CMDIFrameWndEx::OnEraseMDIClientBackground

Called by the framework when the MDI frame window processes a WM_ERASEBKGND message.

CMDIFrameWndEx::OnMenuButtonToolHitTest

Called by the framework when a CMFCToolBarButtonobject processes a WM_NCHITTEST message.

CMDIFrameWndEx::OnMoveMiniFrame

Called by the framework to move a mini-frame window.

CMDIFrameWndEx::OnSetPreviewMode

Sets the application's main frame window print-preview mode. (Overrides CFrameWnd::OnSetPreviewMode.)

CMDIFrameWndEx::OnShowCustomizePane

Called by the framework when a Quick Customize pane is activated.

CMDIFrameWndEx::OnShowMDITabContextMenu

Called by the framework when a context menu should be displayed on one of the tabs. (Valid for MDI Tabbed Groups only.)

CMDIFrameWndEx::OnShowPanes

Called by the framework to show or hide panes.

CMDIFrameWndEx::OnShowPopupMenu

Called by the framework when a pop-up menu is activated.

CMDIFrameWndEx::OnSizeMDIClient

 

CMDIFrameWndEx::OnTearOffMenu

Called by the framework when a menu that has a tear-off bar is activated.

CMDIFrameWndEx::OnUpdateFrameMenu

Called by the framework to update the frame menu. (Overrides CMDIFrameWnd::OnUpdateFrameMenu.)

CMDIFrameWndEx::PaneFromPoint

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.)

CMDIFrameWndEx::RecalcLayout

Called by the framework to recalculate the layout of the frame window. (Overrides CFrameWnd::RecalcLayout.)

CMDIFrameWndEx::RemovePaneFromDockManager

Unregisters a pane and removes it from the docking manager.

CMDIFrameWndEx::SaveMDIState

Saves the current layout of MDI Tabbed Groups and the list of previously opened documents.

CMDIFrameWndEx::SetPrintPreviewFrame

 

CMDIFrameWndEx::SetupToolbarMenu

Modifies a toolbar object by searching for dummy items and replacing them with the specified user-defined items.

CMDIFrameWndEx::ShowFullScreen

 

CMDIFrameWndEx::ShowPane

Shows or hides the specified pane.

CMDIFrameWndEx::ShowWindowsDialog

Creates a CMFCWindowsManagerDialog box and opens it.

CMDIFrameWndEx::TabbedDocumentToControlBar

Converts the specified tabbed document to a docking pane.

CMDIFrameWndEx::UpdateCaption

 

CMDIFrameWndEx::UpdateMDITabbedBarsIcons

Sets the icon for each MDI tabbed pane.

CMDIFrameWndEx::WinHelp

Called by the framework to initiate the WinHelp application or context help. (Overrides CWnd::WinHelp.)

Data Members

Name

Description

CMDIFrameWndEx::m_bCanCovertControlBarToMDIChild

Determines whether docking panes can be converted to MDI child windows.

CMDIFrameWndEx::m_bDisableSetRedraw

Enables or disables redraw optimization for MDI child windows.

To take advantage of extended customization features in your MDI application, derive the MDI frame window class of the application from CMDIFrameWndEx instead of CMDIFrameWnd.

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;
};


CObject

   CCmdTarget

      CWnd

         CFrameWnd

            CMDIFrameWnd

               CMDIFrameWndEx

Header: afxMDIFrameWndEx.h

Community Additions

ADD
Show:
© 2014 Microsoft