- Timestamp:
- Jun 26, 1999, 5:29:11 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/uitools.cpp
r161 r221 1 /* $Id: uitools.cpp,v 1. 2 1999-06-23 16:36:56achimha Exp $ */1 /* $Id: uitools.cpp,v 1.3 1999-06-26 15:29:11 achimha Exp $ */ 2 2 /* 3 3 * User Interface Functions … … 6 6 * Copyright 1997 Bertho A. Stultiens 7 7 * Copyright 1999 Achim Hasenmueller 8 * Copyright 1999 Christoph Bratschi 8 9 */ 9 10 … … 100 101 * See also comments with UITOOLS_DrawRectEdge() 101 102 */ 102 static BOOL UITOOLS95_DrawDiagEdge(HDC hdc, LPRECT rc, 103 103 static BOOL UITOOLS95_DrawDiagEdge(HDC hdc, LPRECT rc, 104 UINT uType, UINT uFlags) 104 105 { 105 106 POINT Points[4]; … … 119 120 + (LTRBOuterMono[uType & (BDR_INNER|BDR_OUTER)] != -1 ? 1 : 0); 120 121 122 if (IsRectEmpty(rc)) return retval; //nothing to do 123 121 124 /* Init some vars */ 122 125 OuterPen = InnerPen = (HPEN)GetStockObject(NULL_PEN); 123 126 SavePen = (HPEN)SelectObject(hdc, InnerPen); 124 127 spx = spy = epx = epy = 0; /* Satisfy the compiler... */ 125 128 126 129 /* Determine the colors of the edges */ 127 130 if(uFlags & BF_MONO) … … 184 187 epy = rc->bottom; 185 188 spy = epy - SmallDiam; 189 epx++; 190 epy--; 186 191 break; 187 192 … … 193 198 epy = rc->top-1; 194 199 spy = epy + SmallDiam; 200 epx++; 201 epy++; 195 202 break; 196 203 … … 210 217 spy = rc->bottom-1; 211 218 epy = spy - SmallDiam; 219 epx--; 220 epy++; 212 221 break; 213 222 } … … 312 321 HBRUSH hbsave; 313 322 HBRUSH hb = GetSysColorBrush(uFlags & BF_MONO ? COLOR_WINDOW 314 323 :COLOR_BTNFACE); 315 324 HPEN hpsave; 316 325 HPEN hp = GetSysColorPen(uFlags & BF_MONO ? COLOR_WINDOW 317 326 : COLOR_BTNFACE); 318 327 hbsave = (HBRUSH)SelectObject(hdc, hb); 319 328 hpsave = (HPEN)SelectObject(hdc, hp); … … 345 354 * 346 355 * 23-Nov-1997: Changed by Bertho Stultiens 356 * 25-June-1999: Changed by Christoph Bratschi 357 * 358 * Attention: only draw in the rect's range! 359 * left to right-1 360 * top to bottom-1 347 361 * 348 362 * Well, I started testing this and found out that there are a few things … … 413 427 414 428 415 static BOOL UITOOLS95_DrawRectEdge(HDC hdc, LPRECT rc, 416 429 static BOOL UITOOLS95_DrawRectEdge(HDC hdc, LPRECT rc, 430 UINT uType, UINT uFlags) 417 431 { 418 432 char LTInnerI, LTOuterI; … … 430 444 || (uType & BDR_OUTER) == BDR_OUTER) 431 445 && !(uFlags & (BF_FLAT|BF_MONO)) ); 432 446 447 if (IsRectEmpty(rc)) return retval; //nothing to do 448 433 449 /* Init some vars */ 434 450 LTInnerPen = LTOuterPen = RBInnerPen = RBOuterPen = (HPEN)GetStockObject(NULL_PEN); … … 473 489 if((uFlags & BF_MIDDLE) && retval) 474 490 { 475 FillRect(hdc, &InnerRect, GetSysColorBrush(uFlags & BF_MONO ? 476 491 FillRect(hdc, &InnerRect, GetSysColorBrush(uFlags & BF_MONO ? 492 COLOR_WINDOW : COLOR_BTNFACE)); 477 493 } 478 494 … … 484 500 { 485 501 MoveToEx(hdc, InnerRect.left, InnerRect.top, NULL); 486 LineTo(hdc, InnerRect.right , InnerRect.top);502 LineTo(hdc, InnerRect.right-1, InnerRect.top); 487 503 } 488 504 if(uFlags & BF_LEFT) 489 505 { 490 506 MoveToEx(hdc, InnerRect.left, InnerRect.top, NULL); 491 LineTo(hdc, InnerRect.left, InnerRect.bottom); 492 } 507 LineTo(hdc, InnerRect.left, InnerRect.bottom-1); 508 } 509 493 510 SelectObject(hdc, RBOuterPen); 494 511 if(uFlags & BF_BOTTOM) 495 512 { 496 513 MoveToEx(hdc, InnerRect.right-1, InnerRect.bottom-1, NULL); 497 LineTo(hdc, InnerRect.left -1, InnerRect.bottom-1);514 LineTo(hdc, InnerRect.left, InnerRect.bottom-1); 498 515 } 499 516 if(uFlags & BF_RIGHT) 500 517 { 501 518 MoveToEx(hdc, InnerRect.right-1, InnerRect.bottom-1, NULL); 502 LineTo(hdc, InnerRect.right-1, InnerRect.top -1);519 LineTo(hdc, InnerRect.right-1, InnerRect.top); 503 520 } 504 521 … … 508 525 { 509 526 MoveToEx(hdc, InnerRect.left+LTpenplus, InnerRect.top+1, NULL); 510 LineTo(hdc, InnerRect.right-RTpenplus , InnerRect.top+1);527 LineTo(hdc, InnerRect.right-RTpenplus-1, InnerRect.top+1); 511 528 } 512 529 if(uFlags & BF_LEFT) 513 530 { 514 531 MoveToEx(hdc, InnerRect.left+1, InnerRect.top+LTpenplus, NULL); 515 LineTo(hdc, InnerRect.left+1, InnerRect.bottom-LBpenplus );532 LineTo(hdc, InnerRect.left+1, InnerRect.bottom-LBpenplus-1); 516 533 } 517 534 SelectObject(hdc, RBInnerPen); … … 519 536 { 520 537 MoveToEx(hdc, InnerRect.right-1-RBpenplus, InnerRect.bottom-2, NULL); 521 LineTo(hdc, InnerRect.left -1+LBpenplus, InnerRect.bottom-2);538 LineTo(hdc, InnerRect.left+LBpenplus, InnerRect.bottom-2); 522 539 } 523 540 if(uFlags & BF_RIGHT) 524 541 { 525 542 MoveToEx(hdc, InnerRect.right-2, InnerRect.bottom-1-RBpenplus, NULL); 526 LineTo(hdc, InnerRect.right-2, InnerRect.top -1+RTpenplus);543 LineTo(hdc, InnerRect.right-2, InnerRect.top+RTpenplus); 527 544 } 528 545 … … 551 568 { 552 569 553 if (flags & BF_DIAGONAL)570 if (flags & BF_DIAGONAL) 554 571 return UITOOLS95_DrawDiagEdge(hdc, rc, edge, flags); 555 572 else … … 558 575 559 576 /************************************************************************ 560 * 577 * UITOOLS_MakeSquareRect 561 578 * 562 579 * Utility to create a square rectangle and returning the width … … 587 604 588 605 /************************************************************************ 589 * 606 * UITOOLS_DFC_ButtonPush 590 607 * 591 608 * Draw a push button coming from DrawFrameControl() … … 657 674 658 675 /************************************************************************ 659 * 676 * UITOOLS_DFC_ButtonChcek 660 677 * 661 678 * Draw a check/3state button coming from DrawFrameControl() … … 767 784 768 785 /************************************************************************ 769 * 786 * UITOOLS_DFC_ButtonRadio 770 787 * 771 788 * Draw a radio/radioimage/radiomask button coming from DrawFrameControl() … … 1340 1357 if(GetMapMode(hdc) != MM_TEXT) 1341 1358 return FALSE; 1342 1359 1343 1360 switch(uType) 1344 1361 { … … 1353 1370 // default: 1354 1371 // WARN("(%x,%p,%d,%x), bad type!\n", 1355 // 1372 // hdc,rc,uType,uState ); 1356 1373 } 1357 1374 return FALSE;
Note:
See TracChangeset
for help on using the changeset viewer.