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:
parent
faffacecc4
commit
6aca462878
@ -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
|
||||
|
@ -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();
|
||||
|
@ -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() )
|
||||
|
Loading…
Reference in New Issue
Block a user