}
}
+#if wxUSE_MENUS_NATIVE
+
void wxMDIParentFrame::InternalSetMenuBar()
{
-// HMENU subMenu = GetSubMenu((HMENU) m_windowMenu, 0);
-
m_parentFrameActive = TRUE;
- HMENU subMenu = (HMENU) 0;
- if (GetWindowMenu())
- subMenu = (HMENU) GetWindowMenu()->GetHMenu();
+ wxMenu *menu = GetWindowMenu();
+ HMENU subMenu = menu ? GetHmenuOf(menu) : 0;
InsertWindowMenu(GetClientWindow(), m_hMenu, subMenu);
}
+#endif // wxUSE_MENUS_NATIVE
+
void wxMDIParentFrame::SetWindowMenu(wxMenu* menu)
{
if (m_windowMenu)
: wxDEFAULT_MDICHILDFRAME_ICON);
SetName(name);
+ wxWindowBase::Show(TRUE); // MDI child frame starts off shown
if ( id > -1 )
m_windowId = id;
else
mcs.cy = CW_USEDEFAULT;
- DWORD msflags = WS_OVERLAPPED | WS_CLIPCHILDREN;
+ DWORD msflags = WS_OVERLAPPED | WS_CLIPCHILDREN | WS_THICKFRAME | WS_VISIBLE ;
if (style & wxMINIMIZE_BOX)
msflags |= WS_MINIMIZEBOX;
if (style & wxMAXIMIZE_BOX)
break;
case WM_GETMINMAXINFO:
- // let the default window proc calculate the size of MDI children
- // frames because it is based on the size of the MDI client window,
- // not on the values specified in wxWindow m_min/max variables
- return MSWDefWindowProc(message, wParam, lParam);
+ processed = HandleGetMinMaxInfo((MINMAXINFO *)lParam);
+ break;
case WM_MDIACTIVATE:
{
parent->m_currentChild = NULL;
HMENU parent_menu = (HMENU)parent->GetWinMenu();
- if ( parent_menu )
+
+ // activate the the parent menu only when there is no other child
+ // that has been activated
+ if ( parent_menu && !hwndAct )
{
parent->m_parentFrameActive = TRUE;
return FALSE;
}
+bool wxMDIChildFrame::HandleGetMinMaxInfo(void *mmInfo)
+{
+ MINMAXINFO *info = (MINMAXINFO *)mmInfo;
+
+ // let the default window proc calculate the size of MDI children
+ // frames because it is based on the size of the MDI client window,
+ // not on the values specified in wxWindow m_max variables
+ bool processed = MSWDefWindowProc(WM_GETMINMAXINFO, 0, (LPARAM)mmInfo) != 0;
+
+ // but allow GetSizeHints() to set the min size
+ if ( m_minWidth != -1 )
+ {
+ info->ptMinTrackSize.x = m_minWidth;
+
+ processed = TRUE;
+ }
+
+ if ( m_minHeight != -1 )
+ {
+ info->ptMinTrackSize.y = m_minHeight;
+
+ processed = TRUE;
+ }
+
+ return TRUE;
+}
+
// ---------------------------------------------------------------------------
// MDI specific message translation/preprocessing
// ---------------------------------------------------------------------------
ccs.hWindowMenu = (HMENU) parent->GetWindowMenu()->GetHMenu();
ccs.idFirstChild = wxFIRST_MDI_CHILD;
- DWORD msStyle = /* MDIS_ALLCHILDSTYLES | */ WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN;
+ DWORD msStyle = MDIS_ALLCHILDSTYLES | WS_VISIBLE | WS_CHILD |
+ WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
+
if ( style & wxHSCROLL )
msStyle |= WS_HSCROLL;
if ( style & wxVSCROLL )
wxWindow *parent = win->GetParent();
wxCHECK_RET( parent, wxT("MDI client without parent frame? weird...") );
+#ifndef __WIN16__
::SendMessage(GetWinHwnd(win), WM_MDIREFRESHMENU, 0, 0L);
+#endif
+
::DrawMenuBar(GetWinHwnd(parent));
}