]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/wince/menuce.cpp
Implement wxRenderer::DrawRadioBitmap() for classic MSW renderer.
[wxWidgets.git] / src / msw / wince / menuce.cpp
index 673d3648556227042d1976f6c765dffe6ab67e7e..4b8c40057095670d49e920efc5cdbb0150509f3c 100644 (file)
@@ -24,9 +24,7 @@
     #pragma hdrstop
 #endif
 
-#ifndef WX_PRECOMP
-    #include "wx/wx.h"
-#endif
+#if defined(__SMARTPHONE__) && defined(__WXWINCE__)
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
     #include "wx/menu.h"
 #endif //WX_PRECOMP
 
-#if defined(__SMARTPHONE__) && defined(__WXWINCE__)
-
 #include <windows.h>
 #include <ole2.h>
 #include <shellapi.h>
 #include <aygshell.h>
+#include <tpcshell.h>
+#include <tpcuser.h>
 #include "wx/msw/wince/missing.h"
 
 #include "wx/msw/wince/resources.h"
@@ -80,7 +78,7 @@ void wxTopLevelWindowMSW::ButtonMenu::SetButton(int id, const wxString& label, w
     m_assigned = true;
     m_id = id;
     if(label.empty() && wxIsStockID(id))
-        m_label = wxGetStockLabel(id, false);
+        m_label = wxGetStockLabel(id, wxSTOCK_NOFLAGS);
     else
         m_label = label;
     m_menu = subMenu;
@@ -227,7 +225,7 @@ void wxTopLevelWindowMSW::ReloadAllButtons()
 
     if (!SHCreateMenuBar(&menu_bar))
     {
-        wxFAIL_MSG( _T("SHCreateMenuBar failed") );
+        wxFAIL_MSG( wxT("SHCreateMenuBar failed") );
         return;
     }
 
@@ -242,6 +240,10 @@ void wxTopLevelWindowMSW::ReloadAllButtons()
         ::ShowWindow( prev_MenuBar, SW_HIDE );
     ::ShowWindow( m_MenuBarHWND, SW_SHOW );
 
+    // Setup backspace key handling
+    SendMessage(m_MenuBarHWND, SHCMBM_OVERRIDEKEY, VK_TBACK,
+                MAKELPARAM( SHMBOF_NODEFAULT | SHMBOF_NOTIFY,
+                            SHMBOF_NODEFAULT | SHMBOF_NOTIFY ));
 }
 
 bool wxTopLevelWindowMSW::HandleCommand(WXWORD id, WXWORD WXUNUSED(cmd), WXHWND WXUNUSED(control))
@@ -258,5 +260,18 @@ bool wxTopLevelWindowMSW::HandleCommand(WXWORD id, WXWORD WXUNUSED(cmd), WXHWND
     return false;
 }
 
-#endif // __SMARTPHONE__ && __WXWINCE__
+bool wxTopLevelWindowMSW::MSWShouldPreProcessMessage(WXMSG* pMsg)
+{
+    MSG *msg = (MSG *)pMsg;
 
+    // Process back key to be like backspace.
+    if (msg->message == WM_HOTKEY)
+    {
+        if (HIWORD(msg->lParam) == VK_TBACK)
+            SHSendBackToFocusWindow(msg->message, msg->wParam, msg->lParam);
+    }
+
+    return wxTopLevelWindowBase::MSWShouldPreProcessMessage(pMsg);
+}
+
+#endif // __SMARTPHONE__ && __WXWINCE__