X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9add93670bb4a38e4007b8422b34b29b6194eecb..f8b2997476e15b63f1699b9f7b6f1db2ae6b440c:/src/motif/menu.cpp diff --git a/src/motif/menu.cpp b/src/motif/menu.cpp index c85dea8e74..82cea51b4c 100644 --- a/src/motif/menu.cpp +++ b/src/motif/menu.cpp @@ -22,6 +22,9 @@ // headers // ---------------------------------------------------------------------------- +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + #include "wx/defs.h" #include "wx/menu.h" @@ -80,7 +83,7 @@ void wxMenu::Init() if ( !!m_title ) { - Append(wxID_SEPARATOR, m_title) ; + Append(-3, m_title) ; AppendSeparator() ; } @@ -119,7 +122,7 @@ wxMenuItem* wxMenu::DoAppend(wxMenuItem *pItem) if (m_menuWidget) { // this is a dynamic Append - pItem->CreateItem(m_menuWidget, m_menuBar, m_topLevelMenu); + pItem->CreateItem(m_menuWidget, GetMenuBar(), m_topLevelMenu); } if ( pItem->IsSubMenu() ) @@ -206,6 +209,17 @@ void wxMenuBar::Init() m_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); } +wxMenuBar::wxMenuBar(int n, wxMenu *menus[], const wxArrayString& titles) +{ + wxASSERT( size_t(n) == titles.GetCount() ); + + Init(); + + m_titles = titles; + for ( int i = 0; i < n; i++ ) + m_menus.Append(menus[i]); +} + wxMenuBar::wxMenuBar(int n, wxMenu *menus[], const wxString titles[]) { Init(); @@ -278,8 +292,6 @@ bool wxMenuBar::Append(wxMenu * menu, const wxString& title) menu->SetButtonWidget(w); } - //menu->SetMenuBar(this); - m_titles.Add(title); return wxMenuBarBase::Append(menu, title); @@ -511,7 +523,6 @@ WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar, WXWidget parent, wxMenu * topM m_menuWidget = (WXWidget) menu; - m_menuBar = menuBar; m_topLevelMenu = topMenu; for ( wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst(); @@ -531,7 +542,7 @@ WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar, WXWidget parent, wxMenu * topM } // Destroys the Motif implementation of the menu, -// but maintains the wxWindows data structures so we can +// but maintains the wxWidgets data structures so we can // do a CreateMenu again. void wxMenu::DestroyMenu (bool full) {