X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/72bfca58d997c6f54e92aabc108c1cc18674bbee..51d78461fa34267925e31291e2371390611d0d0e:/src/os2/window.cpp diff --git a/src/os2/window.cpp b/src/os2/window.cpp index 605a5ade87..df354d8733 100644 --- a/src/os2/window.cpp +++ b/src/os2/window.cpp @@ -294,17 +294,11 @@ bool wxWindowOS2::OS2Command( void wxWindowOS2::Init() { - // - // Generic - // - InitBase(); - // // PM specific // m_bWinCaptured = FALSE; - m_isBeingDeleted = FALSE; m_fnOldWndProc = NULL; m_bUseCtl3D = FALSE; m_bMouseInWindow = FALSE; @@ -1164,10 +1158,10 @@ void wxWindowOS2::OnIdle( // int nState = 0; - if (::WinGetKeyState(HWND_DESKTOP, VK_SHIFT) != 0) - nState |= VK_SHIFT; - if (::WinGetKeyState(HWND_DESKTOP, VK_CTRL) != 0); - nState |= VK_CTRL; + if (IsShiftDown()) + nState |= KC_SHIFT; + if (IsCtrlDown()) + nState |= KC_CTRL; wxMouseEvent rEvent(wxEVT_LEAVE_WINDOW); @@ -1235,9 +1229,9 @@ void wxWindowOS2::Refresh( RECTL vOs2Rect; vOs2Rect.xLeft = pRect->x; - vOs2Rect.yTop = pRect->y; + vOs2Rect.yBottom = pRect->y; vOs2Rect.xRight = pRect->x + pRect->width; - vOs2Rect.yBottom = pRect->y + pRect->height; + vOs2Rect.yTop = pRect->y + pRect->height; ::WinInvalidateRect(hWnd, &vOs2Rect, bEraseBack); } @@ -2556,7 +2550,7 @@ MRESULT wxWindowOS2::OS2WindowProc( bProcessed = HandleMouseEvent( uMsg ,nX ,nY - ,(WXUINT)SHORT1FROMMP(wParam) + ,(WXUINT)SHORT2FROMMP(lParam) ); } else @@ -2573,7 +2567,7 @@ MRESULT wxWindowOS2::OS2WindowProc( bProcessed = pWin->HandleMouseEvent( uMsg ,nX ,nY - ,(WXUINT)SHORT1FROMMP(wParam) + ,(WXUINT)SHORT2FROMMP(lParam) ); } } @@ -4045,13 +4039,20 @@ void wxWindowOS2::InitMouseEvent( , WXUINT uFlags ) { + int nHeight; + DoGetSize(0, &nHeight); rEvent.m_x = nX; - rEvent.m_y = nY; - rEvent.m_shiftDown = ((uFlags & VK_SHIFT) != 0); - rEvent.m_controlDown = ((uFlags & VK_CTRL) != 0); - rEvent.m_leftDown = ((uFlags & VK_BUTTON1) != 0); - rEvent.m_middleDown = ((uFlags & VK_BUTTON3) != 0); - rEvent.m_rightDown = ((uFlags & VK_BUTTON2) != 0); + // Convert to wxWindows standard coordinate system! + rEvent.m_y = nHeight - nY; + rEvent.m_shiftDown = ((uFlags & KC_SHIFT) != 0); + rEvent.m_controlDown = ((uFlags & KC_CTRL) != 0); + rEvent.m_altDown = ((uFlags & KC_ALT) != 0); + rEvent.m_leftDown = (::WinGetKeyState(HWND_DESKTOP, VK_BUTTON1) & + 0x8000) != 0; + rEvent.m_middleDown = (::WinGetKeyState(HWND_DESKTOP, VK_BUTTON3) & + 0x8000) != 0; + rEvent.m_rightDown = (::WinGetKeyState(HWND_DESKTOP, VK_BUTTON2) & + 0x8000) != 0; rEvent.SetTimestamp(s_currentMsg.time); rEvent.m_eventObject = this; rEvent.SetId(GetId());