#if defined(__WXWINCE__)
#include "wx/msw/wince/missing.h"
+#ifdef __POCKETPC__
+ #include <windows.h>
+ #include <shellapi.h>
+ #include <ole2.h>
+ #include <aygshell.h>
+#endif
#endif
#if defined(TME_LEAVE) && defined(WM_MOUSELEAVE)
m_pendingPosition = wxDefaultPosition;
m_pendingSize = wxDefaultSize;
+
+#ifdef __POCKETPC__
+ m_contextMenuEnabled = false;
+#endif
}
// Destructor
return false;
}
- if ( m_cursor.Ok() )
+ // don't "overwrite" busy cursor
+ if ( m_cursor.Ok() && !wxIsBusy() )
{
- HWND hWnd = GetHwnd();
-
- // Change the cursor NOW if we're within the correct window
- POINT point;
-#ifdef __WXWINCE__
- ::GetCursorPosWinCE(&point);
-#else
- ::GetCursorPos(&point);
-#endif
-
- RECT rect = wxGetWindowRect(hWnd);
-
- if ( ::PtInRect(&rect, point) && !wxIsBusy() )
- ::SetCursor(GetHcursorOf(m_cursor));
+ ::SetCursor(GetHcursorOf(m_cursor));
}
return true;
#if defined(__WXWINCE__)
UINT flags = 0;
#else
- UINT flags = TPM_RIGHTBUTTON;
+ UINT flags = TPM_RIGHTBUTTON | TPM_RECURSE;
#endif
::TrackPopupMenu(hMenu, flags, point.x, point.y, 0, hWnd, NULL);
wxCHECK_MSG( win, 0,
_T("FindWindowForMouseEvent() returned NULL") );
}
+#ifdef __POCKETPC__
+ if (IsContextMenuEnabled() && message == WM_LBUTTONDOWN)
+ {
+ SHRGINFO shrgi = {0};
+
+ shrgi.cbSize = sizeof(SHRGINFO);
+ shrgi.hwndClient = (HWND) GetHWND();
+ shrgi.ptDown.x = x;
+ shrgi.ptDown.y = y;
+
+ shrgi.dwFlags = SHRG_RETURNCMD;
+ // shrgi.dwFlags = SHRG_NOTIFYPARENT;
+
+ if (GN_CONTEXTMENU == ::SHRecognizeGesture(&shrgi))
+ {
+ wxPoint pt(x, y);
+ pt = ClientToScreen(pt);
+
+ wxContextMenuEvent evtCtx(wxEVT_CONTEXT_MENU, GetId(), pt);
+
+ evtCtx.SetEventObject(this);
+ if (GetEventHandler()->ProcessEvent(evtCtx))
+ {
+ processed = true;
+ return true;
+ }
+ }
+ }
+#endif
+
#else // !__WXWINCE__
wxWindowMSW *win = this;
#endif // __WXWINCE__/!__WXWINCE__