X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..1e9bafca0f56de34638d4c3fef8cf74fe9351193:/src/motif/menuitem.cpp?ds=sidebyside diff --git a/src/motif/menuitem.cpp b/src/motif/menuitem.cpp index 48755a9adb..c680eaeaad 100644 --- a/src/motif/menuitem.cpp +++ b/src/motif/menuitem.cpp @@ -6,17 +6,13 @@ // Created: 17/09/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWidgets licence +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ // declarations // ============================================================================ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "menuitem.h" -#endif - // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- @@ -162,7 +158,8 @@ wxMenuItem *wxMenuItemBase::New(wxMenu *parentMenu, // Motif-specific // ---------------------------------------------------------------------------- -void wxMenuItem::CreateItem (WXWidget menu, wxMenuBar * menuBar, wxMenu * topMenu) +void wxMenuItem::CreateItem (WXWidget menu, wxMenuBar * menuBar, + wxMenu * topMenu, size_t index) { m_menuBar = menuBar; m_topMenu = topMenu; @@ -181,12 +178,18 @@ void wxMenuItem::CreateItem (WXWidget menu, wxMenuBar * menuBar, wxMenu * topMen { m_buttonWidget = (WXWidget) XtVaCreateManagedWidget (strName, xmToggleButtonGadgetClass, (Widget) menu, +#ifdef XmNpositionIndex + XmNpositionIndex, index, +#endif NULL); XtVaSetValues ((Widget) m_buttonWidget, XmNset, (Boolean) IsChecked(), NULL); } else m_buttonWidget = (WXWidget) XtVaCreateManagedWidget (strName, xmPushButtonGadgetClass, (Widget) menu, +#ifdef XmNpositionIndex + XmNpositionIndex, index, +#endif NULL); char mnem = wxFindMnemonic (m_text); if (mnem != 0) @@ -229,11 +232,15 @@ void wxMenuItem::CreateItem (WXWidget menu, wxMenuBar * menuBar, wxMenu * topMen else if (GetId() == wxID_SEPARATOR) { m_buttonWidget = (WXWidget) XtVaCreateManagedWidget ("separator", - xmSeparatorGadgetClass, (Widget) menu, NULL); + xmSeparatorGadgetClass, (Widget) menu, +#ifndef XmNpositionIndex + XmNpositionIndex, index, +#endif + NULL); } else if (m_subMenu) { - m_buttonWidget = m_subMenu->CreateMenu (menuBar, menu, topMenu, m_text, TRUE); + m_buttonWidget = m_subMenu->CreateMenu (menuBar, menu, topMenu, index, m_text, true); m_subMenu->SetButtonWidget(m_buttonWidget); XtAddCallback ((Widget) m_buttonWidget, XmNcascadingCallback, @@ -334,7 +341,7 @@ void wxMenuItemCallback (Widget WXUNUSED(w), XtPointer clientData, if (item->IsCheckable()) { - Boolean isChecked = FALSE; + Boolean isChecked = false; XtVaGetValues ((Widget) item->GetButtonWidget(), XmNset, & isChecked, NULL);