]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/menu.cpp
Combine two wxImage-to-pixmap creation functions into one.
[wxWidgets.git] / src / univ / menu.cpp
index 80023293d8314af45d79022ca1b4c637a1f5d665..e25a936355256ba230bb8fa73d1e7157ad918ba0 100644 (file)
 
 #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/univ/renderer.h"
 
@@ -345,7 +346,7 @@ void wxPopupMenuWindow::SetCurrentItem(wxMenuItemIter node)
 
 void wxPopupMenuWindow::ChangeCurrent(wxMenuItemIter node)
 {
-    if ( node != m_nodeCurrent )
+    if ( !m_nodeCurrent || (node != m_nodeCurrent) )
     {
         wxMenuItemIter nodeOldCurrent = m_nodeCurrent;
 
@@ -761,7 +762,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);