]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/menu_osx.cpp
Implement wxMenuBar::EnableTop() for wxMSW and wxGTK.
[wxWidgets.git] / src / osx / menu_osx.cpp
index da7d66545a7e11ca6b1ffaf57ea1c394624109ca..e36c6901c78a76f12b2097d970740bd5182ac69a 100644 (file)
@@ -833,6 +833,17 @@ void wxMenuBar::EnableTop(size_t pos, bool enable)
     Refresh();
 }
 
+bool wxMenuBar::IsEnabledTop(size_t pos) const
+{
+    wxCHECK_MSG( IsAttached(), true,
+                 wxT("doesn't work with unattached menubars") );
+
+    wxMenuItem* const item = m_rootMenu->FindItemByPosition(pos+firstMenuPos);
+    wxCHECK_MSG( item, false, wxT("invalid menu index") );
+
+    return item->IsEnabled();
+}
+
 bool wxMenuBar::Enable(bool enable)
 {
     wxCHECK_MSG( IsAttached(), false, wxT("doesn't work with unattached menubars") );