projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
reduce the margins around bitmaps to avoid truncating the label unnecessarily
[wxWidgets.git]
/
src
/
common
/
menucmn.cpp
diff --git
a/src/common/menucmn.cpp
b/src/common/menucmn.cpp
index fa0bfec3d72499d42a46bdcbe3455099e9decc3a..37c0c127f11178e0866c10233995177382e16db6 100644
(file)
--- a/
src/common/menucmn.cpp
+++ b/
src/common/menucmn.cpp
@@
-58,7
+58,8
@@
wxMenuItemBase::wxMenuItemBase(wxMenu *parentMenu,
wxItemKind kind,
wxMenu *subMenu)
{
wxItemKind kind,
wxMenu *subMenu)
{
- wxASSERT_MSG( parentMenu != NULL, wxT("menuitem should have a menu") );
+ // notice that parentMenu can be NULL: the item can be attached to the menu
+ // later with SetMenu()
m_parentMenu = parentMenu;
m_subMenu = subMenu;
m_parentMenu = parentMenu;
m_subMenu = subMenu;
@@
-67,7
+68,7
@@
wxMenuItemBase::wxMenuItemBase(wxMenu *parentMenu,
m_id = id;
m_kind = kind;
if (m_id == wxID_ANY)
m_id = id;
m_kind = kind;
if (m_id == wxID_ANY)
- m_id = wx
New
Id();
+ m_id = wx
Window::NewControl
Id();
if (m_id == wxID_SEPARATOR)
m_kind = wxITEM_SEPARATOR;
if (m_id == wxID_SEPARATOR)
m_kind = wxITEM_SEPARATOR;
@@
-125,6
+126,13
@@
void wxMenuItemBase::SetHelp(const wxString& str)
}
}
}
}
+#ifndef __WXPM__
+wxString wxMenuItemBase::GetLabelText(const wxString& text)
+{
+ return wxStripMenuCodes(text);
+}
+#endif
+
#if WXWIN_COMPATIBILITY_2_8
wxString wxMenuItemBase::GetLabelFromText(const wxString& text)
{
#if WXWIN_COMPATIBILITY_2_8
wxString wxMenuItemBase::GetLabelFromText(const wxString& text)
{
@@
-152,8
+160,6
@@
void wxMenuBase::Init(long style)
wxMenuBase::~wxMenuBase()
{
WX_CLEAR_LIST(wxMenuItemList, m_items);
wxMenuBase::~wxMenuBase()
{
WX_CLEAR_LIST(wxMenuItemList, m_items);
-
- // Actually, in GTK, the submenus have to get deleted first.
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
@@
-452,7
+458,7
@@
bool wxMenuBase::SendEvent(int id, int checked)
{
wxEvtHandler *handler = GetEventHandler();
if ( handler )
{
wxEvtHandler *handler = GetEventHandler();
if ( handler )
- processed = handler->ProcessEvent(event);
+ processed = handler->
Safely
ProcessEvent(event);
}
// Try the window the menu was popped up from (and up through the
}
// Try the window the menu was popped up from (and up through the
@@
-465,7
+471,7
@@
bool wxMenuBase::SendEvent(int id, int checked)
wxWindow *win = menu->GetInvokingWindow();
if ( win )
{
wxWindow *win = menu->GetInvokingWindow();
if ( win )
{
- processed = win->
GetEventHandler()->Process
Event(event);
+ processed = win->
HandleWindow
Event(event);
break;
}
break;
}
@@
-822,7
+828,7
@@
wxString wxMenuBarBase::GetHelpString(int id) const
return item->GetHelp();
}
return item->GetHelp();
}
-void wxMenuBarBase::UpdateMenus(
void
)
+void wxMenuBarBase::UpdateMenus()
{
wxEvtHandler* source;
wxMenu* menu;
{
wxEvtHandler* source;
wxMenu* menu;
@@
-848,9
+854,8
@@
void wxMenuBarBase::SetLabelTop(size_t pos, const wxString& label)
wxString wxMenuBarBase::GetLabelTop(size_t pos) const
{
wxString wxMenuBarBase::GetLabelTop(size_t pos) const
{
- return GetMenuLabel(pos);
+ return GetMenuLabel
Text
(pos);
}
#endif
}
#endif
-
#endif // wxUSE_MENUS
#endif // wxUSE_MENUS