]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/menu.cpp
xti additions / changes, trying to reduce dependencies
[wxWidgets.git] / src / msw / menu.cpp
index e8c4c22ce1025cd7fa02c9ebb24ecf49e1d98d47..6f1343b30cbaa2665a936ed86b2a0f12867ec375 100644 (file)
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "menu.h"
 #endif
 
     #pragma implementation "menu.h"
 #endif
 
@@ -115,6 +115,23 @@ UINT GetMenuState(HMENU hMenu, UINT id, UINT flags)
 IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler)
 IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxWindow)
 
 IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler)
 IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxWindow)
 
+/*
+       TODO PROPERTIES
+               wxMenu
+                       label
+                       help
+
+               separator
+               break
+               label
+               accel
+               radio
+               checkable
+               help
+               bitmap
+               wxMenuItem
+*/
+
 // ---------------------------------------------------------------------------
 // wxMenu construction, adding and removing menu items
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 // wxMenu construction, adding and removing menu items
 // ---------------------------------------------------------------------------
@@ -649,6 +666,10 @@ void wxMenuBar::Refresh()
 
 WXHMENU wxMenuBar::Create()
 {
 
 WXHMENU wxMenuBar::Create()
 {
+    // Note: this totally doesn't work on Smartphone,
+    // since you have to use resources.
+    // We'll have to find another way to add a menu
+    // by changing/adding menu items to an existing menu.
 #ifdef __WXWINCE__
     if ( m_hMenu != 0 )
         return m_hMenu;
 #ifdef __WXWINCE__
     if ( m_hMenu != 0 )
         return m_hMenu;
@@ -673,9 +694,11 @@ WXHMENU wxMenuBar::Create()
             tbButton.dwData = (DWORD)hPopupMenu;
             wxString label = wxStripMenuCodes(GetLabelTop(i));
             tbButton.iString = (int) label.c_str();
             tbButton.dwData = (DWORD)hPopupMenu;
             wxString label = wxStripMenuCodes(GetLabelTop(i));
             tbButton.iString = (int) label.c_str();
+
+            int position = i;
             
             tbButton.idCommand = NewControlId();
             
             tbButton.idCommand = NewControlId();
-            if (!::SendMessage(hCommandBar, TB_INSERTBUTTON, i, (LPARAM)&tbButton))
+            if (!::SendMessage(hCommandBar, TB_INSERTBUTTON, position, (LPARAM)&tbButton))
             {
                 wxLogLastError(wxT("TB_INSERTBUTTON"));
             }
             {
                 wxLogLastError(wxT("TB_INSERTBUTTON"));
             }