/////////////////////////////////////////////////////////////////////////////
-// Name: mdi.cpp
-// Purpose: MDI classes
+// Name: src/msw/mdi.cpp
+// Purpose: MDI classes for wxMSW
// Author: Julian Smart
// Modified by:
// Created: 04/01/98
}
}
-void wxMDIParentFrame::OnSize(wxSizeEvent& event)
+void wxMDIParentFrame::OnSize(wxSizeEvent&)
{
if ( GetClientWindow() )
{
if (!pChild || (pChild == this))
{
HWND hwndClient = GetWinHwnd(pFrameWnd->GetClientWindow());
- DWORD dwStyle = ::GetWindowLong(hwndClient, GWL_STYLE);
- DWORD dwThisStyle = ::GetWindowLong(GetHwnd(), GWL_STYLE);
+ DWORD dwStyle = ::GetWindowLong(hwndClient, GWL_EXSTYLE);
+
+ // we want to test whether there is a maximized child, so just set
+ // dwThisStyle to 0 if there is no child at all
+ DWORD dwThisStyle = pChild
+ ? ::GetWindowLong(GetWinHwnd(pChild), GWL_STYLE) : NULL;
DWORD dwNewStyle = dwStyle;
- if (pChild != NULL && (dwThisStyle & WS_MAXIMIZE))
+ if ( dwThisStyle & WS_MAXIMIZE )
dwNewStyle &= ~(WS_EX_CLIENTEDGE);
else
dwNewStyle |= WS_EX_CLIENTEDGE;
ccs.hWindowMenu = (HMENU) parent->GetWindowMenu()->GetHMenu();
ccs.idFirstChild = wxFIRST_MDI_CHILD;
- DWORD msStyle = WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN;
+ DWORD msStyle = MDIS_ALLCHILDSTYLES | WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN;
if ( style & wxHSCROLL )
msStyle |= WS_HSCROLL;
if ( style & wxVSCROLL )
wxWindow *parent = win->GetParent();
wxCHECK_RET( parent, wxT("MDI client without parent frame? weird...") );
+ ::SendMessage(GetWinHwnd(win), WM_MDIREFRESHMENU, 0, 0L);
::DrawMenuBar(GetWinHwnd(parent));
}
// Try to insert Window menu in front of Help, otherwise append it.
HMENU hmenu = (HMENU)menu;
int N = GetMenuItemCount(hmenu);
- bool success = FALSE;
for ( int i = 0; i < N; i++ )
{
wxChar buf[256];
if ( wxStripMenuCodes(wxString(buf)).IsSameAs(_("Window")) )
{
- success = TRUE;
::RemoveMenu(hmenu, i, MF_BYPOSITION);
break;
}