Changeset 1336 for trunk/src/user32/win32wbasepos.cpp
- Timestamp:
- Oct 17, 1999, 5:46:10 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/win32wbasepos.cpp
r1322 r1336 1 /* $Id: win32wbasepos.cpp,v 1. 2 1999-10-16 14:51:43sandervl Exp $ */1 /* $Id: win32wbasepos.cpp,v 1.3 1999-10-17 15:46:10 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (nonclient/position methods) … … 11 11 * 12 12 * TODO: Not thread/process safe 13 * 14 * Wine code based on build 990815 13 15 * 14 16 * Project Odin Software License can be found in LICENSE.TXT … … 41 43 #include "win32wdesktop.h" 42 44 45 /* Some useful macros */ 43 46 #define HAS_DLGFRAME(style,exStyle) \ 44 47 (((exStyle) & WS_EX_DLGMODALFRAME) || \ 45 (((style) & WS_DLGFRAME) && !((style) & WS_ BORDER)))46 47 #define HAS_THICKFRAME(style ) \48 (((style) & WS_DLGFRAME) && !((style) & WS_THICKFRAME))) 49 50 #define HAS_THICKFRAME(style,exStyle) \ 48 51 (((style) & WS_THICKFRAME) && \ 49 !(((style) & (WS_DLGFRAME|WS_BORDER)) == WS_DLGFRAME)) 52 !((exStyle) & WS_EX_DLGMODALFRAME)) 53 54 #define HAS_THINFRAME(style) \ 55 (((style) & WS_BORDER) || !((style) & (WS_CHILD | WS_POPUP))) 56 57 #define HAS_BIGFRAME(style,exStyle) \ 58 (((style) & (WS_THICKFRAME | WS_DLGFRAME)) || \ 59 ((exStyle) & WS_EX_DLGMODALFRAME)) 60 61 #define HAS_ANYFRAME(style,exStyle) \ 62 (((style) & (WS_THICKFRAME | WS_DLGFRAME | WS_BORDER)) || \ 63 ((exStyle) & WS_EX_DLGMODALFRAME) || \ 64 !((style) & (WS_CHILD | WS_POPUP))) 50 65 51 66 #define HAS_3DFRAME(exStyle) \ … … 194 209 { 195 210 xinc = yinc = 0; 196 if (HAS_THICKFRAME(dwStyle ))211 if (HAS_THICKFRAME(dwStyle, dwExStyle)) 197 212 { 198 213 xinc += GetSystemMetrics(SM_CXFRAME); … … 284 299 dprintf(("NCHandleCalcSize Adjusted client rect (%d,%d) (%d,%d)", ncsize->rgrc[0].left, ncsize->rgrc[0].top, ncsize->rgrc[0].right, ncsize->rgrc[0].bottom)); 285 300 286 #if 0 287 //relative to frame -> relative to itself 288 ncsize->rgrc[0].right -= ncsize->rgrc[0].left; 289 ncsize->rgrc[0].left = 0; 290 ncsize->rgrc[0].bottom -= ncsize->rgrc[0].top; 291 ncsize->rgrc[0].top = 0; 292 #endif 301 OffsetRect(&ncsize->rgrc[0], -ncsize->rgrc[0].left, -ncsize->rgrc[0].top); 293 302 } 294 303 #if 0 … … 299 308 return result; 300 309 } 310 /*********************************************************************** 311 * WIN_WindowNeedsWMBorder 312 * 313 * This method defines the rules for a window to have a WM border, 314 * caption... It is used for consitency purposes. 315 */ 316 BOOL Win32BaseWindow::WindowNeedsWMBorder( DWORD style, DWORD exStyle ) 317 { 318 // if (!(style & WS_CHILD) && Options.managed && 319 if (!(style & WS_CHILD) && 320 (((style & WS_CAPTION) == WS_CAPTION) || 321 (style & WS_THICKFRAME))) 322 return TRUE; 323 return FALSE; 324 } 325 /****************************************************************************** 326 * NC_AdjustRectOuter95 327 * 328 * Computes the size of the "outside" parts of the window based on the 329 * parameters of the client area. 330 * 331 + PARAMS 332 * LPRECT16 rect 333 * DWORD style 334 * BOOL32 menu 335 * DWORD exStyle 336 * 337 * NOTES 338 * "Outer" parts of a window means the whole window frame, caption and 339 * menu bar. It does not include "inner" parts of the frame like client 340 * edge, static edge or scroll bars. 341 * 342 * Revision history 343 * 05-Jul-1997 Dave Cuthbert (dacut@ece.cmu.edu) 344 * Original (NC_AdjustRect95) cut & paste from NC_AdjustRect 345 * 346 * 20-Jun-1998 Eric Kohl (ekohl@abo.rhein-zeitung.de) 347 * Split NC_AdjustRect95 into NC_AdjustRectOuter95 and 348 * NC_AdjustRectInner95 and added handling of Win95 styles. 349 * 350 * 28-Jul-1999 Ove Kåven (ovek@arcticnet.no) 351 * Streamlined window style checks. 352 * 353 *****************************************************************************/ 354 void Win32BaseWindow::NC_AdjustRectOuter(LPRECT rect, DWORD style, BOOL menu, DWORD exStyle) 355 { 356 if(style & WS_ICONIC) return; 357 358 /* Decide if the window will be managed (see CreateWindowEx) */ 359 // if (!WindowNeedsWMBorder(style, exStyle)) 360 // { 361 if (HAS_THICKFRAME( style, exStyle )) 362 InflateRect( rect, GetSystemMetrics(SM_CXFRAME), GetSystemMetrics(SM_CYFRAME) ); 363 else 364 if (HAS_DLGFRAME( style, exStyle )) 365 InflateRect(rect, GetSystemMetrics(SM_CXDLGFRAME), GetSystemMetrics(SM_CYDLGFRAME) ); 366 else 367 if (HAS_THINFRAME( style )) 368 InflateRect( rect, GetSystemMetrics(SM_CXBORDER), GetSystemMetrics(SM_CYBORDER)); 369 370 if ((style & WS_CAPTION) == WS_CAPTION) 371 { 372 if (exStyle & WS_EX_TOOLWINDOW) 373 rect->top -= GetSystemMetrics(SM_CYSMCAPTION); 374 else 375 rect->top -= GetSystemMetrics(SM_CYCAPTION); 376 } 377 // } 378 379 if (menu) 380 rect->top -= GetSystemMetrics(SM_CYMENU); 381 } 382 /****************************************************************************** 383 * NC_AdjustRectInner95 384 * 385 * Computes the size of the "inside" part of the window based on the 386 * parameters of the client area. 387 * 388 + PARAMS 389 * LPRECT16 rect 390 * DWORD style 391 * DWORD exStyle 392 * 393 * NOTES 394 * "Inner" part of a window means the window frame inside of the flat 395 * window frame. It includes the client edge, the static edge and the 396 * scroll bars. 397 * 398 * Revision history 399 * 05-Jul-1997 Dave Cuthbert (dacut@ece.cmu.edu) 400 * Original (NC_AdjustRect95) cut & paste from NC_AdjustRect 401 * 402 * 20-Jun-1998 Eric Kohl (ekohl@abo.rhein-zeitung.de) 403 * Split NC_AdjustRect95 into NC_AdjustRectOuter95 and 404 * NC_AdjustRectInner95 and added handling of Win95 styles. 405 * 406 *****************************************************************************/ 407 void Win32BaseWindow::NC_AdjustRectInner(LPRECT rect, DWORD style, DWORD exStyle) 408 { 409 if(style & WS_ICONIC) return; 410 411 if (exStyle & WS_EX_CLIENTEDGE) 412 InflateRect(rect, GetSystemMetrics(SM_CXEDGE), GetSystemMetrics(SM_CYEDGE)); 413 414 if (exStyle & WS_EX_STATICEDGE) 415 InflateRect(rect, GetSystemMetrics(SM_CXBORDER), GetSystemMetrics(SM_CYBORDER)); 416 417 if (style & WS_VSCROLL) rect->right += GetSystemMetrics(SM_CXVSCROLL); 418 if (style & WS_HSCROLL) rect->bottom += GetSystemMetrics(SM_CYHSCROLL); 419 } 301 420 //****************************************************************************** 302 421 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.