X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4055ed8281971e3d35bf04177193c27043d42ed1..9a62fa17b1c342b5b1e1bb9b96373e170a9d8b6f:/include/wx/menu.h diff --git a/include/wx/menu.h b/include/wx/menu.h index ba9f52ea93..f03dc59acb 100644 --- a/include/wx/menu.h +++ b/include/wx/menu.h @@ -12,10 +12,6 @@ #ifndef _WX_MENU_H_BASE_ #define _WX_MENU_H_BASE_ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "menubase.h" -#endif - #include "wx/defs.h" #if wxUSE_MENUS @@ -91,12 +87,11 @@ public: } // append a submenu - wxMenuItem* Append(int itemid, - const wxString& text, - wxMenu *submenu, - const wxString& help = wxEmptyString) + wxMenuItem* AppendSubMenu(wxMenu *submenu, + const wxString& text, + const wxString& help = wxEmptyString) { - return DoAppend(wxMenuItem::New((wxMenu *)this, itemid, text, help, + return DoAppend(wxMenuItem::New((wxMenu *)this, wxID_ANY, text, help, wxITEM_NORMAL, submenu)); } @@ -313,6 +308,16 @@ public: Append(itemid, text, help, isCheckable ? wxITEM_CHECK : wxITEM_NORMAL); } + // use more readable and not requiring unused itemid AppendSubMenu() instead + wxMenuItem* Append(int itemid, + const wxString& text, + wxMenu *submenu, + const wxString& help = wxEmptyString) + { + return DoAppend(wxMenuItem::New((wxMenu *)this, itemid, text, help, + wxITEM_NORMAL, submenu)); + } + void Insert(size_t pos, int itemid, const wxString& text, @@ -450,6 +455,7 @@ public: void Check(int itemid, bool check); bool IsChecked(int itemid) const; bool IsEnabled(int itemid) const; + virtual bool IsEnabled() const { return wxWindow::IsEnabled(); } void SetLabel(int itemid, const wxString &label); wxString GetLabel(int itemid) const; @@ -479,6 +485,9 @@ public: // don't want menu bars to accept the focus by tabbing to them virtual bool AcceptsFocusFromKeyboard() const { return false; } + // update all menu item states in all menus + virtual void UpdateMenus(); + protected: // the list of all our menus wxMenuList m_menus; @@ -504,8 +513,10 @@ protected: #include "wx/msw/menu.h" #elif defined(__WXMOTIF__) #include "wx/motif/menu.h" -#elif defined(__WXGTK__) +#elif defined(__WXGTK20__) #include "wx/gtk/menu.h" +#elif defined(__WXGTK__) + #include "wx/gtk1/menu.h" #elif defined(__WXMAC__) #include "wx/mac/menu.h" #elif defined(__WXCOCOA__)