X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9add93670bb4a38e4007b8422b34b29b6194eecb..31ad423e4fb556ec225a63b161154d3bf3445c1b:/include/wx/menu.h diff --git a/include/wx/menu.h b/include/wx/menu.h index 05cfe3948d..01634e23c5 100644 --- a/include/wx/menu.h +++ b/include/wx/menu.h @@ -5,7 +5,7 @@ // Modified by: // Created: 26.10.99 // RCS-ID: $Id$ -// Copyright: (c) wxWindows team +// Copyright: (c) wxWidgets team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -272,15 +272,15 @@ public: void UpdateUI(wxEvtHandler* source = (wxEvtHandler*)NULL); // get the menu bar this menu is attached to (may be NULL, always NULL for - // popup menus) - wxMenuBar *GetMenuBar() const { return m_menuBar; } + // popup menus). Traverse up the menu hierarchy to find it. + wxMenuBar *GetMenuBar() const; // called when the menu is attached/detached to/from a menu bar virtual void Attach(wxMenuBarBase *menubar); virtual void Detach(); // is the menu attached to a menu bar (or is it a popup one)? - bool IsAttached() const { return m_menuBar != NULL; } + bool IsAttached() const { return GetMenuBar() != NULL; } // set/get the parent of this menu void SetParent(wxMenu *parent) { m_menuParent = parent; } @@ -330,6 +330,11 @@ public: Insert(0u, itemid, text, help, isCheckable); } + static void LockAccels(bool locked) + { + ms_locked = locked; + } + protected: // virtuals to override in derived classes // --------------------------------------- @@ -362,6 +367,8 @@ protected: wxEvtHandler *m_eventHandler; // a pluggable in event handler + static bool ms_locked; + DECLARE_NO_COPY_CLASS(wxMenuBase) };