projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Additions for webkit wrapper support.
[wxWidgets.git]
/
src
/
motif
/
menu.cpp
diff --git
a/src/motif/menu.cpp
b/src/motif/menu.cpp
index c0ab80701266fde768ca6ef92840e4ba78113416..82cea51b4c2a584776556933bb8e7681e99b8afa 100644
(file)
--- a/
src/motif/menu.cpp
+++ b/
src/motif/menu.cpp
@@
-14,7
+14,7
@@
// declarations
// ============================================================================
// declarations
// ============================================================================
-#if
def __GNUG__
+#if
defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "menu.h"
#endif
#pragma implementation "menu.h"
#endif
@@
-22,6
+22,9
@@
// headers
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
#include "wx/defs.h"
#include "wx/menu.h"
#include "wx/defs.h"
#include "wx/menu.h"
@@
-80,7
+83,7
@@
void wxMenu::Init()
if ( !!m_title )
{
if ( !!m_title )
{
- Append(
wxID_SEPARATOR
, m_title) ;
+ Append(
-3
, m_title) ;
AppendSeparator() ;
}
AppendSeparator() ;
}
@@
-114,12
+117,12
@@
void wxMenu::Break()
}
// function appends a new item or submenu to the menu
}
// 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
{
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() )
}
if ( pItem->IsSubMenu() )
@@
-137,14
+140,14
@@
wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
return wxMenuBase::DoRemove(item);
}
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) )
{
if ( wxMenuBase::DoInsert(pos, item) )
- return
TRUE
;
+ return
item
;
wxFAIL_MSG(wxT("DoInsert not implemented; or error in wxMenuBase::DoInsert"));
wxFAIL_MSG(wxT("DoInsert not implemented; or error in wxMenuBase::DoInsert"));
- return
FALSE
;
+ return
NULL
;
}
void wxMenu::SetTitle(const wxString& label)
}
void wxMenu::SetTitle(const wxString& label)
@@
-206,6
+209,17
@@
void wxMenuBar::Init()
m_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
}
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();
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->SetButtonWidget(w);
}
- //menu->SetMenuBar(this);
-
m_titles.Add(title);
return wxMenuBarBase::Append(menu, title);
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_menuWidget = (WXWidget) menu;
- m_menuBar = menuBar;
m_topLevelMenu = topMenu;
for ( wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst();
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,
}
// Destroys the Motif implementation of the menu,
-// but maintains the wxWi
ndow
s data structures so we can
+// but maintains the wxWi
dget
s data structures so we can
// do a CreateMenu again.
void wxMenu::DestroyMenu (bool full)
{
// do a CreateMenu again.
void wxMenu::DestroyMenu (bool full)
{