// headers
// ----------------------------------------------------------------------------
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
#include "wx/defs.h"
#include "wx/menu.h"
if ( !!m_title )
{
- Append(wxID_SEPARATOR, m_title) ;
+ Append(-3, m_title) ;
AppendSeparator() ;
}
}
// function appends a new item or submenu to the menu
-bool wxMenu::DoAppend(wxMenuItem *pItem)
+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() )
return wxMenuBase::DoRemove(item);
}
-bool wxMenu::DoInsert(size_t pos, wxMenuItem *item)
+wxMenuItem* wxMenu::DoInsert(size_t pos, wxMenuItem *item)
{
if ( wxMenuBase::DoInsert(pos, item) )
- return TRUE;
+ return item;
wxFAIL_MSG(wxT("DoInsert not implemented; or error in wxMenuBase::DoInsert"));
- return FALSE;
+ return NULL;
}
void wxMenu::SetTitle(const wxString& label)
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();
menu->SetButtonWidget(w);
}
- //menu->SetMenuBar(this);
-
m_titles.Add(title);
return wxMenuBarBase::Append(menu, title);
m_menuWidget = (WXWidget) menu;
- m_menuBar = menuBar;
m_topLevelMenu = topMenu;
for ( wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst();
}
// 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)
{