git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11793
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
static ibool wxWindowMouseHandler(window_t *wnd, event_t *e)
{
wxWindowMGL *win = (wxWindowMGL*)MGL_wmGetWindowUserData(wnd);
static ibool wxWindowMouseHandler(window_t *wnd, event_t *e)
{
wxWindowMGL *win = (wxWindowMGL*)MGL_wmGetWindowUserData(wnd);
- wxPoint where = win->ScreenToClient(wxPoint(e->where_x, e->where_y));
+ MGL_wmCoordGlobalToLocal(win->GetHandle(),
+ e->where_x, e->where_y, &where.x, &where.y);
+
if ( !win->IsEnabled() ) return FALSE;
wxEventType type = wxEVT_NULL;
if ( !win->IsEnabled() ) return FALSE;
wxEventType type = wxEVT_NULL;
if ( g_windowUnderMouse )
{
wxMouseEvent event2(event);
if ( g_windowUnderMouse )
{
wxMouseEvent event2(event);
- wxPoint where2 = g_windowUnderMouse->ScreenToClient(
- wxPoint(e->where_x, e->where_y));
- event2.m_x = where2.x;
- event2.m_y = where2.y;
+ MGL_wmCoordGlobalToLocal(g_windowUnderMouse->GetHandle(),
+ e->where_x, e->where_y,
+ &event2.m_x, &event2.m_y);
+
event2.SetEventObject(g_windowUnderMouse);
event2.SetEventType(wxEVT_LEAVE_WINDOW);
g_windowUnderMouse->GetEventHandler()->ProcessEvent(event2);
event2.SetEventObject(g_windowUnderMouse);
event2.SetEventType(wxEVT_LEAVE_WINDOW);
g_windowUnderMouse->GetEventHandler()->ProcessEvent(event2);
if ( !win->IsEnabled() ) return FALSE;
if ( !win->IsEnabled() ) return FALSE;
- wxPoint where = win->ScreenToClient(wxPoint(e->where_x, e->where_y));
+ wxPoint where;
+ MGL_wmCoordGlobalToLocal(win->GetHandle(),
+ e->where_x, e->where_y, &where.x, &where.y);
wxKeyEvent event;
event.SetEventObject(win);
wxKeyEvent event;
event.SetEventObject(win);
MGL_wmPushWindowEventHandler(m_wnd, wxWindowMouseHandler, EVT_MOUSEEVT, 0);
MGL_wmPushWindowEventHandler(m_wnd, wxWindowKeybHandler, EVT_KEYEVT, 0);
MGL_wmPushWindowEventHandler(m_wnd, wxWindowMouseHandler, EVT_MOUSEEVT, 0);
MGL_wmPushWindowEventHandler(m_wnd, wxWindowKeybHandler, EVT_KEYEVT, 0);
void wxWindowMGL::DoScreenToClient(int *x, int *y) const
{
int ax, ay;
void wxWindowMGL::DoScreenToClient(int *x, int *y) const
{
int ax, ay;
- wxPoint co = GetClientAreaOrigin();
-
- MGL_wmCoordGlobalToLocal(m_wnd, m_wnd->x, m_wnd->y, &ax, &ay);
- ax -= co.x;
- ay -= co.y;
+ MGL_wmCoordGlobalToLocal(m_wnd, 0, 0, &ax, &ay);
}
void wxWindowMGL::DoClientToScreen(int *x, int *y) const
{
int ax, ay;
}
void wxWindowMGL::DoClientToScreen(int *x, int *y) const
{
int ax, ay;
- wxPoint co = GetClientAreaOrigin();
-
- MGL_wmCoordGlobalToLocal(m_wnd, m_wnd->x+co.x, m_wnd->y+co.y, &ax, &ay);
+ MGL_wmCoordLocalToGlobal(m_wnd, 0, 0, &ax, &ay);
}
// Get size *available for subwindows* i.e. excluding menu bar etc.
}
// Get size *available for subwindows* i.e. excluding menu bar etc.