[ 1420190 ] Enable backspace key on smartphone

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37251 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2006-01-31 21:37:32 +00:00
parent 6fc07dd8c0
commit 96dcd41a12
3 changed files with 22 additions and 6 deletions

View File

@@ -179,6 +179,7 @@ wxWinCE:
- Checkable items in wxToolMenuBarTool supported. - Checkable items in wxToolMenuBarTool supported.
- Fixed date formatting and mktime. - Fixed date formatting and mktime.
- Fixed getting standard folder paths on WinCE. - Fixed getting standard folder paths on WinCE.
- Support for backspace key on smartphone.
wxX11: wxX11:

View File

@@ -84,6 +84,7 @@ public:
virtual void SetLeftMenu(int id = wxID_ANY, const wxString& label = wxEmptyString, wxMenu *subMenu = NULL); 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); virtual void SetRightMenu(int id = wxID_ANY, const wxString& label = wxEmptyString, wxMenu *subMenu = NULL);
bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control); bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
virtual bool MSWShouldPreProcessMessage(WXMSG* pMsg);
#endif // __SMARTPHONE__ && __WXWINCE__ #endif // __SMARTPHONE__ && __WXWINCE__
#if defined(__SMARTPHONE__) || defined(__POCKETPC__) #if defined(__SMARTPHONE__) || defined(__POCKETPC__)

View File

@@ -24,9 +24,7 @@
#pragma hdrstop #pragma hdrstop
#endif #endif
#ifndef WX_PRECOMP #if defined(__SMARTPHONE__) && defined(__WXWINCE__)
#include "wx/wx.h"
#endif
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/app.h" #include "wx/app.h"
@@ -34,12 +32,11 @@
#include "wx/menu.h" #include "wx/menu.h"
#endif //WX_PRECOMP #endif //WX_PRECOMP
#if defined(__SMARTPHONE__) && defined(__WXWINCE__)
#include <windows.h> #include <windows.h>
#include <ole2.h> #include <ole2.h>
#include <shellapi.h> #include <shellapi.h>
#include <aygshell.h> #include <aygshell.h>
#include <tpcshell.h>
#include "wx/msw/wince/missing.h" #include "wx/msw/wince/missing.h"
#include "wx/msw/wince/resources.h" #include "wx/msw/wince/resources.h"
@@ -242,6 +239,10 @@ void wxTopLevelWindowMSW::ReloadAllButtons()
::ShowWindow( prev_MenuBar, SW_HIDE ); ::ShowWindow( prev_MenuBar, SW_HIDE );
::ShowWindow( m_MenuBarHWND, SW_SHOW ); ::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)) 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; 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__