]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/menucmn.cpp
Removed unnecessary code from utilsunx.cpp
[wxWidgets.git] / src / common / menucmn.cpp
index ff228f99dc6494a98c715f68e29ae20e95021bd5..2bfaaf2d8ac34487ac672c830928c7f2166de0bf 100644 (file)
@@ -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
 // ---------------------------------------------------------------------------