]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/menuitem.cpp
attempt to fix compilation for old imagehlp.h header
[wxWidgets.git] / src / msw / menuitem.cpp
index b9f3ca853fd7b25f93c8fc0427e9d7ca0625c142..e8f1c41df9358e453a786f7b6c756e10dd05f65c 100644 (file)
 
 #include "wx/msw/private.h"
 
+#ifdef __WXWINCE__
+// Implemented in menu.cpp
+UINT GetMenuState(HMENU hMenu, UINT id, UINT flags) ;
+#endif
+
 // ---------------------------------------------------------------------------
 // macro
 // ---------------------------------------------------------------------------
@@ -262,7 +267,7 @@ void wxMenuItem::Check(bool check)
 #endif // __WIN32__
 
         // also uncheck all the other items in this radio group
-        wxMenuItemList::Node *node = items.Item(start);
+        wxMenuItemList::compatibility_iterator node = items.Item(start);
         for ( int n = start; n <= end && node; n++ )
         {
             if ( n != pos )
@@ -342,12 +347,31 @@ void wxMenuItem::SetText(const wxString& text)
             data = (wxChar*) text.c_str();
         }
 
+#ifdef __WXWINCE__
+        // FIXME: complete this, applying the old
+        // flags.
+        // However, the WinCE doc for SetMenuItemInfo
+        // says that you can't use it to set the menu
+        // item state; only data, id and type.
+        MENUITEMINFO info;
+        wxZeroMemory(info);
+        info.cbSize = sizeof(info);
+        info.fMask = MIIM_TYPE;
+        info.fType = MFT_STRING;
+        info.cch = text.Length();
+        info.dwTypeData = (LPTSTR) data ;
+        if ( !SetMenuItemInfo(hMenu, id, FALSE, & info) )
+        {
+            wxLogLastError(wxT("SetMenuItemInfo"));
+        }
+#else
         if ( ::ModifyMenu(hMenu, id,
                           MF_BYCOMMAND | flagsOld,
                           id, data) == (int)0xFFFFFFFF )
         {
             wxLogLastError(wxT("ModifyMenu"));
         }
+#endif
     }
 }