X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8300f815fa5f0e9486d14b057ce8fdda5785549b..530ecef01f7e33c2ec1b8b1ad8025484709bef1d:/src/msw/wince/menuce.cpp diff --git a/src/msw/wince/menuce.cpp b/src/msw/wince/menuce.cpp index 7f4d51c3be..477b00dac1 100644 --- a/src/msw/wince/menuce.cpp +++ b/src/msw/wince/menuce.cpp @@ -17,10 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "menuce" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -28,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" @@ -38,16 +32,18 @@ #include "wx/menu.h" #endif //WX_PRECOMP -#if defined(__SMARTPHONE__) && defined(__WXWINCE__) - #include #include #include #include +#include +#include #include "wx/msw/wince/missing.h" #include "wx/msw/wince/resources.h" +#include "wx/stockitem.h" + wxTopLevelWindowMSW::ButtonMenu::ButtonMenu() { m_id = wxID_ANY; @@ -81,7 +77,10 @@ void wxTopLevelWindowMSW::ButtonMenu::SetButton(int id, const wxString& label, w { m_assigned = true; m_id = id; - m_label = label; + if(label.empty() && wxIsStockID(id)) + m_label = wxGetStockLabel(id, false); + else + m_label = label; m_menu = subMenu; } @@ -241,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)) @@ -257,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__