CMDIFrame

Win32++

CMDIFrame Class

Description

This class provides a frame for MDI (Multi Document Interface) applications.  MDI applications are capable of hosting several child windows within a frame. 

The CMDIFrame class inherits much of its default implementation from CFrame, and adds the additional functionality required for MDI frames.  The CWnd classes for the MDI child windows should  be inherited from CMDIChild.

CMDIFrame Members

Constructor

CMDIFrame
CMDIFrame();
Constructor for CMDIFrame.

Attributes

GetActiveMDIChild
CMDIChild* GetActiveMDIChild() const;
Returns the CMDIChild pointer to the active MDI child.
GetActiveMenu
CMenu* GetActiveMenu() const;
Returns a pointer to the menu of the active MDI child, or the MDI Frame's menu if no MDI child is active. GetAllMDIChildren
std::vector <MDIChildPtr>& GetAllMDIChildren();
Returns the vector containing the MDI child handles. GetMDIClient
virtual CMDIClient* GetMDIClient() const;
Returns a pointer to the MDI client window. SetActiveMDIChild
void SetActiveMDIChild(CMDIChild* pChild);
Activates the specified MDI child.

State functions

IsMDIChildMaxed
BOOL IsMDIChildMaxed() const;
Returns TRUE if the MDI child is maximised.
IsMDIFrame
virtual BOOL IsMDIFrame() const;
Overrides CFrame::IsMDIFrame, and returns TRUE.

Operations

AddMDIChild
virtual CMDIChild* AddMDIChild(MDIChildPtr pMDIChild);
Adds a MDI child window.
MDICascade
void MDICascade(int nType = 0) const;
Arrange all MDI child windows in a cascade format.
MDIIconArrange
void MDIIconArrange() const;
Arrange all minimized MDI child windows.
MDIMaximize
void MDIMaximize() const;
Maximize a MDI child window.
MDINext
void MDINext() const;
Activate the next MDI child.
MDIPrev
void MDIPrev() const;
Activate the previous MDI child.
MDIRestore
void MDIRestore() const;
Restores a MDI child window from maximized or minimized size.
MDITile
void MDITile(int nType = 0) const;
Arrange all MDI child windows in a tile format.
RemoveAllMDIChildren
virtual BOOL RemoveAllMDIChildren();
Removes all MDI child windows.
RemoveMDIChild
virtual void RemoveMDIChild(HWND hWnd);
Removes a MDI child, given its window handle.

Overridables

OnClose
virtual void OnClose();
Called when the frame window is closed.
OnViewStatusBar
virtual void OnViewStatusBar();
Called when the StatusBar is shown.
OnViewToolBar
virtual void OnViewToolBar();
Called when the ToolBar window is shown.
OnWindowPosChanged
virtual void OnWindowPosChanged();
Called when the size, position, or Z-order of the frame window has changed
PreTranslateMessage
virtual BOOL PreTranslateMessage(MSG* pMsg);
Used to translate window messages before they are dispatched to the TranslateMessage and DispatchMessage Windows functions.
Base class Members

For base class members, refer to the members of CFrame.

Remarks

Refer to the MDI Frames section for information on how to create MDI Frames and MDI Children.

Summary Information

Header file mdi.h
Win32/64 support Yes
WinCE support No
Library required Comctl32.lib