mdi menu updates fixed (after SF 1012653)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28985 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Chris Elliott 2004-09-01 09:16:21 +00:00
parent faffacecc4
commit 6aca462878
3 changed files with 31 additions and 2 deletions

View File

@ -157,7 +157,7 @@ public:
// send wxUpdateUIEvents for all menu items in the menubar,
// or just for menu if non-NULL
void DoMenuUpdates(wxMenu* menu = NULL);
virtual void DoMenuUpdates(wxMenu* menu = NULL);
#endif // wxUSE_MENUS
// do the UI update processing for this window

View File

@ -69,7 +69,8 @@ public:
// MDI windows menu
wxMenu* GetWindowMenu() const { return m_windowMenu; };
void SetWindowMenu(wxMenu* menu) ;
virtual void DoMenuUpdates(wxMenu* menu = NULL);
// MDI operations
// --------------
virtual void Cascade();

View File

@ -300,6 +300,34 @@ void wxMDIParentFrame::SetWindowMenu(wxMenu* menu)
}
}
void wxMDIParentFrame::DoMenuUpdates(wxMenu* menu)
{
wxMDIChildFrame *child = GetActiveChild();
if ( child )
{
wxEvtHandler* source = child->GetEventHandler();
wxMenuBar* bar = child->GetMenuBar();
if (menu)
{
menu->UpdateUI(source);
}
else
{
if ( bar != NULL )
{
int nCount = bar->GetMenuCount();
for (int n = 0; n < nCount; n++)
bar->GetMenu(n)->UpdateUI(source);
}
}
}
else
{
wxFrameBase::DoMenuUpdates(menu);
}
}
void wxMDIParentFrame::OnSize(wxSizeEvent&)
{
if ( GetClientWindow() )