#if wxUSE_MENUS
#include "wx/menu.h"
+#include "wx/stockitem.h"
#ifndef WX_PRECOMP
#include "wx/dynarray.h"
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);
void wxPopupMenuWindow::ChangeCurrent(wxMenuItemIter node)
{
- if ( node != m_nodeCurrent )
+ if ( !m_nodeCurrent || !node || (node != m_nodeCurrent) )
{
wxMenuItemIter nodeOldCurrent = m_nodeCurrent;
// the window (see below)
if ( node )
{
- if ( node != m_nodeCurrent )
+ if ( !m_nodeCurrent || (node != m_nodeCurrent) )
{
ChangeCurrent(node);
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();