# wxMDIChildFrame Class Reference
[Managed Windows]

`#include <wx/mdi.h>`

Inheritance diagram for wxMDIChildFrame:
[legend]

## Detailed Description

An MDI child frame is a frame that can only exist inside a wxMDIClientWindow, which is itself a child of wxMDIParentFrame.

## Styles

This class supports the following styles:

All of the standard wxFrame styles can be used but most of them are ignored by TDI-based MDI implementations.

Remarks:
  Although internally an MDI child frame is a child of the MDI client window, in wxWidgets you create it as a child of wxMDIParentFrame. In fact, you can usually forget that the client window exists. MDI child frames are clipped to the area of the MDI client window, and may be iconized on the client window. You can associate a menubar with a child frame as usual, although an MDI child doesn't display its menubar under its own title bar. The MDI parent frame's menubar will be changed to reflect the currently active child frame. If there are currently no children, the parent frame's own menubar will be displayed.

##

Library: wxCore

Category: Managed Windows

See also:
  wxMDIClientWindow, wxMDIParentFrame, wxFrame

## Public Member Functions
| wxMDIChildFrame ()
| Default constructor.
| wxMDIChildFrame (wxMDIParentFrame *parent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE, const wxString &name=wxFrameNameStr)
| Constructor, creating the window.
virtual | ~wxMDIChildFrame ()
| Destructor.
virtual void | Activate ()
| Activates this MDI child frame.
bool | Create (wxMDIParentFrame *parent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE, const wxString &name=wxFrameNameStr)
| Used in two-step frame construction.
wxMDIParentFrame * | GetMDIParent () const
| Returns the MDI parent frame containing this child.
virtual bool | IsAlwaysMaximized () const
| Returns true for MDI children in TDI implementations.
virtual void | Maximize (bool maximize=true)
| Maximizes this MDI child frame.
virtual void | Restore ()
| Restores this MDI child frame (unmaximizes).

List of all members.

## Constructor & Destructor Documentation

wxMDIChildFrame::wxMDIChildFrame | ( |  | ) |

Default constructor.

wxMDIChildFrame::wxMDIChildFrame | ( | wxMDIParentFrame * | parent,
|  | wxWindowID | id,
|  | const wxString & | title,
|  | const wxPoint & | pos = `wxDefaultPosition`,
|  | const wxSize & | size = `wxDefaultSize`,
|  | long | style = `wxDEFAULT_FRAME_STYLE`,
|  | const wxString & | name = `wxFrameNameStr` |
| ) |  |  |

Constructor, creating the window.

Parameters:

  | parent | The window parent. This should not be NULL.
  | id | The window identifier. It may take a value of -1 to indicate a default value.
  | title | The caption to be displayed on the frame's title bar.
  | pos | The window position. The value wxDefaultPosition indicates a default position, chosen by either the windowing system or wxWidgets, depending on platform.
  | size | The window size. The value wxDefaultSize indicates a default size, chosen by either the windowing system or wxWidgets, depending on platform.
  | style | The window style. See wxMDIChildFrame.
  | name | The name of the window. This parameter is used to associate a name with the item, allowing the application user to set Motif resource values for individual windows.

See also:
  Create()

virtual wxMDIChildFrame::~wxMDIChildFrame | ( |  | ) | `[virtual]`

Destructor.

Destroys all child windows and menu bar if present.

## Member Function Documentation

virtual void wxMDIChildFrame::Activate | ( |  | ) | `[virtual]`

Activates this MDI child frame.

See also:
  Maximize(), Restore()

bool wxMDIChildFrame::Create | ( | wxMDIParentFrame * | parent,
|  | wxWindowID | id,
|  | const wxString & | title,
|  | const wxPoint & | pos = `wxDefaultPosition`,
|  | const wxSize & | size = `wxDefaultSize`,
|  | long | style = `wxDEFAULT_FRAME_STYLE`,
|  | const wxString & | name = `wxFrameNameStr` |
| ) |  |  |

Used in two-step frame construction.

See wxMDIChildFrame() for further details.

wxMDIParentFrame* wxMDIChildFrame::GetMDIParent | ( |  | ) | const

Returns the MDI parent frame containing this child.

Notice that this may return a different object than GetParent() as the child frames may be created as children of the client window internally.

virtual bool wxMDIChildFrame::IsAlwaysMaximized | ( |  | ) | const`[virtual]`

Returns true for MDI children in TDI implementations.

TDI-based implementations represent MDI children as pages in a wxNotebook and so they are always maximized and can't be restored or iconized.

See also:
  wxMDIParentFrame::IsTDI().

Reimplemented from wxTopLevelWindow.

virtual void wxMDIChildFrame::Maximize | ( | bool | maximize = `true` | ) | `[virtual]`

Maximizes this MDI child frame.

This function doesn't do anything if IsAlwaysMaximized() returns true.

See also:
  Activate(), Restore()

Reimplemented from wxTopLevelWindow.

virtual void wxMDIChildFrame::Restore | ( |  | ) | `[virtual]`

Restores this MDI child frame (unmaximizes).

This function doesn't do anything if IsAlwaysMaximized() returns true.

See also:
  Activate(), Maximize()

|  | [ top ]