- Timestamp:
- Jan 9, 2000, 3:38:30 PM (26 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/Makefile
r2371 r2383 1 # $Id: Makefile,v 1.5 5 2000-01-08 14:15:05sandervl Exp $1 # $Id: Makefile,v 1.56 2000-01-09 14:37:08 sandervl Exp $ 2 2 3 3 # … … 43 43 win32wbasepos.obj oslibres.obj dummy.obj oslibmenu.obj dc.obj timer.obj \ 44 44 caret.obj resource.obj winproc.obj text.obj oslibmsgtranslate.obj \ 45 windlgmsg.obj windlg.obj win32wdesktop.obj pmtitlebar.obj 45 windlgmsg.obj windlg.obj win32wdesktop.obj pmtitlebar.obj win32wbasepaint.obj 46 46 47 47 … … 136 136 win32wbase.obj: win32wbase.cpp win32class.h win32wbase.h win32dlg.h gen_object.h $(PDWIN32_INCLUDE)\heapshared.h oslibwin.h win32wndchild.h $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h dc.h pmframe.h win32wdesktop.h controls.h winmouse.h $(PDWIN32_INCLUDE)\win\winproc.h $(PDWIN32_INCLUDE)\win\hook.h oslibmsg.h pmtitlebar.h 137 137 win32wbasepos.obj: win32wbasepos.cpp win32class.h win32wbase.h win32dlg.h gen_object.h $(PDWIN32_INCLUDE)\heapshared.h oslibwin.h win32wndchild.h $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h dc.h pmframe.h win32wdesktop.h 138 win32wbasepaint.obj: win32wbasepaint.cpp win32class.h win32wbase.h win32dlg.h gen_object.h $(PDWIN32_INCLUDE)\heapshared.h oslibwin.h win32wndchild.h $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h dc.h pmframe.h win32wdesktop.h controls.h winmouse.h $(PDWIN32_INCLUDE)\win\winproc.h $(PDWIN32_INCLUDE)\win\hook.h oslibmsg.h pmtitlebar.h 138 139 win32wnd.obj: win32wnd.cpp win32class.h win32wbase.h win32wnd.h win32dlg.h gen_object.h $(PDWIN32_INCLUDE)\heapshared.h oslibwin.h win32wndchild.h $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h oslibmenu.h 139 140 win32dlg.obj: win32dlg.cpp win32class.h win32wbase.h win32dlg.h gen_object.h $(PDWIN32_INCLUDE)\heapshared.h oslibwin.h win32wndchild.h oslibmsg.h controls.h $(PDWIN32_INCLUDE)\win\winproc.h … … 167 168 168 169 clean: 169 $(RM) *.obj *.lib *.dll *.map *.pch *.res *.lrf resource.asm *.lrf170 $(RM) *.obj *.lib *.dll *.map *.pch *.res *.lrf resource.asm 170 171 $(RM) $(PDWIN32_BIN)\$(TARGET).dll 171 172 $(RM) $(PDWIN32_LIB)\$(TARGET).lib -
trunk/src/user32/loadres.cpp
r2265 r2383 1 /* $Id: loadres.cpp,v 1.1 7 1999-12-30 11:20:34sandervl Exp $ */1 /* $Id: loadres.cpp,v 1.18 2000-01-09 14:37:09 sandervl Exp $ */ 2 2 3 3 /* … … 390 390 HBITMAP hBitmap = 0; 391 391 392 return LoadBitmapA((hinst == 0) ? hInstanceUser32:hinst,lpszBitmap,0,0,0); 393 #if 0 392 394 if (!hinst) 393 395 { … … 399 401 } else hBitmap = LoadBitmapA(hinst, lpszBitmap, 0, 0, 0); 400 402 dprintf(("LoadBitmapA returned %08xh\n", hBitmap)); 401 403 #endif 402 404 return(hBitmap); 403 405 } … … 409 411 HBITMAP hBitmap = 0; 410 412 411 if (!hinst) 412 { 413 if(IsSystemBitmap((ULONG *)&lpszBitmap)) 414 { 415 hBitmap = O32_LoadBitmap(hInstanceUser32,(LPCSTR)lpszBitmap); 416 if (!hBitmap) hBitmap = O32_LoadBitmap(hinst,(LPCSTR)lpszBitmap); 417 } else hBitmap = 0; 418 } else 419 { 420 if(HIWORD(lpszBitmap) != 0) 421 lpszBitmap = (LPWSTR)UnicodeToAsciiString((LPWSTR)lpszBitmap); 422 423 hBitmap = LoadBitmapA(hinst, (LPSTR)lpszBitmap, 0, 0, 0); 424 425 if(HIWORD(lpszBitmap) != 0) 426 FreeAsciiString((LPSTR)lpszBitmap); 427 } 413 if(HIWORD(lpszBitmap) != 0) 414 lpszBitmap = (LPWSTR)UnicodeToAsciiString((LPWSTR)lpszBitmap); 415 416 hBitmap = LoadBitmapA((hinst == 0) ? hInstanceUser32:hinst, (LPSTR)lpszBitmap, 0, 0, 0); 417 418 if(HIWORD(lpszBitmap) != 0) 419 FreeAsciiString((LPSTR)lpszBitmap); 428 420 429 421 dprintf(("LoadBitmapW returned %08xh\n", hBitmap)); -
trunk/src/user32/oslibmsgtranslate.cpp
r2378 r2383 1 /* $Id: oslibmsgtranslate.cpp,v 1.1 0 2000-01-08 16:53:38sandervl Exp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.11 2000-01-09 14:37:09 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 7 7 * Copyright 1999 Daniela Engert (dani@ngrt.de) 8 8 * Copyright 1999 Rene Pronk (R.Pronk@twi.tudelft.nl) 9 * 10 * NOTE: WM_NCHITTEST messages are sent whenever the mouse cursor moves or a mouse button is clicked/released 11 * (directly when receiving those messages) 9 12 * 10 13 * Project Odin Software License can be found in LICENSE.TXT … … 119 122 fIsFrameControl = (win32wnd != 0); 120 123 } 121 //NOTE: We only translate WM_PAINT /WM_HITTEST& mouse messages; the rest must not be seen by win32 apps124 //NOTE: We only translate WM_PAINT, WM_ACTIVATE & mouse messages; the rest must not be seen by win32 apps 122 125 } 123 126 //PostThreadMessage posts WIN32APP_POSTMSG msg without window handle … … 226 229 // this message 227 230 if(lpRect->right == thdb->wp.x+thdb->wp.cx && lpRect->bottom == thdb->wp.y+thdb->wp.cy) { 228 winMsg->message 229 winMsg->lParam = (LPARAM)&thdb->wp;231 winMsg->message = WINWM_WINDOWPOSCHANGED; 232 winMsg->lParam = (LPARAM)&thdb->wp; 230 233 } 231 234 else { … … 252 255 } 253 256 254 winMsg->message = WINWM_ACTIVATE; 255 winMsg->wParam = MAKELONG((SHORT1FROMMP(os2Msg->mp1)) ? WA_ACTIVE_W : WA_INACTIVE_W, fMinimized); 256 winMsg->lParam = (LPARAM)hwndActivate; 257 if(fIsFrameControl) { 258 fTranslateFrameControlMsg = TRUE; //we want a win32 app to see this msg for a frame control 259 winMsg->message = WINWM_NCACTIVATE; 260 winMsg->wParam = SHORT1FROMMP(os2Msg->mp1); 261 } 262 else 263 { 264 winMsg->message = WINWM_ACTIVATE; 265 winMsg->wParam = MAKELONG((SHORT1FROMMP(os2Msg->mp1)) ? WA_ACTIVE_W : WA_INACTIVE_W, fMinimized); 266 winMsg->lParam = (LPARAM)hwndActivate; 267 } 257 268 break; 258 269 } … … 292 303 case WM_BUTTON3UP: 293 304 case WM_BUTTON3DBLCLK: 305 { 306 ULONG hittest; 307 294 308 if(fIsFrameControl) { 295 309 fTranslateFrameControlMsg = TRUE; //we want a win32 app to see this msg for a frame control 296 310 } 297 311 312 hittest = win32wnd->MsgHitTest(winMsg->pt.x, winMsg->pt.y); 313 298 314 //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window 299 if( win32wnd->lastHitTestVal!= HTCLIENT_W) {315 if(hittest != HTCLIENT_W) { 300 316 winMsg->message = WINWM_NCLBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN); 301 winMsg->wParam = win32wnd->lastHitTestVal;317 winMsg->wParam = hittest; 302 318 winMsg->lParam = MAKELONG(winMsg->pt.x, winMsg->pt.y); //screen coordinates 303 319 } … … 311 327 winMsg->lParam = MAKELONG(ClientPoint.x, ClientPoint.y); //client coordinates 312 328 } 313 314 break;329 break; 330 } 315 331 316 332 case WM_BUTTON2MOTIONSTART: … … 327 343 case WM_MOUSEMOVE: 328 344 { 329 ULONG keystate = 0, setcursormsg = WINWM_MOUSEMOVE ;345 ULONG keystate = 0, setcursormsg = WINWM_MOUSEMOVE, hittest; 330 346 331 347 if(fIsFrameControl) { … … 344 360 keystate |= MK_CONTROL_W; 345 361 362 hittest = win32wnd->MsgHitTest(winMsg->pt.x, winMsg->pt.y); 363 346 364 //WM_NCMOUSEMOVE is posted when the cursor moves into a non-client area of the window 347 if( win32wnd->lastHitTestVal!= HTCLIENT_W)365 if(hittest != HTCLIENT_W) 348 366 { 349 367 setcursormsg = WINWM_NCMOUSEMOVE; 350 winMsg->wParam = (WPARAM) win32wnd->lastHitTestVal;368 winMsg->wParam = (WPARAM)hittest; 351 369 winMsg->lParam = MAKELONG(winMsg->pt.x,winMsg->pt.y); 352 370 } … … 546 564 547 565 if(wndParams->fsStatus & WPM_TEXT) { 548 win32wnd->MsgSetText(wndParams->pszText, wndParams->cchText); 566 winMsg->message = WINWM_SETTEXT; 567 winMsg->lParam = (LPARAM)wndParams->pszText; 549 568 break; 550 569 } … … 585 604 } 586 605 else winMsg->message = WINWM_PAINT; 587 break;588 }589 590 case WM_HITTEST:591 {592 OSLIBPOINT pt;593 594 fTranslateFrameControlMsg = TRUE; //we want a win32 app to see this msg for a frame control595 596 pt.x = (*(POINTS *)&os2Msg->mp1).x;597 pt.y = (*(POINTS *)&os2Msg->mp1).y;598 599 mapOS2ToWin32Point(os2Msg->hwnd,OSLIB_HWND_DESKTOP,&pt);600 winMsg->message = WINWM_NCHITTEST;601 winMsg->wParam = 0;602 winMsg->lParam = MAKELONG((USHORT)pt.x, (USHORT)pt.y);603 606 break; 604 607 } -
trunk/src/user32/oslibwin.cpp
r2371 r2383 1 /* $Id: oslibwin.cpp,v 1.5 7 2000-01-08 14:15:06sandervl Exp $ */1 /* $Id: oslibwin.cpp,v 1.58 2000-01-09 14:37:09 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 175 175 else 176 176 { 177 if((dwStyle & WS_CAPTION_W) == WS_DLGFRAME_W) 177 if((dwStyle & WS_CAPTION_W) == WS_DLGFRAME_W) { 178 178 *OSFrameStyle |= FCF_DLGBORDER; 179 *borderHeight = *borderWidth = 2; //TODO: Correct? 180 } 179 181 else 180 182 { 181 if((dwStyle & WS_CAPTION_W) == WS_CAPTION_W) 183 if((dwStyle & WS_CAPTION_W) == WS_CAPTION_W) { 182 184 *OSFrameStyle |= (FCF_TITLEBAR | FCF_BORDER); 185 *borderHeight = *borderWidth = 1; 186 } 183 187 else 184 if(dwStyle & WS_BORDER_W) 188 if(dwStyle & WS_BORDER_W) { 185 189 *OSFrameStyle |= FCF_BORDER; 190 *borderHeight = *borderWidth = 1; 191 } 186 192 } 187 193 … … 191 197 *OSFrameStyle |= FCF_HORZSCROLL; 192 198 193 if(dwStyle & WS_SYSMENU_W)194 *OSFrameStyle |= FCF_SYSMENU;195 199 if(dwStyle & WS_THICKFRAME_W) 196 200 *OSFrameStyle |= FCF_SIZEBORDER; //?? … … 198 202 //SvL: We subclass the titlebar control when win32 look is selected 199 203 if(fOS2Look) { 204 if(dwStyle & WS_SYSMENU_W) 205 *OSFrameStyle |= FCF_SYSMENU; 200 206 if(dwStyle & WS_MINIMIZEBOX_W) 201 207 *OSFrameStyle |= FCF_MINBUTTON; … … 1165 1171 //****************************************************************************** 1166 1172 //****************************************************************************** 1173 HWND OSLibWinGetFrameControlHandle(HWND hwndFrame, int framecontrol, RECT *lpRect) 1174 { 1175 switch(framecontrol) { 1176 case OSLIB_FID_TITLEBAR: 1177 framecontrol = FID_TITLEBAR; 1178 break; 1179 case OSLIB_FID_SYSMENU: 1180 framecontrol = FID_SYSMENU; 1181 break; 1182 case OSLIB_FID_MENU: 1183 framecontrol = FID_MENU; 1184 break; 1185 default: 1186 return 0; 1187 } 1188 return WinWindowFromID(hwndFrame, framecontrol); 1189 } 1190 //****************************************************************************** 1191 //****************************************************************************** -
trunk/src/user32/oslibwin.h
r2371 r2383 1 /* $Id: oslibwin.h,v 1.3 2 2000-01-08 14:15:06sandervl Exp $ */1 /* $Id: oslibwin.h,v 1.33 2000-01-09 14:37:09 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 289 289 290 290 HWND OSLibWinIsFrameControl(HWND hwnd); 291 HWND OSLibWinGetFrameControlHandle(HWND hwndFrame, int framecontrol); 291 292 292 293 #endif //__OSLIBWIN_H__ -
trunk/src/user32/pmframe.cpp
r2371 r2383 1 /* $Id: pmframe.cpp,v 1.3 3 2000-01-08 14:15:06sandervl Exp $ */1 /* $Id: pmframe.cpp,v 1.34 2000-01-09 14:37:09 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Frame Managment Code for OS/2 … … 234 234 //CB: call WM_NCCALCSIZE and set client pos 235 235 // WM_PAINT -> WM_NCPAINT 236 // WM_HITTEST -> MsgHitTest()237 236 // mouse messages -> MsgButton() 238 237 goto RunDefFrameProc; … … 320 319 dprintf(("PMFRAME: WM_WINDOWPOSCHANGED (%x) %x %x (%d,%d) (%d,%d)", mp2, win32wnd->getWindowHandle(), pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 321 320 321 //Signal to the children that their parent's window rect has changed 322 //(the children don't always receive a notification -> their window 323 // rectangle (in screen coordinates) will get out of sync) 324 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { 325 win32wnd->setWindowRectChanged(); 326 } 327 322 328 RestoreOS2TIB(); 323 329 rc = OldFrameProc(hwnd,msg,mp1,mp2); … … 337 343 OSLibMapSWPtoWINDOWPOSFrame(pswp, &wp, &swpOld, hParent, hwnd); 338 344 339 win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy); 340 win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy); 341 345 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { 346 win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy); 347 win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy); 348 } 342 349 if(win32wnd->CanReceiveSizeMsgs()) 343 350 win32wnd->MsgPosChanged((LPARAM)&wp); -
trunk/src/user32/pmtitlebar.cpp
r2371 r2383 1 /* $Id: pmtitlebar.cpp,v 1. 1 2000-01-08 14:15:38sandervl Exp $ */1 /* $Id: pmtitlebar.cpp,v 1.2 2000-01-09 14:37:10 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Titlebar Managment Code for OS/2 … … 6 6 * Copyright 2000 by Christoph Bratschi (cbratschi@datacomm.ch) 7 7 * 8 * 9 * NOTE: When fOS2Look == TRUE, mouse message & painting is handled by us 10 * (not by the PM titlebar control) 8 11 * 9 12 * Project Odin Software License can be found in LICENSE.TXT … … 27 30 #include "oslibmsg.h" 28 31 #include "pmtitlebar.h" 32 #include "pmwindow.h" 29 33 30 34 //****************************************************************************** … … 50 54 OldTitleBarProc = (PFNWP)win32wnd->getOldTitleBarProc(); 51 55 52 if(msg == WM_MOUSEMOVE) {53 rc = 0;54 }55 56 if((thdb->msgstate & 1) == 0) 56 57 {//message that was sent directly to our window proc handler; translate it here … … 79 80 switch(pWinMsg->message) 80 81 { 81 case WINWM_NCHITTEST:82 {83 DWORD res;84 85 // Only send this message if the window is enabled86 if (!WinIsWindowEnabled(hwnd))87 res = HT_ERROR;88 else if (win32wnd->getIgnoreHitTest())89 res = HT_NORMAL;90 else91 {92 dprintf(("USER32: WM_HITTEST %x (%d,%d)",hwnd,(*(POINTS *)&mp1).x,(*(POINTS *)&mp1).y));93 94 //CB: WinWindowFromPoint: PM sends WM_HITTEST -> loop -> stack overflow95 win32wnd->setIgnoreHitTest(TRUE);96 res = win32wnd->MsgHitTest(pWinMsg);97 win32wnd->setIgnoreHitTest(FALSE);98 }99 RestoreOS2TIB();100 return (MRESULT)res;101 }102 82 case WINWM_NCPAINT: 103 83 win32wnd->DispatchMsgA(pWinMsg); 104 if(win32wnd->getDefWndProcCalled())105 goto RunDefTitleBarProc;106 84 goto RunDefWndProc; 107 85 86 case WINWM_NCACTIVATE: 87 win32wnd->DispatchMsgA(pWinMsg); 88 break; 89 108 90 case WINWM_NCLBUTTONDOWN: 109 91 case WINWM_NCLBUTTONUP: … … 116 98 case WINWM_NCRBUTTONDBLCLK: 117 99 win32wnd->MsgButton(pWinMsg); 118 if(win32wnd->getDefWndProcCalled())119 goto RunDefTitleBarProc;120 121 100 rc = TRUE; 122 101 break; … … 124 103 case WINWM_NCMOUSEMOVE: 125 104 { 126 //OS/2 Window coordinates -> Win32 Window coordinates127 105 win32wnd->MsgMouseMove(pWinMsg); 128 if(win32wnd->getDefWndProcCalled())129 goto RunDefTitleBarProc;130 106 break; 131 107 } -
trunk/src/user32/pmwindow.cpp
r2371 r2383 1 /* $Id: pmwindow.cpp,v 1.7 5 2000-01-08 14:15:07sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.76 2000-01-09 14:37:10 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 95 95 (PSZ)WIN32_STDCLASS, /* Window class name */ 96 96 (PFNWP)Win32WindowProc, /* Address of window procedure */ 97 CS_HITTEST,97 0, 98 98 NROF_WIN32WNDBYTES)) { 99 99 dprintf(("WinRegisterClass Win32BaseWindow failed")); … … 472 472 win32wnd->DispatchMsgA(pWinMsg); 473 473 goto RunDefWndProc; 474 475 case WM_HITTEST:476 {477 DWORD res;478 479 // Only send this message if the window is enabled480 if (!WinIsWindowEnabled(hwnd))481 res = HT_ERROR;482 else if (win32wnd->getIgnoreHitTest())483 res = HT_NORMAL;484 else485 {486 dprintf(("USER32: WM_HITTEST %x (%d,%d)",hwnd,(*(POINTS *)&mp1).x,(*(POINTS *)&mp1).y));487 488 //CB: WinWindowFromPoint: PM sends WM_HITTEST -> loop -> stack overflow489 win32wnd->setIgnoreHitTest(TRUE);490 res = win32wnd->MsgHitTest(pWinMsg);491 win32wnd->setIgnoreHitTest(FALSE);492 }493 RestoreOS2TIB();494 return (MRESULT)res;495 }496 474 497 475 case WM_CONTEXTMENU: -
trunk/src/user32/win32wbase.cpp
r2374 r2383 1 /* $Id: win32wbase.cpp,v 1.13 4 2000-01-08 14:41:27sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.135 2000-01-09 14:37:11 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 151 151 fParentDC = FALSE; 152 152 fDefWndProcCalled = FALSE; 153 fWindowRectChanged = FALSE; //Set when parent window has been moved; cleared when window rect is updated 153 154 154 155 windowNameA = NULL; … … 193 194 isIcon = FALSE; 194 195 lastHitTestVal = HTOS_NORMAL; 195 fIgnoreHitTest = FALSE;196 196 owner = NULL; 197 197 windowClass = 0; … … 645 645 subclassScrollBars(dwStyle & WS_HSCROLL,dwStyle & WS_VSCROLL); 646 646 647 // FrameSubclassTitleBar(this); 647 if(!fOS2Look) 648 FrameSubclassTitleBar(this); 648 649 649 650 fakeWinBase.hwndThis = OS2Hwnd; … … 864 865 } 865 866 //****************************************************************************** 866 //****************************************************************************** 867 ULONG Win32BaseWindow::MsgHitTest(MSG *msg) 868 { 869 lastHitTestVal = SendInternalMessageA(WM_NCHITTEST, 0, MAKELONG((USHORT)msg->pt.x, (USHORT)msg->pt.y)); 870 dprintf2(("MsgHitTest returned %x", lastHitTestVal)); 871 872 if (lastHitTestVal == HTERROR) 873 return HTOS_ERROR; 874 875 #if 0 //CB: problems with groupboxes, internal handling is better 876 if (lastHitTestVal == HTTRANSPARENT) 877 return HTOS_TRANSPARENT; 878 #endif 879 880 return HTOS_NORMAL; 867 // NOTE: WM_NCHITTEST messages are sent whenever the mouse cursor moves or a mouse button is clicked/released 868 // (directly when receiving those messages) 869 //****************************************************************************** 870 ULONG Win32BaseWindow::MsgHitTest(ULONG x, ULONG y) 871 { 872 lastHitTestVal = SendInternalMessageA(WM_NCHITTEST, 0, MAKELONG((USHORT)x, (USHORT)y)); 873 dprintf(("MsgHitTest (%d,%d) (%d,%d) (%d,%d) returned %x", x, y, rectWindow.left, rectWindow.right, rectWindow.top, rectWindow.bottom, lastHitTestVal)); 874 return lastHitTestVal; 881 875 } 882 876 //****************************************************************************** … … 1239 1233 } 1240 1234 /*********************************************************************** 1241 * NC_HandleNCLButtonDown1242 *1243 * Handle a WM_NCLBUTTONDOWN message. Called from DefWindowProc().1244 */1245 LONG Win32BaseWindow::HandleNCLButtonDown(WPARAM wParam,LPARAM lParam)1246 {1247 switch(wParam) /* Hit test */1248 {1249 case HTCAPTION:1250 SendInternalMessageA(WM_SYSCOMMAND,SC_MOVE+HTCAPTION,lParam);1251 break;1252 1253 case HTSYSMENU:1254 SendInternalMessageA(WM_SYSCOMMAND,SC_MOUSEMENU+HTSYSMENU,lParam);1255 break;1256 1257 case HTMENU:1258 SendInternalMessageA(WM_SYSCOMMAND,SC_MOUSEMENU,lParam);1259 break;1260 1261 case HTHSCROLL:1262 SendInternalMessageA(WM_SYSCOMMAND,SC_HSCROLL+HTHSCROLL,lParam);1263 break;1264 1265 case HTVSCROLL:1266 SendInternalMessageA(WM_SYSCOMMAND,SC_VSCROLL+HTVSCROLL,lParam);1267 break;1268 1269 case HTLEFT:1270 case HTRIGHT:1271 case HTTOP:1272 case HTTOPLEFT:1273 case HTTOPRIGHT:1274 case HTBOTTOM:1275 case HTBOTTOMLEFT:1276 case HTBOTTOMRIGHT:1277 /* make sure hittest fits into 0xf and doesn't overlap with HTSYSMENU */1278 SendInternalMessageA(WM_SYSCOMMAND,SC_SIZE+wParam-2,lParam);1279 break;1280 case HTBORDER:1281 break;1282 }1283 1284 return 0;1285 }1286 //******************************************************************************1287 //******************************************************************************1288 LONG Win32BaseWindow::HandleNCLButtonUp(WPARAM wParam,LPARAM lParam)1289 {1290 switch(wParam) /* Hit test */1291 {1292 case HTMINBUTTON:1293 SendInternalMessageA(WM_SYSCOMMAND,SC_MINIMIZE,lParam);1294 break;1295 1296 case HTMAXBUTTON:1297 SendInternalMessageA(WM_SYSCOMMAND,SC_MAXIMIZE,lParam);1298 break;1299 1300 case HTCLOSE:1301 SendInternalMessageA(WM_SYSCOMMAND,SC_CLOSE,lParam);1302 break;1303 }1304 1305 return 0;1306 }1307 /***********************************************************************1308 * NC_HandleNCLButtonDblClk1309 *1310 * Handle a WM_NCLBUTTONDBLCLK message. Called from DefWindowProc().1311 */1312 LONG Win32BaseWindow::HandleNCLButtonDblClk(WPARAM wParam,LPARAM lParam)1313 {1314 /*1315 * if this is an icon, send a restore since we are handling1316 * a double click1317 */1318 if (dwStyle & WS_MINIMIZE)1319 {1320 SendInternalMessageA(WM_SYSCOMMAND,SC_RESTORE,lParam);1321 return 0;1322 }1323 1324 switch(wParam) /* Hit test */1325 {1326 case HTCAPTION:1327 /* stop processing if WS_MAXIMIZEBOX is missing */1328 if (dwStyle & WS_MAXIMIZEBOX)1329 SendInternalMessageA(WM_SYSCOMMAND,1330 (dwStyle & WS_MAXIMIZE) ? SC_RESTORE : SC_MAXIMIZE,1331 lParam);1332 break;1333 1334 case HTSYSMENU:1335 if (!(GetClassWord(Win32Hwnd,GCW_STYLE) & CS_NOCLOSE))1336 SendInternalMessageA(WM_SYSCOMMAND,SC_CLOSE,lParam);1337 break;1338 1339 case HTHSCROLL:1340 SendInternalMessageA(WM_SYSCOMMAND,SC_HSCROLL+HTHSCROLL,lParam);1341 break;1342 1343 case HTVSCROLL:1344 SendInternalMessageA(WM_SYSCOMMAND,SC_VSCROLL+HTVSCROLL,lParam);1345 break;1346 }1347 1348 return 0;1349 }1350 /***********************************************************************1351 1235 * NC_HandleSysCommand 1352 1236 * … … 1605 1489 setStyle(getStyle() | WS_VISIBLE); 1606 1490 OSLibWinEnableWindowUpdate(OS2HwndFrame,TRUE); 1607 } else 1491 } 1492 else 1608 1493 { 1609 1494 if (getStyle() & WS_VISIBLE) … … 1615 1500 return 0; 1616 1501 } 1617 1618 case WM_NCPAINT:1619 return 0;1620 1621 case WM_NCACTIVATE:1622 return TRUE;1623 1624 case WM_NCCREATE:1625 return(TRUE);1626 1627 case WM_NCDESTROY:1628 return 0;1629 1630 case WM_NCCALCSIZE:1631 return NCHandleCalcSize(wParam, (NCCALCSIZE_PARAMS *)lParam);1632 1502 1633 1503 case WM_CTLCOLORMSGBOX: … … 1778 1648 if( (getStyle() & WS_MINIMIZE) && getWindowClass()->getIcon()) 1779 1649 { 1780 int x = ( rectWindow.right - rectWindow.left - GetSystemMetrics(SM_CXICON))/2;1781 int y = ( rectWindow.bottom - rectWindow.top - GetSystemMetrics(SM_CYICON))/2;1650 int x = (getWindowRect()->right - getWindowRect()->left - GetSystemMetrics(SM_CXICON))/2; 1651 int y = (getWindowRect()->bottom - getWindowRect()->top - GetSystemMetrics(SM_CYICON))/2; 1782 1652 dprintf(("Painting class icon: vis rect=(%i,%i - %i,%i)\n", ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right, ps.rcPaint.bottom )); 1783 1653 DrawIcon(hdc, x, y, getWindowClass()->getIcon() ); … … 1791 1661 return 0; 1792 1662 1663 case WM_NCPAINT: 1664 if(!fOS2Look) { 1665 HandleNCPaint(wParam, FALSE); 1666 } 1667 return 0; 1668 1669 case WM_NCACTIVATE: 1670 if(!fOS2Look) { 1671 return HandleNCActivate(wParam); 1672 } 1673 return TRUE; 1674 1675 case WM_NCCREATE: 1676 return(TRUE); 1677 1678 case WM_NCDESTROY: 1679 return 0; 1680 1681 case WM_NCCALCSIZE: 1682 return NCHandleCalcSize(wParam, (NCCALCSIZE_PARAMS *)lParam); 1683 1793 1684 case WM_NCLBUTTONDOWN: 1794 return HandleNCLButtonDown(wParam,lParam); 1685 if(!fOS2Look) { 1686 return HandleNCLButtonDown(wParam,lParam); 1687 } 1688 return 0; 1795 1689 1796 1690 case WM_NCLBUTTONUP: 1797 return HandleNCLButtonUp(wParam,lParam); 1691 if(!fOS2Look) { 1692 return HandleNCLButtonUp(wParam,lParam); 1693 } 1694 return 0; 1798 1695 1799 1696 case WM_NCLBUTTONDBLCLK: 1800 return HandleNCLButtonDblClk(wParam,lParam); 1697 if(!fOS2Look) { 1698 return HandleNCLButtonDblClk(wParam,lParam); 1699 } 1700 return 0; 1801 1701 1802 1702 case WM_NCRBUTTONDOWN: … … 1818 1718 point.y = (SHORT)HIWORD(lParam); 1819 1719 1820 return FrameHitTest(this,point.x,point.y); 1720 if(fOS2Look) { 1721 return FrameHitTest(this, point.x, point.y); 1722 } 1723 else return HandleNCHitTest(point); 1821 1724 } 1822 1725 … … 2316 2219 } 2317 2220 //****************************************************************************** 2221 //When our parent window is moved, we aren't notified of the change (rectWindow is in 2222 //screen coordinates, so it needs to be updated) 2223 //Set the fWindowRectChanged flag and do the same for all the children 2224 //Whenever getWindowRect is called and this flag is set, it refreshes the rectWindow structure 2225 //****************************************************************************** 2226 void Win32BaseWindow::setWindowRectChanged() 2227 { 2228 Win32BaseWindow *child; 2229 2230 fWindowRectChanged = TRUE; 2231 2232 child = (Win32BaseWindow *)getFirstChild(); 2233 while(child) 2234 { 2235 child->setWindowRectChanged(); 2236 child = (Win32BaseWindow *)child->getNextChild(); 2237 } 2238 } 2239 //****************************************************************************** 2240 //****************************************************************************** 2241 PRECT Win32BaseWindow::getWindowRect() 2242 { 2243 if(fWindowRectChanged) { 2244 OSLibWinQueryWindowRect(getOS2FrameWindowHandle(), &rectWindow, RELATIVE_TO_SCREEN); 2245 fWindowRectChanged = FALSE; 2246 } 2247 return &rectWindow; 2248 } 2249 //****************************************************************************** 2250 //****************************************************************************** 2251 void Win32BaseWindow::setWindowRect(LONG left, LONG top, LONG right, LONG bottom) 2252 { 2253 fWindowRectChanged = FALSE; 2254 2255 rectWindow.left = left; 2256 rectWindow.top = top; 2257 rectWindow.right = right; 2258 rectWindow.bottom = bottom; 2259 } 2260 //****************************************************************************** 2261 //****************************************************************************** 2262 void Win32BaseWindow::setWindowRect(PRECT rect) 2263 { 2264 fWindowRectChanged = FALSE; 2265 2266 rectWindow = *rect; 2267 } 2268 //****************************************************************************** 2318 2269 //****************************************************************************** 2319 2270 BOOL Win32BaseWindow::SetWindowPos(HWND hwndInsertAfter, int x, int y, int cx, int cy, UINT fuFlags) … … 2882 2833 return OSLibWinIsWindowVisible(OS2HwndFrame); 2883 2834 #endif 2884 }2885 //******************************************************************************2886 //******************************************************************************2887 BOOL Win32BaseWindow::GetWindowRect(PRECT pRect)2888 {2889 return OSLibWinQueryWindowRect(OS2HwndFrame, pRect, RELATIVE_TO_SCREEN);2890 2835 } 2891 2836 //****************************************************************************** -
trunk/src/user32/win32wbase.h
r2371 r2383 1 /* $Id: win32wbase.h,v 1.6 7 2000-01-08 14:15:09sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.68 2000-01-09 14:37:12 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 84 84 ULONG MsgEraseBackGround(HDC hdc); 85 85 ULONG MsgInitMenu(MSG *msg); 86 ULONG MsgHitTest( MSG *msg);86 ULONG MsgHitTest(ULONG x, ULONG y); 87 87 ULONG MsgNCPaint(); 88 88 ULONG DispatchMsgA(MSG *msg); … … 110 110 HWND getOS2FrameWindowHandle() { return OS2HwndFrame; }; 111 111 Win32WndClass *getWindowClass() { return windowClass; }; 112 113 BOOL getIgnoreHitTest() { return fIgnoreHitTest; }114 VOID setIgnoreHitTest(BOOL ignore) { fIgnoreHitTest = ignore; }115 112 116 113 BOOL getDefWndProcCalled() { return fDefWndProcCalled; }; … … 139 136 PRECT getClientRect() { return &rectClient; }; 140 137 void setClientRect(PRECT rect) { rectClient = *rect; }; 141 PRECT getWindowRect() { return &rectWindow; };142 138 void setClientRect(LONG left, LONG top, LONG right, LONG bottom) 143 139 { … … 145 141 rectClient.right = right; rectClient.bottom = bottom; 146 142 }; 147 void setWindowRect(LONG left, LONG top, LONG right, LONG bottom) 148 { 149 rectWindow.left = left; rectWindow.top = top; 150 rectWindow.right = right; rectWindow.bottom = bottom; 151 }; 152 void setWindowRect(PRECT rect) { rectWindow = *rect; }; 143 PRECT getWindowRect(); 144 void setWindowRect(LONG left, LONG top, LONG right, LONG bottom); 145 void setWindowRect(PRECT rect); 146 void setWindowRectChanged(); 147 153 148 DWORD getFlags() { return flags; }; 154 149 void setFlags(DWORD newflags) { flags = newflags; }; … … 196 191 BOOL IsWindowUnicode(); 197 192 198 BOOL GetWindowRect(PRECT pRect);199 193 int GetWindowTextLength(); 200 194 int GetWindowTextA(LPSTR lpsz, int cch); … … 304 298 DWORD contextHelpId; 305 299 LONG lastHitTestVal; //Last value returned by WM_NCHITTEST handler 306 BOOL fIgnoreHitTest; //Use WinWindowFromPoint during WM_HITTEST 307 308 BOOL isIcon; 309 BOOL fFirstShow; 310 BOOL fIsDialog; 311 BOOL fIsModalDialog; 312 BOOL fIsModalDialogOwner; 300 313 301 HWND OS2HwndModalDialog; 314 BOOL fInternalMsg; //Used to distinguish between messages 315 //sent by PM and those sent by apps 316 BOOL fNoSizeMsg; 317 BOOL fIsDestroyed; 318 BOOL fDestroyWindowCalled; //DestroyWindow was called for this window 319 BOOL fCreated; 320 BOOL fTaskList; //should be listed in PM tasklist or not 321 BOOL fParentDC; 322 323 BOOL fDefWndProcCalled; //set when DefWndProc called; used in PM window handlers to determine what to do next 302 303 ULONG isIcon :1, 304 fFirstShow :1, 305 fIsDialog :1, 306 fIsModalDialog :1, 307 fIsModalDialogOwner :1, 308 fInternalMsg :1, //Used to distinguish between messages 309 //sent by PM and those sent by apps 310 fNoSizeMsg :1, 311 fIsDestroyed :1, 312 fDestroyWindowCalled :1, //DestroyWindow was called for this window 313 fCreated :1, 314 fTaskList :1, //should be listed in PM tasklist or not 315 fParentDC :1, 316 fIsSubclassedOS2Wnd :1, //subclassed OS/2 window: Netscape plug-in/scrollbar 317 fDefWndProcCalled :1, //set when DefWndProc called; used in PM window handlers to determine what to do next 318 fWindowRectChanged :1; //Set when parent window has been moved; cleared when window rect is updated 324 319 325 320 HRGN hWindowRegion; … … 334 329 335 330 PVOID pOldWndProc; 336 BOOL fIsSubclassedOS2Wnd; //subclassed OS/2 window: Netscape plug-in/scrollbar337 331 338 332 Win32BaseWindow *owner; … … 365 359 void GetMinMaxInfo(POINT *maxSize, POINT *maxPos, POINT *minTrack, POINT *maxTrack ); 366 360 LONG HandleWindowPosChanging(WINDOWPOS *winpos); 367 LONG HandleNCLButtonDown(WPARAM wParam,LPARAM lParam);368 LONG HandleNCLButtonUp(WPARAM wParam,LPARAM lParam);369 LONG HandleNCLButtonDblClk(WPARAM wParam,LPARAM lParam);370 361 LONG HandleSysCommand(WPARAM wParam, POINT *pt32); 371 362 … … 386 377 friend BOOL OS2ToWinMsgTranslate(void *pThdb, QMSG *os2Msg, MSG *winMsg, BOOL isUnicode, BOOL fTranslateExtraMsgs); 387 378 #endif 379 380 //painting & non-client methods 381 BOOL DrawSysButton(HDC hdc,BOOL down); 382 BOOL DrawGrayButton(HDC hdc,int x,int y); 383 VOID DrawCloseButton(HDC hdc,BOOL down,BOOL bGrayed); 384 VOID DrawMaxButton(HDC hdc,BOOL down,BOOL bGrayed); 385 VOID DrawMinButton(HDC hdc,BOOL down,BOOL bGrayed); 386 VOID DrawCaption(HDC hdc,RECT *rect,BOOL active); 387 VOID DrawFrame(HDC hdc,RECT *rect,BOOL dlgFrame,BOOL active); 388 389 VOID GetInsideRect(RECT *rect); 390 391 VOID TrackMinMaxBox(WORD wParam); 392 VOID TrackCloseButton(WORD wParam); 393 394 VOID HandleNCPaint(HRGN clip,BOOL suppress_menupaint); 395 LONG HandleNCHitTest(POINT pt); 396 LONG HandleNCActivate(WPARAM wParam); 397 LONG HandleNCLButtonDown(WPARAM wParam,LPARAM lParam); 398 LONG HandleNCLButtonUp(WPARAM wParam,LPARAM lParam); 399 LONG HandleNCLButtonDblClk(WPARAM wParam,LPARAM lParam); 388 400 389 401 public: -
trunk/src/user32/win32wbasepos.cpp
r2084 r2383 1 /* $Id: win32wbasepos.cpp,v 1. 7 1999-12-16 00:11:47sandervl Exp $ */1 /* $Id: win32wbasepos.cpp,v 1.8 2000-01-09 14:37:12 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (nonclient/position methods) … … 86 86 LPINTERNALPOS lpPos; 87 87 88 size.x = rectWindow.left; size.y = rectWindow.top;89 lpPos = WINPOS_InitInternalPos( wndPtr, size, &rectWindow);88 size.x = getWindowRect()->left; size.y = getWindowRect()->top; 89 lpPos = WINPOS_InitInternalPos( wndPtr, size, getWindowRect() ); 90 90 91 91 if (lpPos && !HOOK_CallHooks16(WH_CBT, HCBT_MINMAX, hwndSelf, cmd)) -
trunk/src/user32/window.cpp
r2257 r2383 1 /* $Id: window.cpp,v 1.4 6 1999-12-29 22:54:04 cbratschiExp $ */1 /* $Id: window.cpp,v 1.47 2000-01-09 14:37:12 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 648 648 return 0; 649 649 } 650 rc = window->GetWindowRect(pRect);650 *pRect = *window->getWindowRect(); 651 651 dprintf(("GetWindowRect %x (%d,%d) (%d,%d)", hwnd, pRect->left, pRect->top, pRect->right, pRect->bottom)); 652 return rc;652 return TRUE; 653 653 } 654 654 //****************************************************************************** … … 1009 1009 DWP *pDWP; 1010 1010 1011 dprintf(("USER32: BeginDeferWindowPos\n"));1011 dprintf(("USER32: BeginDeferWindowPos %x", count)); 1012 1012 if (count <= 0) 1013 1013 {
Note:
See TracChangeset
for help on using the changeset viewer.