+
+void wxActiveX::OnMouse(wxMouseEvent& event)
+{
+ if (m_oleObjectHWND == NULL)
+ {
+// wxLogTrace(wxT("no oleInPlaceObject"));
+ event.Skip();
+ return;
+ }
+
+// wxLogTrace(wxT("mouse event"));
+ UINT msg = 0;
+ WPARAM wParam = 0;
+ LPARAM lParam = 0;
+ LRESULT lResult = 0;
+
+ if (event.m_metaDown)
+ wParam |= MK_CONTROL;
+ if (event.m_shiftDown)
+ wParam |= MK_SHIFT;
+ if (event.m_leftDown)
+ wParam |= MK_LBUTTON;
+ if (event.m_middleDown)
+ wParam |= MK_MBUTTON;
+ if (event.m_rightDown)
+ wParam |= MK_RBUTTON;
+ lParam = event.m_x << 16;
+ lParam |= event.m_y;
+
+ if (event.LeftDown())
+ msg = WM_LBUTTONDOWN;
+ else if (event.LeftDClick())
+ msg = WM_LBUTTONDBLCLK;
+ else if (event.LeftUp())
+ msg = WM_LBUTTONUP;
+ else if (event.MiddleDown())
+ msg = WM_MBUTTONDOWN;
+ else if (event.MiddleDClick())
+ msg = WM_MBUTTONDBLCLK;
+ else if (event.MiddleUp())
+ msg = WM_MBUTTONUP;
+ else if (event.RightDown())
+ msg = WM_RBUTTONDOWN;
+ else if (event.RightDClick())
+ msg = WM_RBUTTONDBLCLK;
+ else if (event.RightUp())
+ msg = WM_RBUTTONUP;
+ else if (event.Moving() || event.Dragging())
+ msg = WM_MOUSEMOVE;
+
+ wxString log;
+ if (msg == 0)
+ {
+// wxLogTrace(wxT("no message"));
+ event.Skip(); return;
+ };
+
+ if (!::SendMessage(m_oleObjectHWND, msg, wParam, lParam))
+ {
+// wxLogTrace(wxT("msg not delivered"));
+ event.Skip();
+ return;
+ };
+
+// wxLogTrace(wxT("msg sent"));
+}
+
+WXLRESULT wxActiveX::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
+{
+ if (m_oleObjectHWND == NULL)
+ return wxWindow::MSWWindowProc(nMsg, wParam, lParam);
+
+ switch(nMsg)
+ {
+ case WM_CHAR:
+ case WM_DEADCHAR:
+ case WM_KEYDOWN:
+ case WM_KEYUP:
+ case WM_SYSCHAR:
+ case WM_SYSDEADCHAR:
+ case WM_SYSKEYDOWN:
+ case WM_SYSKEYUP:
+ PostMessage(m_oleObjectHWND, nMsg, wParam, lParam);
+
+ default:
+ return wxWindow::MSWWindowProc(nMsg, wParam, lParam);
+ };
+};
+