]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/menucmn.cpp
move Ellipsize() to wxControl so it can be easily used by other controls
[wxWidgets.git] / src / common / menucmn.cpp
index e97a419bd609a7877703a7d720d4ba18d9799f0e..37c0c127f11178e0866c10233995177382e16db6 100644 (file)
@@ -58,7 +58,8 @@ wxMenuItemBase::wxMenuItemBase(wxMenu *parentMenu,
                                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;
@@ -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)
 {
@@ -152,8 +160,6 @@ void wxMenuBase::Init(long style)
 wxMenuBase::~wxMenuBase()
 {
     WX_CLEAR_LIST(wxMenuItemList, m_items);
-
-    // Actually, in GTK, the submenus have to get deleted first.
 }
 
 // ----------------------------------------------------------------------------
@@ -465,7 +471,7 @@ bool wxMenuBase::SendEvent(int id, int checked)
             wxWindow *win = menu->GetInvokingWindow();
             if ( win )
             {
-                processed = win->GetEventHandler()->SafelyProcessEvent(event);
+                processed = win->HandleWindowEvent(event);
                 break;
             }
 
@@ -822,7 +828,7 @@ wxString wxMenuBarBase::GetHelpString(int id) const
     return item->GetHelp();
 }
 
-void wxMenuBarBase::UpdateMenus( void )
+void wxMenuBarBase::UpdateMenus()
 {
     wxEvtHandler* source;
     wxMenu* menu;