X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ff0ea71ceacc214261f90946cfa7c9b5980c40fd..794bcc2dea743ac907b839f54e451847c9ea4b72:/src/common/menucmn.cpp?ds=sidebyside diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index ff228f99dc..2bfaaf2d8a 100644 --- a/src/common/menucmn.cpp +++ b/src/common/menucmn.cpp @@ -544,6 +544,26 @@ wxMenu *wxMenuBarBase::Remove(size_t pos) return menu; } +int wxMenuBarBase::FindMenu(const wxString& title) const +{ + wxString label = wxMenuItem::GetLabelFromText(title); + + size_t count = GetMenuCount(); + for ( size_t i = 0; i < count; i++ ) + { + wxString title2 = GetLabelTop(i); + if ( (title2 == title) || + (wxMenuItem::GetLabelFromText(title2) == label) ) + { + // found + return (int)i; + } + } + + return wxNOT_FOUND; + +} + // --------------------------------------------------------------------------- // wxMenuBar functions forwarded to wxMenuItem // ---------------------------------------------------------------------------