X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3b3dc8019a520ce5e166c8ae9098ba020f8b3f94..ccd67a6af88981a8c1a2b752a14051fe7698814b:/src/univ/menu.cpp diff --git a/src/univ/menu.cpp b/src/univ/menu.cpp index b1d27062f1..ba228442fa 100644 --- a/src/univ/menu.cpp +++ b/src/univ/menu.cpp @@ -26,6 +26,7 @@ #if wxUSE_MENUS #include "wx/menu.h" +#include "wx/stockitem.h" #ifndef WX_PRECOMP #include "wx/dynarray.h" @@ -122,7 +123,7 @@ class wxPopupMenuWindow : public wxPopupTransientWindow public: wxPopupMenuWindow(wxWindow *parent, wxMenu *menu); - ~wxPopupMenuWindow(); + virtual ~wxPopupMenuWindow(); // override the base class version to select the first item initially virtual void Popup(wxWindow *focus = NULL); @@ -346,7 +347,7 @@ void wxPopupMenuWindow::SetCurrentItem(wxMenuItemIter node) void wxPopupMenuWindow::ChangeCurrent(wxMenuItemIter node) { - if ( node != m_nodeCurrent ) + if ( !m_nodeCurrent || !node || (node != m_nodeCurrent) ) { wxMenuItemIter nodeOldCurrent = m_nodeCurrent; @@ -762,7 +763,7 @@ void wxPopupMenuWindow::ProcessMouseMove(const wxPoint& pt) // the window (see below) if ( node ) { - if ( node != m_nodeCurrent ) + if ( !m_nodeCurrent || (node != m_nodeCurrent) ) { ChangeCurrent(node); @@ -1542,6 +1543,7 @@ void wxMenuItem::SetText(const wxString& text) if ( text != m_text ) { // first call the base class version to change m_text + // (and also check if we don't have a stock menu item) wxMenuItemBase::SetText(text); UpdateAccelInfo();