- Timestamp:
- Jan 8, 2000, 5:47:50 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/button.cpp
r2290 r2377 1 /* $Id: button.cpp,v 1.1 3 2000-01-01 14:57:08cbratschi Exp $ */1 /* $Id: button.cpp,v 1.14 2000-01-08 16:47:45 cbratschi Exp $ */ 2 2 /* File: button.cpp -- Button type widgets 3 3 * … … 239 239 POINT pt; 240 240 241 if (style == BS_GROUPBOX) return 0;242 241 pt.x = LOWORD(lParam); 243 242 pt.y = HIWORD(lParam); … … 315 314 DWORD style = GetWindowLongA(hwnd,GWL_STYLE) & 0x0f; 316 315 317 if (style == BS_GROUPBOX) return HTTRANSPARENT;316 //if (style == BS_GROUPBOX) return HTTRANSPARENT; 318 317 319 318 return DefWindowProcA(hwnd,WM_NCHITTEST,wParam,lParam); -
trunk/src/user32/new/oslibmsgtranslate.cpp
r2353 r2377 1 /* $Id: oslibmsgtranslate.cpp,v 1. 6 2000-01-07 17:38:47cbratschi Exp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.7 2000-01-08 16:47:46 cbratschi Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 102 102 //****************************************************************************** 103 103 //****************************************************************************** 104 ULONG GetMouseKeyState() 105 { 106 ULONG keystate; 107 108 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON1) & 0x8000) 109 keystate |= MK_LBUTTON_W; 110 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON2) & 0x8000) 111 keystate |= MK_RBUTTON_W; 112 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON3) & 0x8000) 113 keystate |= MK_MBUTTON_W; 114 if(WinGetKeyState(HWND_DESKTOP, VK_SHIFT) & 0x8000) 115 keystate |= MK_SHIFT_W; 116 if(WinGetKeyState(HWND_DESKTOP, VK_CTRL) & 0x8000) 117 keystate |= MK_CONTROL_W; 118 119 return keystate; 120 } 121 //****************************************************************************** 122 //****************************************************************************** 123 LONG IsNCMouseMsg(Win32BaseWindow *win32wnd) 124 { 125 return ((win32wnd->getLastHitTestVal() != HTCLIENT_W) && (WinQueryCapture(HWND_DESKTOP) != win32wnd->getOS2WindowHandle())); 126 } 127 //****************************************************************************** 128 //****************************************************************************** 104 129 BOOL OS2ToWinMsgTranslate(void *pThdb, QMSG *os2Msg, MSG *winMsg, BOOL isUnicode, BOOL fMsgRemoved) 105 130 { … … 141 166 case WM_BUTTON3DBLCLK: 142 167 //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window 143 if (win32wnd->lastHitTestVal != HTCLIENT_W) {168 if (IsNCMouseMsg(win32wnd)) { 144 169 winMsg->message = WINWM_NCLBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN); 145 170 winMsg->wParam = win32wnd->lastHitTestVal; … … 153 178 154 179 winMsg->message = WINWM_LBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN); 180 winMsg->wParam = GetMouseKeyState(); 155 181 winMsg->lParam = MAKELONG(ClientPoint.x, ClientPoint.y); //client coordinates 156 182 } … … 171 197 case WM_MOUSEMOVE: 172 198 { 173 ULONG keystate = 0, setcursormsg = WINWM_MOUSEMOVE;174 175 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON1) & 0x8000)176 keystate |= MK_LBUTTON_W;177 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON2) & 0x8000)178 keystate |= MK_RBUTTON_W;179 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON3) & 0x8000)180 keystate |= MK_MBUTTON_W;181 if(WinGetKeyState(HWND_DESKTOP, VK_SHIFT) & 0x8000)182 keystate |= MK_SHIFT_W;183 if(WinGetKeyState(HWND_DESKTOP, VK_CTRL) & 0x8000)184 keystate |= MK_CONTROL_W;185 186 199 //WM_NCMOUSEMOVE is posted when the cursor moves into a non-client area of the window 187 if( win32wnd->lastHitTestVal != HTCLIENT_W)188 { 189 setcursormsg= WINWM_NCMOUSEMOVE;190 winMsg->wParam = (WPARAM)win32wnd->lastHitTestVal;191 winMsg->lParam = MAKELONG(winMsg->pt.x,winMsg->pt.y);200 if(IsNCMouseMsg(win32wnd)) 201 { 202 winMsg->message = WINWM_NCMOUSEMOVE; 203 winMsg->wParam = (WPARAM)win32wnd->lastHitTestVal; 204 winMsg->lParam = MAKELONG(winMsg->pt.x,winMsg->pt.y); 192 205 } else 193 206 { 194 winMsg->wParam = (WPARAM)keystate; 207 winMsg->message = WINWM_MOUSEMOVE; 208 winMsg->wParam = GetMouseKeyState(); 195 209 winMsg->lParam = MAKELONG(SHORT1FROMMP(os2Msg->mp1),mapOS2ToWin32Y(win32wnd->getOS2FrameWindowHandle(),win32wnd->getOS2WindowHandle(),SHORT2FROMMP(os2Msg->mp1))); 196 210 } 197 211 //OS/2 Window coordinates -> Win32 Window coordinates 198 winMsg->message = setcursormsg;199 212 return TRUE; 200 213 } … … 332 345 case WM_BUTTON3DBLCLK: 333 346 //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window 334 if( win32wnd->lastHitTestVal != HTCLIENT_W) {347 if(IsNCMouseMsg(win32wnd)) { 335 348 winMsg->message = WINWM_NCLBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN); 336 349 winMsg->wParam = win32wnd->lastHitTestVal; … … 344 357 345 358 winMsg->message = WINWM_LBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN); 359 winMsg->wParam = GetMouseKeyState(); 346 360 winMsg->lParam = MAKELONG(ClientPoint.x, ClientPoint.y); //client coordinates 347 361 } … … 362 376 case WM_MOUSEMOVE: 363 377 { 364 ULONG keystate = 0, setcursormsg = WINWM_MOUSEMOVE;365 366 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON1) & 0x8000)367 keystate |= MK_LBUTTON_W;368 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON2) & 0x8000)369 keystate |= MK_RBUTTON_W;370 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON3) & 0x8000)371 keystate |= MK_MBUTTON_W;372 if(WinGetKeyState(HWND_DESKTOP, VK_SHIFT) & 0x8000)373 keystate |= MK_SHIFT_W;374 if(WinGetKeyState(HWND_DESKTOP, VK_CTRL) & 0x8000)375 keystate |= MK_CONTROL_W;376 377 378 //WM_NCMOUSEMOVE is posted when the cursor moves into a non-client area of the window 378 if( win32wnd->lastHitTestVal != HTCLIENT_W)379 { 380 setcursormsg= WINWM_NCMOUSEMOVE;381 winMsg->wParam = (WPARAM)win32wnd->lastHitTestVal;382 winMsg->lParam = MAKELONG(winMsg->pt.x,winMsg->pt.y);379 if(IsNCMouseMsg(win32wnd)) 380 { 381 winMsg->message = WINWM_NCMOUSEMOVE; 382 winMsg->wParam = (WPARAM)win32wnd->lastHitTestVal; 383 winMsg->lParam = MAKELONG(winMsg->pt.x,winMsg->pt.y); 383 384 } else 384 385 { 385 winMsg->wParam = (WPARAM)keystate; 386 winMsg->message = WINWM_MOUSEMOVE; 387 winMsg->wParam = GetMouseKeyState(); 386 388 winMsg->lParam = MAKELONG(SHORT1FROMMP(os2Msg->mp1),mapY(win32wnd,SHORT2FROMMP(os2Msg->mp1))); 387 389 } 388 390 //OS/2 Window coordinates -> Win32 Window coordinates 389 winMsg->message = setcursormsg;390 391 break; 391 392 } -
trunk/src/user32/new/pmframe.cpp
r2353 r2377 1 /* $Id: pmframe.cpp,v 1. 7 2000-01-07 17:38:47 cbratschi Exp $ */1 /* $Id: pmframe.cpp,v 1.8 2000-01-08 16:47:47 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Frame Managment Code for OS/2 … … 210 210 } 211 211 //****************************************************************************** 212 //****************************************************************************** 213 VOID FrameUpdateChildPositions(HWND hwnd) 214 { 215 HENUM henum; 216 HWND hchild; 217 RECTL rectl; 218 219 henum = WinBeginEnumWindows(hwnd); 220 while ((hchild = WinGetNextWindow(henum)) != NULLHANDLE) 221 { 222 Win32BaseWindow *child = Win32BaseWindow::GetWindowFromOS2FrameHandle(hchild); 223 224 if (child) 225 { 226 WinQueryWindowRect(child->getOS2FrameWindowHandle(),&rectl); 227 mapOS2ToWin32Rect(child->getOS2FrameWindowHandle(),OSLIB_HWND_DESKTOP,(PRECTLOS2)&rectl,child->getWindowRect()); 228 FrameUpdateChildPositions(child->getOS2WindowHandle()); 229 } 230 } 231 WinEndEnumWindows(henum); 232 } 233 //****************************************************************************** 212 234 //Win32 frame message handler 213 235 //****************************************************************************** … … 273 295 win32wnd->MsgFormatFrame(); 274 296 //CB: todo: use result for WM_CALCVALIDRECTS 275 mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),win32wnd->getClientRectPtr(),(PRECTLOS2)&rect); 276 WinMapWindowPoints(WinQueryWindow(hwnd,QW_PARENT),hwnd,(PPOINTL)&rect,2); 277 dprintf(("New client position: %d %d %d %d",rect.xLeft,rect.yBottom,rect.xRight,rect.yTop)); 297 mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),hwnd,win32wnd->getClientRectPtr(),(PRECTLOS2)&rect); 278 298 swpClient = &pswp[ccount-1]; 279 299 swpClient->x = rect.xLeft; … … 281 301 swpClient->cx = rect.xRight-rect.xLeft; 282 302 swpClient->cy = rect.yTop-rect.yBottom; 303 dprintf(("New client position: x=%d y=%d w=%d h=%d",swpClient->x,swpClient->y,swpClient->cx,swpClient->cy)); 283 304 RestoreOS2TIB(); 284 305 return (MRESULT)ccount; … … 286 307 287 308 case WM_MINMAXFRAME: 309 { 310 PSWP swp = (PSWP)mp1; 311 312 if (!win32wnd->IsWindowCreated()) goto RunDefFrameProc; 288 313 dprintf(("PMFRAME: WM_MINMAXFRAME %x",hwnd)); 289 //CB: todo 314 if ((swp->fl & SWP_MAXIMIZE) == SWP_MAXIMIZE) 315 { 316 win32wnd->setStyle((win32wnd->getStyle() & ~WS_MINIMIZE_W) | WS_MAXIMIZE_W); 317 } else if ((swp->fl & SWP_MINIMIZE) == SWP_MINIMIZE) 318 { 319 win32wnd->setStyle((win32wnd->getStyle() & ~WS_MAXIMIZE_W) | WS_MINIMIZE_W); 320 } else if ((swp->fl & SWP_RESTORE) == SWP_RESTORE) 321 { 322 win32wnd->setStyle(win32wnd->getStyle() & ~(WS_MINIMIZE_W | WS_MAXIMIZE_W)); 323 } 290 324 goto RunDefFrameProc; 325 } 291 326 292 327 case WM_QUERYBORDERSIZE: … … 303 338 case WM_BUTTON3DBLCLK: 304 339 { 305 SWP swp;306 307 WinQueryWindowPos(hwnd,&swp);308 if ((swp.fl & SWP_MINIMIZE) == SWP_MINIMIZE)309 goto RunDefFrameProc;310 340 if (win32wnd->IsWindowCreated()) 311 341 { … … 330 360 case WM_MOUSEMOVE: 331 361 { 332 SWP swp;333 334 WinQueryWindowPos(hwnd,&swp);335 if ((swp.fl & SWP_MINIMIZE) == SWP_MINIMIZE)336 goto RunDefFrameProc;337 362 //OS/2 Window coordinates -> Win32 Window coordinates 338 363 if (win32wnd->IsWindowCreated()) … … 345 370 { 346 371 DWORD res; 347 SWP swp;348 349 WinQueryWindowPos(hwnd,&swp);350 if ((swp.fl & SWP_MINIMIZE) == SWP_MINIMIZE)351 goto RunDefFrameProc;352 372 353 373 // Only send this message if the window is enabled … … 373 393 case WM_PAINT: 374 394 { 375 SWP swp;376 377 WinQueryWindowPos(hwnd,&swp);378 if ((swp.fl & SWP_MINIMIZE) == SWP_MINIMIZE)379 goto RunDefFrameProc;380 395 dprintf(("PMFRAME: WM_PAINT")); 396 if (win32wnd->getStyle() & WS_MINIMIZE_W) 397 goto RunDefFrameProc; 381 398 if (win32wnd->IsWindowCreated()) 382 399 win32wnd->MsgNCPaint(); … … 416 433 417 434 WinQueryWindowPos(hwnd, &swpOld); 418 419 435 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { 420 436 if (win32wnd->isChild()) { … … 484 500 RECTL rectl; 485 501 502 WinQueryWindowRect(win32wnd->getOS2FrameWindowHandle(),&rectl); 503 mapOS2ToWin32Rect(win32wnd->getOS2FrameWindowHandle(),OSLIB_HWND_DESKTOP,(PRECTLOS2)&rectl,win32wnd->getWindowRect()); 486 504 WinQueryWindowRect(win32wnd->getOS2WindowHandle(),&rectl); 487 505 mapOS2ToWin32Rect(win32wnd->getOS2WindowHandle(),WinQueryWindow(hwnd,QW_PARENT),(PRECTLOS2)&rectl,win32wnd->getClientRectPtr()); … … 490 508 RestoreOS2TIB(); 491 509 rc = OldFrameProc(hwnd,msg,mp1,mp2); 510 SetWin32TIB(); 511 //update child positions: rectWindow is in window coordinates 512 FrameUpdateChildPositions(win32wnd->getOS2WindowHandle()); 513 RestoreOS2TIB(); 492 514 return rc; 493 515 } -
trunk/src/user32/new/pmframe.h
r2290 r2377 1 /* $Id: pmframe.h,v 1. 1 2000-01-01 14:54:53cbratschi Exp $ */1 /* $Id: pmframe.h,v 1.2 2000-01-08 16:47:48 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Frame Managment Code for OS/2 … … 59 59 VOID FrameTrackFrame(Win32BaseWindow *win32wnd,DWORD flags); 60 60 61 #define WS_MINIMIZE_W 0x20000000L 62 #define WS_MAXIMIZE_W 0x01000000L 63 61 64 #endif -
trunk/src/user32/new/win32wbase.cpp
r2353 r2377 1 /* $Id: win32wbase.cpp,v 1.2 4 2000-01-07 17:38:47cbratschi Exp $ */1 /* $Id: win32wbase.cpp,v 1.25 2000-01-08 16:47:48 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 700 700 rectWindow.bottom = cs->y+cs->cy; 701 701 rectClient = rectWindow; //dummy client rect 702 if (getParent()) MapWindowPoints(getParent()->getWindowHandle(),0,(PPOINT)&rectWindow,2);702 if (getParent()) mapWin32Rect(getParent()->getOS2WindowHandle(),OSLIB_HWND_DESKTOP,&rectWindow); 703 703 /* Send the WM_CREATE message 704 704 * Perhaps we shouldn't allow width/height changes as well. … … 718 718 rectWindow.top = cs->y; 719 719 rectWindow.bottom = cs->y+cs->cy; 720 if (getParent()) MapWindowPoints(getParent()->getWindowHandle(),0,(PPOINT)&rectWindow,2);720 if (getParent()) mapWin32Rect(getParent()->getOS2WindowHandle(),OSLIB_HWND_DESKTOP,&rectWindow); 721 721 OffsetRect(&rectWindow, maxPos.x - rectWindow.left, maxPos.y - rectWindow.top); 722 722 rectClient = rectWindow; 723 if (getParent()) MapWindowPoints(0,getParent()->getWindowHandle(),(PPOINT)&rectClient,2);723 if (getParent()) mapWin32Rect(OSLIB_HWND_DESKTOP,getParent()->getOS2WindowHandle(),&rectClient); 724 724 //set the window size and update the client 725 725 SetWindowPos(hwndLinkAfter,rectClient.left,rectClient.top,rectClient.right-rectClient.left,rectClient.bottom-rectClient.top,SWP_NOACTIVATE | SWP_NOREDRAW | SWP_FRAMECHANGED); 726 726 fNoSizeMsg = FALSE; 727 if (cs->style & WS_VISIBLE) dwStyle |= WS_VISIBLE; //program could change position in WM_CREATE 727 728 if( (SendInternalMessageA(WM_CREATE, 0, (LPARAM)cs )) != -1 ) 728 729 { … … 745 746 } 746 747 747 if (cs->style & WS_VISIBLE) ShowWindow( sw);748 if (cs->style & WS_VISIBLE) ShowWindow(sw); 748 749 749 750 /* Call WH_SHELL hook */ … … 803 804 } 804 805 SendInternalMessageA(WM_NCDESTROY, 0, 0); 805 806 if (hwndHorzScroll && (OSLibWinQueryWindow(hwndHorzScroll,QWOS_PARENT) == OSLibWinQueryObjectWindow())) OSLibWinDestroyWindow(hwndHorzScroll);807 if (hwndVertScroll && (OSLibWinQueryWindow(hwndVertScroll,QWOS_PARENT) == OSLibWinQueryObjectWindow())) OSLibWinDestroyWindow(hwndVertScroll);808 806 809 807 TIMER_KillTimerFromWindow(OS2Hwnd); … … 982 980 case WM_NCRBUTTONDBLCLK: 983 981 case WM_NCMBUTTONDBLCLK: 984 if (!(windowClass && windowClass->getClassLongA(GCL_STYLE) & CS_DBLCLKS) )982 if (!(windowClass && windowClass->getClassLongA(GCL_STYLE) & CS_DBLCLKS) && (msg->message != WM_NCLBUTTONDBLCLK)) 985 983 { 986 984 msg->message = msg->message - (WM_LBUTTONDBLCLK - WM_LBUTTONDOWN); //dblclick -> down … … 1120 1118 //CB: bug in GetDCEx with region!!! 1121 1119 rc = SendInternalMessageA(WM_NCPAINT,/*hrgn*/0,0); 1122 dprintf(("CB: %d %d %d %d",rect.left,rect.top,rect.bottom,rect.right));1120 //dprintf(("CB: %d %d %d %d",rect.left,rect.top,rect.bottom,rect.right)); 1123 1121 DeleteObject(hrgn); 1124 1122 //CB: todo: check if intersection with client … … 1137 1135 wndPos.hwndInsertAfter = 0; 1138 1136 rect = rectWindow; 1139 if (getParent()) MapWindowPoints(0,getParent()->getWindowHandle(),(PPOINT)&rect,2);1137 if (getParent()) mapWin32Rect(OSLIB_HWND_DESKTOP,getParent()->getOS2WindowHandle(),&rect); 1140 1138 wndPos.x = rect.left; 1141 1139 wndPos.y = rect.top; 1142 1140 wndPos.cx = rect.right-rect.left; 1143 1141 wndPos.cy = rect.bottom-rect.top; 1144 wndPos.flags = 0; 1142 wndPos.flags = 0; //dummy 1145 1143 1146 1144 return SendNCCalcSize(TRUE,&window,&window,&client,&wndPos,&rectClient); … … 1201 1199 { 1202 1200 case SB_HORZ: 1201 if (!horzScrollInfo) 1202 { 1203 horzScrollInfo = (SCROLLBAR_INFO*)malloc(sizeof(SCROLLBAR_INFO)); 1204 horzScrollInfo->MinVal = horzScrollInfo->CurVal = horzScrollInfo->Page = 0; 1205 horzScrollInfo->MaxVal = 100; 1206 horzScrollInfo->flags = ESB_ENABLE_BOTH; 1207 } 1203 1208 return horzScrollInfo; 1204 1209 1205 1210 case SB_VERT: 1211 if (!vertScrollInfo) 1212 { 1213 vertScrollInfo = (SCROLLBAR_INFO*)malloc(sizeof(SCROLLBAR_INFO)); 1214 vertScrollInfo->MinVal = vertScrollInfo->CurVal = vertScrollInfo->Page = 0; 1215 vertScrollInfo->MaxVal = 100; 1216 vertScrollInfo->flags = ESB_ENABLE_BOTH; 1217 } 1206 1218 return vertScrollInfo; 1207 1219 } … … 1362 1374 DrawMaxButton(hdc,pressed,FALSE); 1363 1375 } 1364 } while ( (msg.message != WM_LBUTTONUP) && (msg.message != WM_NCLBUTTONUP));1376 } while (msg.message != WM_LBUTTONUP); 1365 1377 if (wParam == HTMINBUTTON) 1366 1378 DrawMinButton(hdc,FALSE,FALSE); … … 1408 1420 if (pressed != oldstate) 1409 1421 DrawCloseButton(hdc, pressed, FALSE); 1410 } while ( (msg.message != WM_LBUTTONUP) && (msg.message != WM_NCLBUTTONUP));1422 } while (msg.message != WM_LBUTTONUP); 1411 1423 DrawCloseButton(hdc,FALSE,FALSE); 1412 1424 ReleaseCapture(); … … 1554 1566 clientRect = &((NCCALCSIZE_PARAMS*)winRect)->rgrc[2]; 1555 1567 *clientRect = rectWindow; 1556 if (getParent()) MapWindowPoints(0,getParent()->getOS2WindowHandle(),(PPOINT)clientRect,2);1568 if (getParent()) mapWin32Rect(OSLIB_HWND_DESKTOP,getParent()->getOS2WindowHandle(),clientRect); 1557 1569 1558 1570 if(!(dwStyle & WS_MINIMIZE)) … … 1712 1724 if ((dwStyle & WS_VSCROLL) && 1713 1725 (pt.x >= rect.right - GetSystemMetrics(SM_CXVSCROLL))) 1714 return HTSIZE;1726 return (dwStyle & WS_CHILD) ? HTSIZE:HTBOTTOMRIGHT; 1715 1727 return HTHSCROLL; 1716 1728 } … … 1962 1974 { 1963 1975 RECT r = *rect; 1964 char 1976 char buffer[256]; 1965 1977 HPEN hPrevPen; 1966 1978 HMENU hSysMenu; … … 2059 2071 ((clip > 1) ?(DCX_INTERSECTRGN /*| DCX_KEEPCLIPRGN*/) : 0) ))) return; 2060 2072 2061 2062 2073 rect.top = rect.left = 0; 2063 2074 rect.right = rectWindow.right - rectWindow.left; … … 2126 2137 #if 0 //CB: todo 2127 2138 if (dwStyle & WS_VSCROLL) 2128 SCROLL_DrawScrollBar( hwnd, hdc, SB_VERT, TRUE, TRUE);2139 SCROLL_DrawScrollBar(hwnd,hdc,SB_VERT,TRUE,TRUE); 2129 2140 if (wndPtr->dwStyle & WS_HSCROLL) 2130 SCROLL_DrawScrollBar( hwnd, hdc, SB_HORZ, TRUE, TRUE);2141 SCROLL_DrawScrollBar(hwnd,hdc,SB_HORZ,TRUE,TRUE); 2131 2142 #endif 2132 2143 /* Draw the "size-box" */ … … 2137 2148 r.top = r.bottom - GetSystemMetrics(SM_CYHSCROLL) + 1; 2138 2149 FillRect( hdc, &r, GetSysColorBrush(COLOR_SCROLLBAR) ); 2139 //CB: todo: use scroll code for size grip 2150 if (!(dwStyle & WS_CHILD)) 2151 { 2152 POINT p1,p2; 2153 HPEN penDark = GetSysColorPen(COLOR_3DSHADOW); 2154 HPEN penWhite = GetSysColorPen(COLOR_3DHILIGHT); 2155 HPEN oldPen = SelectObject(hdc,penDark); 2156 INT x; 2157 2158 p1.x = r.right-1; 2159 p1.y = r.bottom; 2160 p2.x = r.right; 2161 p2.y = r.bottom-1; 2162 for (x = 0;x < 3;x++) 2163 { 2164 SelectObject(hdc,penDark); 2165 MoveToEx(hdc,p1.x,p1.y,NULL); 2166 LineTo(hdc,p2.x,p2.y); 2167 p1.x--; 2168 p2.y--; 2169 MoveToEx(hdc,p1.x,p1.y,NULL); 2170 LineTo(hdc,p2.x,p2.y); 2171 SelectObject(hdc,penWhite); 2172 p1.x--; 2173 p2.y--; 2174 MoveToEx(hdc,p1.x,p1.y,NULL); 2175 LineTo(hdc,p2.x,p2.y); 2176 p1.x -= 2; 2177 p2.y -= 2; 2178 } 2179 2180 SelectObject(hdc,oldPen); 2181 } 2140 2182 } 2141 2183 … … 2146 2188 LONG Win32BaseWindow::HandleNCPaint(HRGN clip) 2147 2189 { 2148 if (!(dwStyle & WS_VISIBLE)) return 0; 2149 2150 if (dwStyle & WS_MINIMIZE) return 0; //CB: to check 2190 //CB: ignore it for now (SetWindowPos in WM_CREATE) 2191 // if (!(dwStyle & WS_VISIBLE)) return 0; 2192 2193 if (dwStyle & WS_MINIMIZE) return 0; 2151 2194 2152 2195 DoNCPaint(clip,FALSE); … … 2404 2447 { 2405 2448 case WM_CLOSE: 2406 dprintf(("DefWindowProcA: WM_CLOSE %x", getWindowHandle()));2449 dprintf(("DefWindowProcA: WM_CLOSE %x", getWindowHandle())); 2407 2450 DestroyWindow(); 2408 2451 return 0; … … 2439 2482 } 2440 2483 dprintf(("WM_SETTEXT of %x to %s\n", Win32Hwnd, lParam)); 2441 2484 if (dwStyle & WS_CAPTION) 2485 { 2486 //CB: optimize! 2487 HandleNCPaint(0); 2488 } 2489 /* //CB: endless loop in trackbar.exe -> to fix 2442 2490 if(OS2HwndFrame && (dwStyle & WS_CAPTION) == WS_CAPTION) 2443 2491 return OSLibWinSetWindowText(OS2HwndFrame,(LPSTR)windowNameA); 2444 2492 */ 2445 2493 return TRUE; 2446 2494 } … … 2892 2940 point.x = pt.x; 2893 2941 point.y = pt.y; 2894 MapWindowPoints(Win32Hwnd,getParent()->getWindowHandle(),&point,1);2942 mapWin32Point(OS2Hwnd,getParent()->getOS2WindowHandle(),(OSLIBPOINT*)&point); 2895 2943 NotifyParent(Msg,wParam,MAKELPARAM(point.x,point.y)); 2896 2944 } … … 3216 3264 } 3217 3265 } 3218 #if 0 3266 //CB: todo 3267 #if 0 3219 3268 if (isFrameWindow()) 3220 3269 { … … 3245 3294 } 3246 3295 3247 //SWP_FRAMECHANGED is ignored, not necessary for OS/2 3296 if (fuFlags == SWP_FRAMECHANGED) 3297 { 3298 //CB: optimize: if frame size has changed not necessary! 3299 FrameUpdateFrame(this,0); 3300 } 3248 3301 3249 3302 return (rc); -
trunk/src/user32/new/win32wbase.h
r2353 r2377 1 /* $Id: win32wbase.h,v 1.1 8 2000-01-07 17:38:48cbratschi Exp $ */1 /* $Id: win32wbase.h,v 1.19 2000-01-08 16:47:50 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 112 112 Win32WndClass *getWindowClass() { return windowClass; }; 113 113 114 LONG getLastHitTestVal() { return lastHitTestVal; } 114 115 BOOL getIgnoreHitTest() { return fIgnoreHitTest; } 115 116 VOID setIgnoreHitTest(BOOL ignore) { fIgnoreHitTest = ignore; } -
trunk/src/user32/new/winmenu.cpp
r2363 r2377 1 /* $Id: winmenu.cpp,v 1.1 1 2000-01-08 12:06:53 sandervlExp $ */1 /* $Id: winmenu.cpp,v 1.12 2000-01-08 16:47:50 cbratschi Exp $ */ 2 2 3 3 /* … … 429 429 } 430 430 if(!lpsz || !cchMax) {//determine menu string length 431 432 431 char menustr[256]; 432 rc = O32_GetMenuString(hMenu, idItem, menustr, sizeof(menustr), fuFlags); 433 433 //SvL: Open32 returns the wrong error 434 434 return (rc == -1) ? 0 : rc; 435 435 } 436 436 rc = O32_GetMenuString(hMenu, idItem, lpsz, cchMax, fuFlags); … … 645 645 } 646 646 if(IS_STRING_ITEM(fuFlags) && HIWORD(lpszNewItem) != 0) { 647 648 } 649 647 dprintf(("ModifyMenuA %s", lpszNewItem)); 648 } 649 /* //CB: doesn't compile, but don't need it anyway 650 650 if(((fuFlags & (MF_BYCOMMAND|MF_BYPOSITION|MF_POPUP)) == MF_BYCOMMAND) && uItem != idNewItem) { 651 DWORD pos = OSLibGetMenuItemPos(hMenu, uItem); 652 ODIN_DeleteMenu(hMenu, uItem, MF_BYCOMMAND); 653 return ODIN_InsertMenuA(hMenu, pos, fuFlags | MF_BYPOSITION, idNewItem, lpszNewItem); 654 } 651 DWORD pos = OSLibGetMenuItemPos(hMenu, uItem); 652 ODIN_DeleteMenu(hMenu, uItem, MF_BYCOMMAND); 653 return ODIN_InsertMenuA(hMenu, pos, fuFlags | MF_BYPOSITION, idNewItem, lpszNewItem); 654 } 655 */ 655 656 return O32_ModifyMenu(hMenu, uItem, fuFlags, idNewItem, lpszNewItem); 656 657 } … … 756 757 //SvL: RealPlayer calls InsertMenu with flag 0 & pos -1 757 758 if((flags & (MF_BYCOMMAND|MF_BYPOSITION)) == 0 && (pos == 0xffffffff)) 758 759 flags |= MF_BYPOSITION; 759 760 760 761 return O32_InsertMenu(hMenu, pos, flags, id, str);
Note:
See TracChangeset
for help on using the changeset viewer.