// the children
// ===========================================================================
+void wxMDIParentFrame::Init()
+{
+#if wxUSE_MENUS && wxUSE_ACCEL
+ // the default menu doesn't have any accelerators (even if we have it)
+ m_accelWindowMenu = NULL;
+#endif // wxUSE_MENUS && wxUSE_ACCEL
+}
+
bool wxMDIParentFrame::Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
m_windowMenu->Append(wxID_MDI_WINDOW_PREV, _("&Previous"));
}
-#if wxUSE_MENUS && wxUSE_ACCEL
- // the default menu doesn't have any accelerators (even if we have it)
- m_accelWindowMenu = NULL;
-#endif // wxUSE_MENUS && wxUSE_ACCEL
-
if (!parent)
wxTopLevelWindows.Append(this);
msflags &= ~WS_VSCROLL;
msflags &= ~WS_HSCROLL;
- if ( !wxWindow::MSWCreate(wxApp::GetRegisteredClassName(_T("wxMDIFrame")),
+ if ( !wxWindow::MSWCreate(wxApp::GetRegisteredClassName(wxT("wxMDIFrame")),
title.wx_str(),
pos, size,
msflags,
}
#if wxUSE_ACCEL
- delete m_accelWindowMenu;
- m_accelWindowMenu = NULL;
+ wxDELETE(m_accelWindowMenu);
if ( menu && menu->HasAccels() )
m_accelWindowMenu = menu->CreateAccelTable();
void wxMDIParentFrame::Tile(wxOrientation orient)
{
wxASSERT_MSG( orient == wxHORIZONTAL || orient == wxVERTICAL,
- _T("invalid orientation value") );
+ wxT("invalid orientation value") );
::SendMessage(GetWinHwnd(GetClientWindow()), WM_MDITILE,
orient == wxHORIZONTAL ? MDITILE_HORIZONTAL
processed = true;
break;
-
- case WM_ERASEBKGND:
- processed = true;
-
- // we erase background ourselves
- rc = true;
- break;
-
- case WM_SIZE:
- // though we don't (usually) resize the MDI client to exactly fit
- // the client area we need to pass this one to DefFrameProc to
- // allow the children to show
- break;
}
if ( !processed )
if ( event.GetEventType() == wxEVT_COMMAND_MENU_SELECTED )
{
wxMDIChildFrame * const child = GetActiveChild();
- if ( child && child->ProcessEventHere(event) )
+ if ( child && child->ProcessWindowEventLocally(event) )
return true;
}
MDICREATESTRUCT mcs;
wxString className =
- wxApp::GetRegisteredClassName(_T("wxMDIChildFrame"), COLOR_WINDOW);
+ wxApp::GetRegisteredClassName(wxT("wxMDIChildFrame"), COLOR_WINDOW);
if ( !(style & wxFULL_REPAINT_ON_RESIZE) )
className += wxApp::GetNoRedrawClassSuffix();
if ( !m_hWnd )
{
- wxLogLastError(_T("WM_MDICREATE"));
+ wxLogLastError(wxT("WM_MDICREATE"));
return false;
}
return true;
}
+void
+wxMDIChildFrame::DoSetSize(int x, int y, int width, int height, int sizeFlags)
+{
+ // we need to disable client area origin adjustments used for the child
+ // windows for the frame itself
+ wxMDIChildFrameBase::DoSetSize(x, y, width, height, sizeFlags);
+}
+
// Set the client size (i.e. leave the calculation of borders etc.
// to wxWidgets)
void wxMDIChildFrame::DoSetClientSize(int width, int height)
WXHMENU hMenuParent = parent->m_hMenu;
- // activate the the parent menu only when there is no other child
+ // activate the parent menu only when there is no other child
// that has been activated
if ( hMenuParent && !hwndAct )
hMenuToSet = hMenuParent;
(WPARAM)hmenuFrame,
(LPARAM)hmenuWindow) )
{
-#ifdef __WXDEBUG__
DWORD err = ::GetLastError();
if ( err )
- wxLogApiError(_T("SendMessage(WM_MDISETMENU)"), err);
-#endif // __WXDEBUG__
+ {
+ wxLogApiError(wxT("SendMessage(WM_MDISETMENU)"), err);
+ }
}
}
inserted = true;
::InsertMenu(hmenu, i, MF_BYPOSITION | MF_POPUP | MF_STRING,
(UINT_PTR)menuWin,
- wxGetTranslation(WINDOW_MENU_LABEL).wx_str());
+ wxString(wxGetTranslation(WINDOW_MENU_LABEL)).wx_str());
break;
}
}
{
::AppendMenu(hmenu, MF_POPUP,
(UINT_PTR)menuWin,
- wxGetTranslation(WINDOW_MENU_LABEL).wx_str());
+ wxString(wxGetTranslation(WINDOW_MENU_LABEL)).wx_str());
}
}