refresh the MDI frame window menu whenever a child frame is shown/hidden (and not only when its menu bar is changed as this means that the menu is never refreshed if the child frame has no menu)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36749 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -807,6 +807,11 @@ bool wxMDIChildFrame::Show(bool show)
|
|||||||
if ( show )
|
if ( show )
|
||||||
::BringWindowToTop(GetHwnd());
|
::BringWindowToTop(GetHwnd());
|
||||||
|
|
||||||
|
// we need to refresh the MDI frame window menu to include (or exclude if
|
||||||
|
// we've been hidden) this frame
|
||||||
|
wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent();
|
||||||
|
MDISetMenu(parent->GetClientWindow(), NULL, NULL);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1373,8 +1378,16 @@ void wxMDIChildFrame::OnIdle(wxIdleEvent& event)
|
|||||||
|
|
||||||
static void MDISetMenu(wxWindow *win, HMENU hmenuFrame, HMENU hmenuWindow)
|
static void MDISetMenu(wxWindow *win, HMENU hmenuFrame, HMENU hmenuWindow)
|
||||||
{
|
{
|
||||||
::SendMessage(GetWinHwnd(win), WM_MDISETMENU,
|
if ( hmenuFrame || hmenuWindow )
|
||||||
(WPARAM)hmenuFrame, (LPARAM)hmenuWindow);
|
{
|
||||||
|
if ( !::SendMessage(GetWinHwnd(win),
|
||||||
|
WM_MDISETMENU,
|
||||||
|
(WPARAM)hmenuFrame,
|
||||||
|
(LPARAM)hmenuWindow) )
|
||||||
|
{
|
||||||
|
wxLogLastError(_T("SendMessage(WM_MDISETMENU)"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// update menu bar of the parent window
|
// update menu bar of the parent window
|
||||||
wxWindow *parent = win->GetParent();
|
wxWindow *parent = win->GetParent();
|
||||||
|
Reference in New Issue
Block a user