#if wxUSE_MENUS
+#include "wx/menu.h"
+
#ifndef WX_PRECOMP
#include "wx/dynarray.h"
#include "wx/control.h" // for FindAccelIndex()
- #include "wx/menu.h"
#include "wx/settings.h"
#include "wx/accel.h"
#include "wx/log.h"
+ #include "wx/frame.h"
+ #include "wx/dcclient.h"
#endif // WX_PRECOMP
#include "wx/popupwin.h"
#include "wx/evtloop.h"
-#include "wx/dcclient.h"
-#include "wx/frame.h"
#include "wx/univ/renderer.h"
void wxPopupMenuWindow::ChangeCurrent(wxMenuItemIter node)
{
- if ( node != m_nodeCurrent )
+ if ( !m_nodeCurrent || (node != m_nodeCurrent) )
{
wxMenuItemIter nodeOldCurrent = m_nodeCurrent;
{
// return the last node if there had been no previously selected one
return m_nodeCurrent ? GetPrevNode(m_nodeCurrent)
- : m_menu->GetMenuItems().GetLast();
+ : wxMenuItemIter(m_menu->GetMenuItems().GetLast());
}
wxMenuItemIter
{
// return the first node if there had been no previously selected one
return m_nodeCurrent ? GetNextNode(m_nodeCurrent)
- : m_menu->GetMenuItems().GetFirst();
+ : wxMenuItemIter(m_menu->GetMenuItems().GetFirst());
}
wxMenuItemIter
// the window (see below)
if ( node )
{
- if ( node != m_nodeCurrent )
+ if ( !m_nodeCurrent || (node != m_nodeCurrent) )
{
ChangeCurrent(node);