]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/menu.cpp
check that the version of __sync_sub_and_fetch that returns a value is supported...
[wxWidgets.git] / src / motif / menu.cpp
index 00637cc3b87e0f43b673eda95710444da19227c6..ed09c4e47d63e8425663b8fb0c68b3b293efec4a 100644 (file)
@@ -167,7 +167,7 @@ bool wxMenu::ProcessCommand(wxCommandEvent & event)
     // Try the menu's event handler
     if ( !processed && GetEventHandler())
     {
-        processed = GetEventHandler()->ProcessEvent(event);
+        processed = HandleWindowEvent(event);
     }
     // Try the window the menu was popped up from (and up
     // through the hierarchy)
@@ -221,7 +221,7 @@ void wxMenuBar::EnableTop(size_t WXUNUSED(pos), bool WXUNUSED(flag))
 //  wxLogWarning("wxMenuBar::EnableTop not yet implemented.");
 }
 
-void wxMenuBar::SetLabelTop(size_t pos, const wxString& label)
+void wxMenuBar::SetMenuLabel(size_t pos, const wxString& label)
 {
     wxMenu *menu = GetMenu(pos);
     if ( !menu )
@@ -236,26 +236,14 @@ void wxMenuBar::SetLabelTop(size_t pos, const wxString& label)
                       XmNlabelString, label_str(),
                       NULL);
     }
+    m_titles[pos] = label;
 }
 
-wxString wxMenuBar::GetLabelTop(size_t pos) const
+wxString wxMenuBar::GetMenuLabel(size_t pos) const
 {
-    wxMenu *menu = GetMenu(pos);
-    if ( menu )
-    {
-        Widget w = (Widget)menu->GetButtonWidget();
-        if (w)
-        {
-            XmString text;
-            XtVaGetValues(w,
-                          XmNlabelString, &text,
-                          NULL);
-
-            return wxXmStringToString( text );
-        }
-    }
-
-    return wxEmptyString;
+    wxCHECK_MSG( pos < GetMenuCount(), wxEmptyString,
+                 wxT("invalid menu index in wxMenuBar::GetMenuLabel") );
+    return m_titles[pos];
 }
 
 bool wxMenuBar::Append(wxMenu * menu, const wxString& title)