m_topLevelMenu = (wxMenu*) NULL;
m_ownedByMenuBar = false;
- if ( !!m_title )
+ if ( !m_title.empty() )
{
Append(-3, m_title) ;
AppendSeparator() ;
{
bool processed = false;
-#if wxUSE_MENU_CALLBACK
- // Try a callback
- if (m_callback)
- {
- (void) (*(m_callback)) (*this, event);
- processed = true;
- }
-#endif // wxUSE_MENU_CALLBACK
-
// Try the menu's event handler
if ( !processed && GetEventHandler())
{
wxMenuBar::wxMenuBar(size_t n, wxMenu *menus[], const wxArrayString& titles, long WXUNUSED(style))
{
- wxASSERT( size_t(n) == titles.GetCount() );
+ wxASSERT( n == titles.GetCount() );
Init();
m_titles = titles;
- for ( int i = 0; i < n; i++ )
+ for ( size_t i = 0; i < n; i++ )
m_menus.Append(menus[i]);
}
return true;
}
- Widget menuBarW = XmCreateMenuBar ((Widget) parent->GetMainWidget(), "MenuBar", NULL, 0);
+ Widget menuBarW = XmCreateMenuBar ((Widget) parent->GetMainWidget(),
+ wxMOTIF_STR("MenuBar"), NULL, 0);
m_mainWidget = (WXWidget) menuBarW;
size_t menuCount = GetMenuCount();
if (!pullDown)
{
- menu = XmCreatePopupMenu ((Widget) parent, "popup", args, 2);
+ menu = XmCreatePopupMenu ((Widget) parent, wxMOTIF_STR("popup"), args, 2);
#if 0
XtAddCallback(menu,
XmNunmapCallback,
else
{
char mnem = wxFindMnemonic (title);
- menu = XmCreatePulldownMenu ((Widget) parent, "pulldown", args, 2);
+ menu = XmCreatePulldownMenu ((Widget) parent, wxMOTIF_STR("pulldown"), args, 2);
wxString title2(wxStripMenuCodes(title));
wxXmString label_str(title2);
void wxMenu::ChangeFont(bool keepOriginalSize)
{
- // Lesstif 0.87 hangs here, but 0.93 does not
-#if !wxCHECK_LESSTIF() || wxCHECK_LESSTIF_VERSION( 0, 93 )
+ // Lesstif 0.87 hangs here, but 0.93 does not; MBN: sometimes it does
+#if !wxCHECK_LESSTIF() // || wxCHECK_LESSTIF_VERSION( 0, 93 )
if (!m_font.Ok() || !m_menuWidget)
return;
- WXFontType fontType = m_font.GetFontType(XtDisplay((Widget) m_menuWidget));
+ Display* dpy = XtDisplay((Widget) m_menuWidget);
XtVaSetValues ((Widget) m_menuWidget,
- wxFont::GetFontTag(), fontType,
+ wxFont::GetFontTag(), m_font.GetFontTypeC(dpy),
NULL);
if (m_buttonWidget)
{
XtVaSetValues ((Widget) m_buttonWidget,
- wxFont::GetFontTag(), fontType,
+ wxFont::GetFontTag(), m_font.GetFontTypeC(dpy),
NULL);
}
if (m_menuWidget && item->GetButtonWidget() && m_font.Ok())
{
XtVaSetValues ((Widget) item->GetButtonWidget(),
- wxFont::GetFontTag(), fontType,
+ wxFont::GetFontTag(), m_font.GetFontTypeC(dpy),
NULL);
}
if (item->GetSubMenu())