X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0253bbbabc68c9e1fbb9bed2668b5bfcf8c458ff..6abf7b639c8f6827c7784d5707ea4733a375d4eb:/include/wx/menu.h diff --git a/include/wx/menu.h b/include/wx/menu.h index 466d50675a..8914432b71 100644 --- a/include/wx/menu.h +++ b/include/wx/menu.h @@ -27,6 +27,7 @@ // included wx/menu.h #include "wx/menuitem.h" +class WXDLLIMPEXP_FWD_CORE wxFrame; class WXDLLIMPEXP_FWD_CORE wxMenu; class WXDLLIMPEXP_FWD_CORE wxMenuBarBase; class WXDLLIMPEXP_FWD_CORE wxMenuBar; @@ -254,9 +255,17 @@ public: void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; } wxEvtHandler *GetEventHandler() const { return m_eventHandler; } - // invoking window - void SetInvokingWindow(wxWindow *win) { m_invokingWindow = win; } - wxWindow *GetInvokingWindow() const { return m_invokingWindow; } + // Invoking window: this is set by wxWindow::PopupMenu() before showing a + // popup menu and reset after it's hidden. Notice that GetInvokingWindow() + // recurses upwards and will return the invoking window for any submenu of + // a popup menu as well as the menu itself. + void SetInvokingWindow(wxWindow *win); + wxWindow *GetInvokingWindow() const; + + // the window associated with this menu: this is the invoking window for + // popup menus or the top level window to which the menu bar is attached + // for menus which are part of a menu bar + wxWindow *GetWindow() const; // style long GetStyle() const { return m_style; } @@ -499,7 +508,7 @@ public: #if WXWIN_COMPATIBILITY_2_8 // get or change the label of the menu at given position // Deprecated in favour of SetMenuLabel - wxDEPRECATED( void SetLabelTop(size_t pos, const wxString& label) ); + wxDEPRECATED( void SetLabelTop(size_t pos, const wxString& label) ); // Deprecated in favour of GetMenuLabelText wxDEPRECATED( wxString GetLabelTop(size_t pos) const ); #endif