]> git.saurik.com Git - wxWidgets.git/commitdiff
[ 1420190 ] Enable backspace key on smartphone
authorWłodzimierz Skiba <abx@abx.art.pl>
Tue, 31 Jan 2006 21:37:32 +0000 (21:37 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Tue, 31 Jan 2006 21:37:32 +0000 (21:37 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37251 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
include/wx/msw/toplevel.h
src/msw/wince/menuce.cpp

index bea540b67dd7154ec31c4bb27ac1d1d0796b87a2..abc5d2e84ccbfc7e880e18124cea6c1e6bfdc9bf 100644 (file)
@@ -179,6 +179,7 @@ wxWinCE:
 - Checkable items in wxToolMenuBarTool supported.
 - Fixed date formatting and mktime.
 - Fixed getting standard folder paths on WinCE.
+- Support for backspace key on smartphone.
 
 wxX11:
 
index 56c99693b46476458b460320183f811c97923a92..fb63cda2d9f51cd3e6bf330355bfccfca604f057 100644 (file)
@@ -84,6 +84,7 @@ public:
     virtual void SetLeftMenu(int id = wxID_ANY, const wxString& label = wxEmptyString, wxMenu *subMenu = NULL);
     virtual void SetRightMenu(int id = wxID_ANY, const wxString& label = wxEmptyString, wxMenu *subMenu = NULL);
     bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
+    virtual bool MSWShouldPreProcessMessage(WXMSG* pMsg);
 #endif // __SMARTPHONE__ && __WXWINCE__
 
 #if defined(__SMARTPHONE__) || defined(__POCKETPC__)
index 673d3648556227042d1976f6c765dffe6ab67e7e..18db3904041c1afc06f49ecc2440035df741cbcd 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 "wx/msw/wince/missing.h"
 
 #include "wx/msw/wince/resources.h"
@@ -242,6 +239,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 +259,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__