if (style & wxCAPTION)
msflags |= WS_CAPTION;
- // Adding WS_CLIPCHILDREN causes children not to be properly
- // drawn when first displaying them.
-// if (style & wxCLIP_CHILDREN)
-// msflags |= WS_CLIPCHILDREN;
+ if (style & wxCLIP_CHILDREN)
+ msflags |= WS_CLIPCHILDREN;
wxWindow::MSWCreate(m_windowId, parent, wxMDIFrameClassName, this, title, x, y, width, height,
msflags);
break;
case WM_SIZE:
- // we will leave this message to the base class version, but we
- // must pass it to DefFrameProc() too
- MSWDefWindowProc(message, wParam, lParam);
+ // as we don't (usually) resize the MDI client to exactly fit the
+ // client area (we put it below the toolbar, above statusbar &c),
+ // we should not pass this one to DefFrameProc
break;
}
return TRUE;
}
- if ( m_acceleratorTable.Ok() &&
- ::TranslateAccelerator(GetHwnd(),
- GetTableHaccel(m_acceleratorTable),
- pMsg) )
+ if ( m_acceleratorTable.Translate(this, msg) )
{
return TRUE;
}
// MDI operations
// ---------------------------------------------------------------------------
-void wxMDIChildFrame::Maximize()
+void wxMDIChildFrame::Maximize(bool maximize)
{
wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent();
if ( parent && parent->GetClientWindow() )
- ::SendMessage(GetWinHwnd(parent->GetClientWindow()), WM_MDIMAXIMIZE, (WPARAM) GetHwnd(), 0);
+ {
+ ::SendMessage(GetWinHwnd(parent->GetClientWindow()),
+ maximize ? WM_MDIMAXIMIZE : WM_MDIRESTORE,
+ (WPARAM)GetHwnd(), 0);
+ }
}
void wxMDIChildFrame::Restore()
{
wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent();
if ( parent && parent->GetClientWindow() )
- ::SendMessage(GetWinHwnd(parent->GetClientWindow()), WM_MDIRESTORE, (WPARAM) GetHwnd(), 0);
+ {
+ ::SendMessage(GetWinHwnd(parent->GetClientWindow()), WM_MDIRESTORE,
+ (WPARAM) GetHwnd(), 0);
+ }
}
void wxMDIChildFrame::Activate()
{
wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent();
if ( parent && parent->GetClientWindow() )
- ::SendMessage(GetWinHwnd(parent->GetClientWindow()), WM_MDIACTIVATE, (WPARAM) GetHwnd(), 0);
+ {
+ ::SendMessage(GetWinHwnd(parent->GetClientWindow()), WM_MDIACTIVATE,
+ (WPARAM) GetHwnd(), 0);
+ }
}
// ---------------------------------------------------------------------------
bool wxMDIChildFrame::MSWTranslateMessage(WXMSG* msg)
{
- MSG *pMsg = (MSG *)msg;
- if ( m_acceleratorTable.Ok() )
- {
- return ::TranslateAccelerator(GetWinHwnd(GetParent()),
- GetTableHaccel(m_acceleratorTable),
- pMsg) != 0;
- }
-
- return FALSE;
+ return m_acceleratorTable.Translate(GetParent(), msg);
}
// ---------------------------------------------------------------------------