Changeset 219 for trunk/src/comctl32/trackbar.c
- Timestamp:
- Jun 26, 1999, 4:20:32 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/trackbar.c
r180 r219 1 /* $Id: trackbar.c,v 1. 7 1999-06-24 16:37:45cbratschi Exp $ */1 /* $Id: trackbar.c,v 1.8 1999-06-26 14:20:32 cbratschi Exp $ */ 2 2 /* 3 3 * Trackbar control … … 11 11 * TODO: 12 12 * 13 * - more notifications. 14 * - Fix Odin32/WINE DrawEdge() bugs 13 * - more notifications. (CB: should be complete) 14 * - TRACKBAR_UpdateThumb, TRACKBAR_UpdateThumbPosition: 15 * use a memory dc to avoid flickering by short movements 15 16 */ 16 17 … … 449 450 if (dwStyle & TBS_BOTH) 450 451 { 451 DrawEdge 452 FillRect 452 DrawEdge(hdc,&thumb,EDGE_RAISED,BF_RECT | BF_ADJUST); 453 FillRect(hdc,&thumb,hbr); 453 454 } else 454 455 { … … 462 463 if (dwStyle & TBS_LEFT) 463 464 { 465 HPEN oldPen,pen; 466 464 467 //Outline 465 468 … … 477 480 points[5].x = points[0].x; 478 481 points[5].y = points[0].y; 479 Polygon 482 Polygon(hdc,points,6); 480 483 481 484 //Edge … … 487 490 //Draw notch 488 491 489 triangle.right = points[0].x -1;490 triangle.top = points[0].y +1+1;492 triangle.right = points[0].x; 493 triangle.top = points[0].y; 491 494 triangle.left = points[1].x; 492 triangle.bottom = points[1].y+1; //Odin32 fix 493 DrawEdge(hdc,&triangle,EDGE_SUNKEN,BF_DIAGONAL | BF_DIAGONAL_ENDBOTTOMLEFT); 494 triangle.right = points[2].x; 495 triangle.bottom = points[2].y; 496 triangle.left = points[1].x; 497 triangle.top = points[1].y; //Odin32 bug: wrong lines 498 DrawEdge(hdc,&triangle,EDGE_SUNKEN,BF_DIAGONAL | BF_DIAGONAL_ENDTOPLEFT); 499 495 triangle.bottom = points[1].y; 496 DrawEdge(hdc,&triangle,EDGE_RAISED,BF_DIAGONAL | BF_DIAGONAL_ENDTOPRIGHT); 497 498 //draw this line direct, DrawEdge not useful 499 pen = GetSysColorPen(COLOR_3DDKSHADOW); 500 oldPen = SelectObject(hdc,pen); 501 MoveToEx(hdc,points[1].x,points[1].y,NULL); 502 LineTo(hdc,points[2].x-1,points[2].y-1); 503 pen = GetSysColorPen(COLOR_BTNSHADOW); 504 SelectObject(hdc,pen); 505 MoveToEx(hdc,points[1].x+1,points[1].y,NULL); 506 LineTo(hdc,points[2].x,points[2].y-1); 507 SelectObject(hdc,oldPen); 500 508 501 509 } else //Right 502 510 { 511 HPEN oldPen,pen; 512 503 513 //Outline 504 514 … … 516 526 points[5].x = points[0].x; 517 527 points[5].y = points[0].y; 518 Polygon 528 Polygon(hdc,points,6); 519 529 520 530 //Edge … … 525 535 //Draw notch 526 536 527 triangle.left = points[4].x; 528 triangle.top = points[4].y; 537 //draw this line direct, DrawEdge not useful 538 pen = GetSysColorPen(COLOR_3DLIGHT); 539 oldPen = SelectObject(hdc,pen); 540 MoveToEx(hdc,points[4].x,points[4].y,NULL); 541 LineTo(hdc,points[3].x-1,points[3].y-1); 542 pen = GetSysColorPen(COLOR_BTNHIGHLIGHT); 543 SelectObject(hdc,pen); 544 MoveToEx(hdc,points[4].x,points[4].y+1,NULL); 545 LineTo(hdc,points[3].x-2,points[3].y-1); 546 SelectObject(hdc,oldPen); 547 529 548 triangle.right = points[3].x; 530 triangle.bottom = points[3].y; 531 DrawEdge(hdc,&triangle,EDGE_SUNKEN,BF_DIAGONAL | BF_DIAGONAL_ENDBOTTOMRIGHT); 549 triangle.top = points[3].y; 532 550 triangle.left = points[2].x; 533 551 triangle.bottom = points[2].y; 534 triangle.right = points[3].x; 535 triangle.top = points[3].y; //Odin32: pixel bug 536 DrawEdge(hdc,&triangle,EDGE_SUNKEN,BF_DIAGONAL | BF_DIAGONAL_ENDTOPRIGHT); 552 DrawEdge(hdc,&triangle,EDGE_RAISED,BF_DIAGONAL | BF_DIAGONAL_ENDBOTTOMLEFT); 537 553 } 538 554 } else … … 556 572 points[5].x = points[0].x; 557 573 points[5].y = points[0].y; 558 Polygon 574 Polygon(hdc,points,6); 559 575 560 576 //Edge … … 571 587 triangle.top = points[1].y; 572 588 DrawEdge(hdc,&triangle,EDGE_RAISED,BF_DIAGONAL | BF_DIAGONAL_ENDTOPRIGHT); 573 triangle.right = points[1].x; 574 triangle.bottom = points[1].y; 575 triangle.left = points[2].x-1; 576 triangle.top = points[2].y-1; 577 DrawEdge(hdc,&triangle,EDGE_SUNKEN,BF_DIAGONAL | BF_DIAGONAL_ENDTOPLEFT); 589 590 591 triangle.left = points[1].x; 592 triangle.top = points[1].y; 593 triangle.right = points[2].x; 594 triangle.bottom = points[2].y; 595 DrawEdge(hdc,&triangle,EDGE_RAISED,BF_DIAGONAL | BF_DIAGONAL_ENDBOTTOMRIGHT); 578 596 579 597 } else //Bottom … … 595 613 points[5].x = points[0].x; 596 614 points[5].y = points[0].y; 597 Polygon 615 Polygon(hdc,points,6); 598 616 599 617 //Edge … … 605 623 //Draw notch 606 624 607 triangle.left = points[4].x; 608 triangle.top = points[4].y; //Odin32: wrong pixel at .y-1! 625 triangle.right = points[2].x; 626 triangle.top = points[2].y; 627 triangle.left = points[3].x; 628 triangle.bottom = points[3].y; 629 DrawEdge(hdc,&triangle,EDGE_RAISED,BF_DIAGONAL | BF_DIAGONAL_ENDBOTTOMLEFT); 609 630 triangle.right = points[3].x; 610 631 triangle.bottom = points[3].y; 611 DrawEdge(hdc,&triangle,EDGE_SUNKEN,BF_DIAGONAL | BF_DIAGONAL_ENDBOTTOMRIGHT); 612 triangle.left = points[3].x-1; //Odin32: wrong pixel at .x-2! 613 triangle.bottom = points[3].y+1; 614 triangle.right = points[2].x-1; 615 triangle.top = points[2].y+1; 616 DrawEdge(hdc,&triangle,EDGE_SUNKEN,BF_DIAGONAL | BF_DIAGONAL_ENDTOPRIGHT); 632 triangle.left = points[4].x; 633 triangle.top = points[4].y; 634 DrawEdge(hdc,&triangle,EDGE_RAISED,BF_DIAGONAL | BF_DIAGONAL_ENDTOPLEFT); 617 635 618 636 } … … 629 647 { 630 648 TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd); 631 DWORD dwStyle = GetWindowLongA 632 RECT rcClient, rcChannel,rcSelection;633 HBRUSH hBrush = CreateSolidBrush 649 DWORD dwStyle = GetWindowLongA(hwnd, GWL_STYLE); 650 RECT rcClient,rcChannel,rcSelection; 651 HBRUSH hBrush = CreateSolidBrush(infoPtr->clrBk); 634 652 int i; 635 653 636 GetClientRect (hwnd,&rcClient);654 GetClientRect(hwnd,&rcClient); 637 655 638 656 //Background … … 659 677 rcChannel = infoPtr->rcChannel; 660 678 rcSelection = infoPtr->rcSelection; 661 DrawEdge 679 DrawEdge(hdc,&rcChannel,EDGE_SUNKEN,BF_RECT | BF_ADJUST); 662 680 663 681 if (dwStyle & TBS_ENABLESELRANGE) /* fill the channel */ … … 680 698 { 681 699 int ticFlags = dwStyle & 0x0f; 682 COLORREF clrTic = RGB(0,0,0);//CB: black instead ofGetSysColor(COLOR_3DDKSHADOW);700 COLORREF clrTic = GetSysColor(COLOR_3DDKSHADOW); 683 701 684 702 for (i = 0;i < infoPtr->uNumTics;i++) … … 737 755 newRect.right++; 738 756 newRect.bottom++; 739 //Odin32 pixel bugs740 lastRect.top--;741 lastRect.left--;742 newRect.top--;743 newRect.left--;744 757 745 758 hdc = GetDC(hwnd); … … 1775 1788 PAINTSTRUCT ps; 1776 1789 1777 hdc = wParam ==0 ? BeginPaint (hwnd,&ps) : (HDC)wParam;1790 hdc = wParam == 0 ? BeginPaint(hwnd,&ps) : (HDC)wParam; 1778 1791 TRACKBAR_Draw(hwnd,hdc); 1779 if (!wParam) EndPaint (hwnd,&ps);1792 if (!wParam) EndPaint(hwnd,&ps); 1780 1793 return 0; 1781 1794 }
Note:
See TracChangeset
for help on using the changeset viewer.