#ifdef __VMS__
#pragma message disable nosimpint
-#define XtDisplay XTDISPLAY
-#define XtWindow XTWINDOW
#endif
#include <Xm/Label.h>
#include <Xm/LabelG.h>
bool wxMenu::ProcessCommand(wxCommandEvent & event)
{
- bool processed = false;
+ // Try the menu's event handler first
+ wxEvtHandler * const handler = GetEventHandler();
+ bool processed = handler ? handler->SafelyProcessEvent(event) : false;
- // Try the menu's event handler
- if ( !processed && GetEventHandler())
- {
- processed = GetEventHandler()->ProcessEvent(event);
- }
// Try the window the menu was popped up from (and up
// through the hierarchy)
if ( !processed && GetInvokingWindow())
- processed = GetInvokingWindow()->ProcessEvent(event);
+ processed = GetInvokingWindow()->HandleWindowEvent(event);
return processed;
}
// 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 )
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)