git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58478
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// find the item by id in the frame menu bar: this is an internal function
// and exists mainly in order to be overridden in the MDI parent frame
// which also looks at its active child menu bar
// find the item by id in the frame menu bar: this is an internal function
// and exists mainly in order to be overridden in the MDI parent frame
// which also looks at its active child menu bar
- virtual const wxMenuItem *FindItemInMenuBar(int menuId) const;
+ virtual wxMenuItem *FindItemInMenuBar(int menuId) const;
// generate menu command corresponding to the given menu item
//
// generate menu command corresponding to the given menu item
//
// get the currently active menu: this is the same as the frame menu for
// normal frames but is overridden by wxMDIParentFrame
virtual WXHMENU MSWGetActiveMenu() const { return m_hMenu; }
// get the currently active menu: this is the same as the frame menu for
// normal frames but is overridden by wxMDIParentFrame
virtual WXHMENU MSWGetActiveMenu() const { return m_hMenu; }
-
- // find the item in our menu bar: this is again a hook for MDI frames
- virtual wxMenuItem *MSWFindMenuBarItem(WXWORD id);
#endif // wxUSE_MENUS
protected:
#endif // wxUSE_MENUS
protected:
#if wxUSE_MENUS
// override wxFrameBase function to also look in the active child menu bar
#if wxUSE_MENUS
// override wxFrameBase function to also look in the active child menu bar
- virtual const wxMenuItem *FindItemInMenuBar(int menuId) const;
- virtual wxMenuItem *MSWFindMenuBarItem(WXWORD id);
+ // and the "Window" menu
+ virtual wxMenuItem *FindItemInMenuBar(int menuId) const;
#endif // wxUSE_MENUS
protected:
#endif // wxUSE_MENUS
protected:
this->AttachMenuBar(menubar);
}
this->AttachMenuBar(menubar);
}
-const wxMenuItem *wxFrameBase::FindItemInMenuBar(int menuId) const
+wxMenuItem *wxFrameBase::FindItemInMenuBar(int menuId) const
{
const wxMenuBar * const menuBar = GetMenuBar();
{
const wxMenuBar * const menuBar = GetMenuBar();
if ( !wxCurrentPopupMenu )
#endif // wxUSE_MENUS_NATIVE
{
if ( !wxCurrentPopupMenu )
#endif // wxUSE_MENUS_NATIVE
{
- wxMenuItem * const mitem = MSWFindMenuBarItem(id);
+ wxMenuItem * const mitem = FindItemInMenuBar((signed short)id);
if ( mitem )
return ProcessCommand(mitem);
}
if ( mitem )
return ProcessCommand(mitem);
}
-wxMenuItem *wxFrame::MSWFindMenuBarItem(WXWORD id)
-{
- wxMenuBar * const mbar = GetMenuBar();
- return mbar ? mbar->FindItem((signed short)id) : NULL;
-}
-
bool wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu)
{
int item;
bool wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu)
{
int item;
-const wxMenuItem *wxMDIParentFrame::FindItemInMenuBar(int menuId) const
+wxMenuItem *wxMDIParentFrame::FindItemInMenuBar(int menuId) const
- const wxMenuItem *item = wxFrame::FindItemInMenuBar(menuId);
+ wxMenuItem *item = wxFrame::FindItemInMenuBar(menuId);
if ( !item && GetActiveChild() )
{
item = GetActiveChild()->FindItemInMenuBar(menuId);
}
if ( !item && GetActiveChild() )
{
item = GetActiveChild()->FindItemInMenuBar(menuId);
}
+ if ( !item && m_windowMenu )
+ item = m_windowMenu->FindItem(menuId);
+
::SendMessage(GetWinHwnd(GetClientWindow()), msg, wParam, lParam);
}
::SendMessage(GetWinHwnd(GetClientWindow()), msg, wParam, lParam);
}
-wxMenuItem *wxMDIParentFrame::MSWFindMenuBarItem(WXWORD id)
-{
- wxMenuItem *mitem = wxFrame::MSWFindMenuBarItem(id);
- if ( !mitem && m_windowMenu )
- mitem = m_windowMenu->FindItem((signed short)id);
-
- return mitem;
-}
-
#endif // wxUSE_MENUS
bool wxMDIParentFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd)
#endif // wxUSE_MENUS
bool wxMDIParentFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd)