Changeset 17521
- Timestamp:
- Oct 7, 2001, 1:48:29 PM (24 years ago)
- Location:
- tags/trunk/src/user32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified tags/trunk/src/user32/Makefile ¶
r17501 r17521 1 # $Id: Makefile,v 1.9 6 2001-10-03 18:37:51sandervl Exp $1 # $Id: Makefile,v 1.97 2001-10-07 11:48:27 sandervl Exp $ 2 2 3 3 # … … 64 64 $(OBJDIR)\winproc.obj \ 65 65 $(OBJDIR)\oslibmsg.obj \ 66 $(OBJDIR)\wintrack.obj \67 66 $(OBJDIR)\hook.obj \ 68 67 $(OBJDIR)\win32wmdiclient.obj \ … … 99 98 $(OBJDIR)\caret.obj \ 100 99 $(OBJDIR)\text.obj \ 100 $(OBJDIR)\wintrack.obj \ 101 101 $(OBJDIR)\oldnls32.obj \ 102 102 $(OBJDIR)\user32rsrc.obj \ -
TabularUnified tags/trunk/src/user32/pmwindow.cpp ¶
r17501 r17521 1 /* $Id: pmwindow.cpp,v 1.15 2 2001-10-03 18:37:52sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.153 2001-10-07 11:48:28 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 1406 1406 if(fOS2Look) {//sent by titlebar control 1407 1407 #ifdef CUSTOM_TRACKFRAME 1408 Frame_SysCommandSizeMove(win32wnd, SC_MOVE_W );1408 Frame_SysCommandSizeMove(win32wnd, SC_MOVE_W+HTCAPTION_W); 1409 1409 #else 1410 1410 FrameTrackFrame(win32wnd, TF_MOVE); -
TabularUnified tags/trunk/src/user32/uitools.cpp ¶
r15619 r17521 1 /* $Id: uitools.cpp,v 1. 29 2001-02-02 19:04:02sandervl Exp $ */1 /* $Id: uitools.cpp,v 1.30 2001-10-07 11:48:28 sandervl Exp $ */ 2 2 /* 3 3 * User Interface Functions … … 1616 1616 BOOL WIN32API DrawFocusRect( HDC hdc, const RECT *lpRect) 1617 1617 { 1618 #if 0 1619 //TODO: This doens't work. Find out why 1620 1621 HBRUSH hOldBrush; 1622 HPEN hOldPen, hNewPen; 1623 INT oldDrawMode, oldBkMode; 1624 1625 dprintf(("USER32: DrawFocusRect %x %x", hdc, lpRect)); 1626 1627 hOldBrush = SelectObject(hdc, GetStockObject(NULL_BRUSH)); 1628 hNewPen = CreatePen(PS_ALTERNATE, 1, GetSysColor(COLOR_WINDOWTEXT)); 1629 hOldPen = SelectObject(hdc, hNewPen); 1630 oldDrawMode = SetROP2(hdc, R2_XORPEN); 1631 oldBkMode = SetBkMode(hdc, TRANSPARENT); 1632 1633 Rectangle(hdc, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); 1634 1635 SetBkMode(hdc, oldBkMode); 1636 SetROP2(hdc, oldDrawMode); 1637 SelectObject(hdc, hOldPen); 1638 DeleteObject(hNewPen); 1639 SelectObject(hdc, hOldBrush); 1640 1641 return TRUE; 1642 #else 1618 1643 BOOL rc; 1619 1644 … … 1621 1646 dprintf(("USER32: DrawFocusRect %x %x returned %d", hdc, lpRect, rc)); 1622 1647 return rc; 1648 #endif 1623 1649 } 1624 1650 //****************************************************************************** -
TabularUnified tags/trunk/src/user32/wintrack.cpp ¶
r17501 r17521 1 1 /* 2 * Window position related functions. 2 * Window tracking related functions. 3 * 4 * Copyright 2001 Sander van Leeuwen 5 * 6 * Changes from Wine code: (20011004) 7 * - Only draw changed track frame instead of clearing the old one and 8 * drawing the new one (less flickering) 9 * - Send WM_MOVING when moving a window (not done in Wine) 10 * - Send WM_SIZING only when sizing a window 11 * - Fixed handling of rectangles changed by WM_SIZING/MOVING 12 * 13 * Based on Wine code: (dlls\x11drv\winpos.c) 3 14 * 4 15 * Copyright 1993, 1994, 1995, 2001 Alexandre Julliard 5 16 * Copyright 1995, 1996, 1999 Alex Korobka 6 *7 * TODO: too much flickering when drawing sizing border.8 * should be rewritten to only draw changed borders9 17 * 10 18 */ … … 37 45 * FIXME: This causes problems in Win95 mode. (why?) 38 46 */ 39 static void draw_moving_frame( HDC hdc, RECT *rect, BOOL thickframe 47 static void draw_moving_frame( HDC hdc, RECT *rect, BOOL thickframe, DWORD hittest, BOOL fRedraw) 40 48 { 41 49 if (thickframe) … … 44 52 const int height = GetSystemMetrics(SM_CYFRAME); 45 53 54 static RECT oldRect = {0}; 55 56 if(fRedraw && EqualRect(&oldRect, rect)) { 57 return; 58 } 59 46 60 HBRUSH hbrush = SelectObject( hdc, GetStockObject( GRAY_BRUSH ) ); 47 PatBlt( hdc, rect->left, rect->top, 48 rect->right - rect->left - width, height, PATINVERT ); 49 PatBlt( hdc, rect->left, rect->top + height, width, 50 rect->bottom - rect->top - height, PATINVERT ); 51 PatBlt( hdc, rect->left + width, rect->bottom - 1, 52 rect->right - rect->left - width, -height, PATINVERT ); 53 PatBlt( hdc, rect->right - 1, rect->top, -width, 54 rect->bottom - rect->top - height, PATINVERT ); 61 if(fRedraw && hittest != HTCAPTION) 62 { 63 int x, y, linewidth, lineheight; 64 65 //This should be done in a better way (less code), but at least 66 //it works. 67 switch(hittest) { 68 case HTLEFT: 69 //clear old edge 70 PatBlt( hdc, oldRect.left, oldRect.top + height, 71 width, RECT_HEIGHT(&oldRect) - 2*height, PATINVERT ); 72 //and draw new one 73 PatBlt( hdc, rect->left, rect->top + height, 74 width, RECT_HEIGHT(rect) - 2*height, PATINVERT ); 75 76 if(oldRect.left > rect->left) { 77 x = rect->left; 78 linewidth = oldRect.left - rect->left; 79 } 80 else { 81 x = oldRect.left; 82 linewidth = rect->left - oldRect.left; 83 } 84 PatBlt(hdc, x, oldRect.top, linewidth, height, PATINVERT); 85 PatBlt(hdc, x, oldRect.bottom-1, linewidth, -height, PATINVERT); 86 break; 87 case HTRIGHT: 88 //clear old edge 89 PatBlt( hdc, oldRect.right-1, oldRect.top + height, 90 -width, RECT_HEIGHT(&oldRect) - 2*height, PATINVERT ); 91 //and draw new one 92 PatBlt( hdc, rect->right-1, rect->top + height, 93 -width, RECT_HEIGHT(rect) - 2*height, PATINVERT ); 94 95 if(oldRect.right > rect->right) { 96 x = rect->right; 97 linewidth = oldRect.right - rect->right; 98 } 99 else { 100 x = oldRect.right; 101 linewidth = rect->right - oldRect.right; 102 } 103 PatBlt( hdc, x, oldRect.top, linewidth, height, PATINVERT ); 104 PatBlt( hdc, x, oldRect.bottom-1, linewidth, -height, PATINVERT ); 105 break; 106 107 case HTTOP: 108 //clear old edge 109 PatBlt( hdc, oldRect.left + width, oldRect.top, 110 RECT_WIDTH(&oldRect) - 2*width, height, PATINVERT ); 111 //and draw new one 112 PatBlt( hdc, rect->left + width, rect->top, 113 RECT_WIDTH(rect) - 2*width, height, PATINVERT ); 114 115 if(oldRect.top > rect->top) { 116 y = rect->top; 117 lineheight = oldRect.top - rect->top; 118 } 119 else { 120 y = oldRect.top; 121 lineheight = rect->top - oldRect.top; 122 } 123 124 PatBlt( hdc, oldRect.left, y, width, lineheight, PATINVERT ); 125 PatBlt( hdc, oldRect.right - 1, y, -width, lineheight, PATINVERT ); 126 break; 127 128 case HTBOTTOM: 129 //clear old edge 130 PatBlt( hdc, oldRect.left + width, oldRect.bottom-1, 131 RECT_WIDTH(&oldRect) - 2*width, -height, PATINVERT ); 132 //and draw new one 133 PatBlt( hdc, rect->left + width, rect->bottom-1, 134 RECT_WIDTH(rect) - 2*width, -height, PATINVERT ); 135 136 if(oldRect.bottom > rect->bottom) { 137 y = rect->bottom; 138 lineheight = oldRect.bottom - rect->bottom; 139 } 140 else { 141 y = oldRect.bottom; 142 lineheight = rect->bottom - oldRect.bottom; 143 } 144 145 PatBlt( hdc, oldRect.left, y, width, lineheight, PATINVERT ); 146 PatBlt( hdc, oldRect.right - 1, y, -width, lineheight, PATINVERT ); 147 break; 148 149 case HTBOTTOMLEFT: 150 //clear old edge (bottom) 151 PatBlt( hdc, oldRect.left, oldRect.bottom-1, 152 RECT_WIDTH(&oldRect) - width, -height, PATINVERT ); 153 //and draw new one 154 PatBlt( hdc, rect->left, rect->bottom-1, 155 RECT_WIDTH(rect) - width, -height, PATINVERT ); 156 157 //clear old edge (left) 158 PatBlt( hdc, oldRect.left, oldRect.top + height, 159 width, RECT_HEIGHT(&oldRect) - 2*height, PATINVERT ); 160 //and draw new one 161 PatBlt( hdc, rect->left, rect->top + height, 162 width, RECT_HEIGHT(rect) - 2*height, PATINVERT ); 163 164 //right 165 if(oldRect.bottom > rect->bottom) { 166 y = rect->bottom; 167 lineheight = oldRect.bottom - rect->bottom; 168 } 169 else { 170 y = oldRect.bottom; 171 lineheight = rect->bottom - oldRect.bottom; 172 } 173 PatBlt( hdc, oldRect.right-1, y, -width, lineheight, PATINVERT ); 174 175 //top 176 if(oldRect.left > rect->left) { 177 x = rect->left; 178 linewidth = oldRect.left - rect->left; 179 } 180 else { 181 x = oldRect.left; 182 linewidth = rect->left - oldRect.left; 183 } 184 PatBlt(hdc, x, oldRect.top, linewidth, height, PATINVERT); 185 break; 186 187 case HTBOTTOMRIGHT: 188 //clear old edge (bottom) 189 PatBlt( hdc, oldRect.left + width, oldRect.bottom-1, 190 RECT_WIDTH(&oldRect) - width, -height, PATINVERT ); 191 //and draw new one 192 PatBlt( hdc, rect->left + width, rect->bottom-1, 193 RECT_WIDTH(rect) - width, -height, PATINVERT ); 194 195 //clear old edge (right) 196 PatBlt( hdc, oldRect.right-1, oldRect.top + height, 197 -width, RECT_HEIGHT(&oldRect) - 2*height, PATINVERT ); 198 //and draw new one 199 PatBlt( hdc, rect->right-1, rect->top + height, 200 -width, RECT_HEIGHT(rect) - 2*height, PATINVERT ); 201 202 //left 203 if(oldRect.bottom > rect->bottom) { 204 y = rect->bottom; 205 lineheight = oldRect.bottom - rect->bottom; 206 } 207 else { 208 y = oldRect.bottom; 209 lineheight = rect->bottom - oldRect.bottom; 210 } 211 PatBlt( hdc, oldRect.left, y, width, lineheight, PATINVERT ); 212 213 //top 214 if(oldRect.right > rect->right) { 215 x = rect->right; 216 linewidth = oldRect.right - rect->right; 217 } 218 else { 219 x = oldRect.right; 220 linewidth = rect->right - oldRect.right; 221 } 222 PatBlt(hdc, x, oldRect.top, linewidth, height, PATINVERT); 223 break; 224 225 case HTTOPLEFT: 226 //clear old edge (top) 227 PatBlt( hdc, oldRect.left, oldRect.top, 228 RECT_WIDTH(&oldRect) - width, height, PATINVERT ); 229 //and draw new one 230 PatBlt( hdc, rect->left, rect->top, 231 RECT_WIDTH(rect) - width, height, PATINVERT ); 232 233 //clear old edge (left) 234 PatBlt( hdc, oldRect.left, oldRect.top + height, 235 width, RECT_HEIGHT(&oldRect) - 2*height, PATINVERT ); 236 //and draw new one 237 PatBlt( hdc, rect->left, rect->top + height, 238 width, RECT_HEIGHT(rect) - 2*height, PATINVERT ); 239 240 //right 241 if(oldRect.top > rect->top) { 242 y = rect->top; 243 lineheight = oldRect.top - rect->top; 244 } 245 else { 246 y = oldRect.top; 247 lineheight = rect->top - oldRect.top; 248 } 249 PatBlt( hdc, oldRect.right-1, y, -width, lineheight, PATINVERT ); 250 251 //bottom 252 if(oldRect.left > rect->left) { 253 x = rect->left; 254 linewidth = oldRect.left - rect->left; 255 } 256 else { 257 x = oldRect.left; 258 linewidth = rect->left - oldRect.left; 259 } 260 PatBlt(hdc, x, oldRect.bottom-1, linewidth, -height, PATINVERT); 261 break; 262 263 case HTTOPRIGHT: 264 //clear old edge (top) 265 PatBlt( hdc, oldRect.left+width, oldRect.top, 266 RECT_WIDTH(&oldRect) - width, height, PATINVERT ); 267 //and draw new one 268 PatBlt( hdc, rect->left+width, rect->top, 269 RECT_WIDTH(rect) - width, height, PATINVERT ); 270 271 //clear old edge (right) 272 PatBlt( hdc, oldRect.right-1, oldRect.top + height, 273 -width, RECT_HEIGHT(&oldRect) - 2*height, PATINVERT ); 274 //and draw new one 275 PatBlt( hdc, rect->right-1, rect->top + height, 276 -width, RECT_HEIGHT(rect) - 2*height, PATINVERT ); 277 278 //left 279 if(oldRect.top > rect->top) { 280 y = rect->top; 281 lineheight = oldRect.top - rect->top; 282 } 283 else { 284 y = oldRect.top; 285 lineheight = rect->top - oldRect.top; 286 } 287 PatBlt( hdc, oldRect.left, y, width, lineheight, PATINVERT); 288 289 //bottom 290 if(oldRect.right > rect->right) { 291 x = rect->right; 292 linewidth = oldRect.right - rect->right; 293 } 294 else { 295 x = oldRect.right; 296 linewidth = rect->right - oldRect.right; 297 } 298 PatBlt(hdc, x, oldRect.bottom-1, linewidth, -height, PATINVERT); 299 break; 300 } 301 oldRect = *rect; 302 } 303 else { 304 if(fRedraw) { 305 PatBlt( hdc, oldRect.left, oldRect.top, 306 RECT_WIDTH(&oldRect) - width, height, PATINVERT ); 307 PatBlt( hdc, oldRect.left, oldRect.top + height, width, 308 RECT_HEIGHT(&oldRect) - height, PATINVERT ); 309 PatBlt( hdc, oldRect.left + width, oldRect.bottom - 1, 310 RECT_WIDTH(&oldRect) - width, -height, PATINVERT ); 311 PatBlt( hdc, oldRect.right - 1, oldRect.top, -width, 312 RECT_HEIGHT(&oldRect) - height, PATINVERT ); 313 } 314 oldRect = *rect; 315 PatBlt( hdc, rect->left, rect->top, 316 rect->right - rect->left - width, height, PATINVERT ); 317 PatBlt( hdc, rect->left, rect->top + height, width, 318 rect->bottom - rect->top - height, PATINVERT ); 319 PatBlt( hdc, rect->left + width, rect->bottom - 1, 320 rect->right - rect->left - width, -height, PATINVERT ); 321 PatBlt( hdc, rect->right - 1, rect->top, -width, 322 rect->bottom - rect->top - height, PATINVERT ); 323 } 55 324 SelectObject( hdc, hbrush ); 56 325 } … … 158 427 HWND hwnd = win32wnd->getWindowHandle(); 159 428 MSG msg; 160 RECT sizingRect, mouseRect, origRect ;429 RECT sizingRect, mouseRect, origRect, lastsizingRect; 161 430 HDC hdc; 162 431 HWND parent; … … 321 590 } 322 591 else if(!DragFullWindows) 323 draw_moving_frame( hdc, &sizingRect, thickframe );592 draw_moving_frame( hdc, &sizingRect, thickframe, hittest, FALSE ); 324 593 } 325 594 … … 340 609 if (ON_BOTTOM_BORDER(hittest)) newRect.bottom += dy; 341 610 342 if(!iconic && !DragFullWindows) draw_moving_frame( hdc, &sizingRect, thickframe);611 //// if(!iconic && !DragFullWindows) draw_moving_frame( hdc, &sizingRect, thickframe, hittest, TRUE); 343 612 344 613 /* determine the hit location */ … … 360 629 dprintf(("WM_SIZING rect (%d,%d)(%d,%d)", newRect.left, newRect.top, newRect.right, newRect.bottom)); 361 630 362 #ifdef __WIN32OS2__ 363 if(RECT_EQUAL(&newRect, &tempRect) || 364 (dy > 0 && RECT_HEIGHT(&newRect) > RECT_HEIGHT(&tempRect)) || 365 (dx > 0 && RECT_WIDTH(&newRect) > RECT_WIDTH(&tempRect)) ) 366 { 367 dprintf(("update capture point dx %d dy %d", dx, dy)); 368 capturePoint = pt; 369 sizingRect = newRect; 370 } 371 #endif 631 dprintf(("update capture point dx %d dy %d", dx, dy)); 632 capturePoint = pt; 633 sizingRect = tempRect; 634 lastsizingRect = newRect; 635 372 636 if (!iconic) 373 637 { 374 638 if(!DragFullWindows) 375 draw_moving_frame( hdc, &newRect, thickframe );639 draw_moving_frame( hdc, &newRect, thickframe, hittest, TRUE ); 376 640 else { 377 641 /* To avoid any deadlocks, all the locks on the windows … … 404 668 } 405 669 else if (moved && !DragFullWindows) 406 draw_moving_frame( hdc, & sizingRect, thickframe);670 draw_moving_frame( hdc, &lastsizingRect, thickframe, hittest, FALSE); 407 671 408 672 ReleaseDC( parent, hdc ); … … 419 683 // wine_tsx11_unlock(); 420 684 421 if (HOOK_CallHooksA( WH_CBT, HCBT_MOVESIZE, (WPARAM)hwnd, (LPARAM)& sizingRect )) moved = FALSE;685 if (HOOK_CallHooksA( WH_CBT, HCBT_MOVESIZE, (WPARAM)hwnd, (LPARAM)&lastsizingRect )) moved = FALSE; 422 686 423 687 SendMessageA( hwnd, WM_EXITSIZEMOVE, 0, 0 ); … … 438 702 /* NOTE: SWP_NOACTIVATE prevents document window activation in Word 6 */ 439 703 if(!DragFullWindows) 440 SetWindowPos( hwnd, 0, sizingRect.left,sizingRect.top,441 sizingRect.right -sizingRect.left,442 sizingRect.bottom -sizingRect.top,704 SetWindowPos( hwnd, 0, lastsizingRect.left, lastsizingRect.top, 705 lastsizingRect.right - lastsizingRect.left, 706 lastsizingRect.bottom - lastsizingRect.top, 443 707 ( hittest == HTCAPTION ) ? SWP_NOSIZE : 0 ); 444 708 }
Note:
See TracChangeset
for help on using the changeset viewer.