Changeset 2291 for trunk/src/user32/new/oslibmsgtranslate.cpp
- Timestamp:
- Jan 1, 2000, 6:07:42 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/oslibmsgtranslate.cpp
r2290 r2291 1 /* $Id: oslibmsgtranslate.cpp,v 1. 1 2000-01-01 14:57:19cbratschi Exp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.2 2000-01-01 17:07:41 cbratschi Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 123 123 winMsg->hwnd = win32wnd->getWindowHandle(); 124 124 125 if (win32wnd && (os2Msg->hwnd == win32wnd->getOS2FrameWindowHandle())) 126 { 127 //special frame messages 128 129 switch (os2Msg->msg) 130 { 131 case WM_BUTTON1DOWN: 132 case WM_BUTTON1UP: 133 case WM_BUTTON1DBLCLK: 134 case WM_BUTTON2DOWN: 135 case WM_BUTTON2UP: 136 case WM_BUTTON2DBLCLK: 137 case WM_BUTTON3DOWN: 138 case WM_BUTTON3UP: 139 case WM_BUTTON3DBLCLK: 140 //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window 141 if(win32wnd->lastHitTestVal != HTCLIENT_W) { 142 winMsg->message = WINWM_NCLBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN); 143 winMsg->wParam = win32wnd->lastHitTestVal; 144 winMsg->lParam = MAKELONG(winMsg->pt.x, winMsg->pt.y); //screen coordinates 145 } 146 else { 147 point.x = (*(POINTS *)&os2Msg->mp1).x; 148 point.y = (*(POINTS *)&os2Msg->mp1).y; 149 ClientPoint.x = point.x; 150 ClientPoint.y = mapOS2ToWin32Y(os2Msg->hwnd,win32wnd->getOS2WindowHandle(),point.y); 151 152 winMsg->message = WINWM_LBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN); 153 winMsg->lParam = MAKELONG(ClientPoint.x, ClientPoint.y); //client coordinates 154 } 155 156 return TRUE; 157 158 case WM_BUTTON2MOTIONSTART: 159 case WM_BUTTON2MOTIONEND: 160 case WM_BUTTON2CLICK: 161 case WM_BUTTON1MOTIONSTART: 162 case WM_BUTTON1MOTIONEND: 163 case WM_BUTTON1CLICK: 164 case WM_BUTTON3MOTIONSTART: 165 case WM_BUTTON3MOTIONEND: 166 case WM_BUTTON3CLICK: 167 goto dummymessage; 168 169 case WM_MOUSEMOVE: 170 { 171 ULONG keystate = 0, setcursormsg = WINWM_MOUSEMOVE; 172 173 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON1) & 0x8000) 174 keystate |= MK_LBUTTON_W; 175 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON2) & 0x8000) 176 keystate |= MK_RBUTTON_W; 177 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON3) & 0x8000) 178 keystate |= MK_MBUTTON_W; 179 if(WinGetKeyState(HWND_DESKTOP, VK_SHIFT) & 0x8000) 180 keystate |= MK_SHIFT_W; 181 if(WinGetKeyState(HWND_DESKTOP, VK_CTRL) & 0x8000) 182 keystate |= MK_CONTROL_W; 183 184 //WM_NCMOUSEMOVE is posted when the cursor moves into a non-client area of the window 185 if(win32wnd->lastHitTestVal != HTCLIENT_W) 186 { 187 setcursormsg = WINWM_NCMOUSEMOVE; 188 winMsg->wParam = (WPARAM)win32wnd->lastHitTestVal; 189 winMsg->lParam = MAKELONG(winMsg->pt.x,winMsg->pt.y); 190 } else 191 { 192 winMsg->wParam = (WPARAM)keystate; 193 winMsg->lParam = MAKELONG(SHORT1FROMMP(os2Msg->mp1),mapOS2ToWin32Y(win32wnd->getOS2FrameWindowHandle(),win32wnd->getOS2WindowHandle(),SHORT2FROMMP(os2Msg->mp1))); 194 } 195 //OS/2 Window coordinates -> Win32 Window coordinates 196 winMsg->message = setcursormsg; 197 return TRUE; 198 } 199 200 case WM_PAINT: 201 { 202 winMsg->message = WINWM_NCPAINT; 203 return TRUE; 204 } 205 206 case WM_HITTEST: 207 { 208 OSLIBPOINT pt; 209 210 pt.x = (*(POINTS *)&os2Msg->mp1).x; 211 pt.y = (*(POINTS *)&os2Msg->mp1).y; 212 213 mapOS2ToWin32Point(os2Msg->hwnd,OSLIB_HWND_DESKTOP,&pt); 214 winMsg->message = WINWM_NCHITTEST; 215 winMsg->wParam = 0; 216 winMsg->lParam = MAKELONG((USHORT)pt.x, (USHORT)pt.y); 217 return TRUE; 218 } 219 } 220 //do normal translation for all other messages 221 } 222 125 223 switch(os2Msg->msg) 126 224 {
Note:
See TracChangeset
for help on using the changeset viewer.