Changeset 214
- Timestamp:
- Aug 24, 2002, 10:14:05 PM (23 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/helpers/comctl.h
r209 r214 480 480 #define SBCF_PERCENTAGE 0x0002 481 481 #define SBCF_3DSUNK 0x0100 482 #define SBCF_3DEXPLORERSTYLE 0x0200 483 // new with V0.9.21 (2002-08-21) [umoeller] 484 // this simulates the Warp 4 entry field margins around the 485 // right split window, but leaves the left window flat 482 486 #define SBCF_MOVEABLE 0x1000 483 487 … … 540 544 SPLITBARCDATA sbcd; 541 545 PFNWP OldStaticProc; 542 // RECTL rclBar;543 546 HPOINTER hptrOld, // old pointer stored upon WM_MOUSEMOVE 544 547 hptrMove; // PM move pointer, either vertical or horizontal … … 552 555 hwndLinked2; 553 556 // the right/top window to link 557 LONG lcol3DDark, 558 lcol3DLight, 559 lcolInactiveBorder; 554 560 } SPLITBARDATA, *PSPLITBARDATA; 555 561 -
trunk/include/helpers/gpih.h
r195 r214 153 153 typedef VOID XWPENTRY GPIHDRAWTHICKFRAME(HPS hps, PRECTL prcl, ULONG ulWidth); 154 154 typedef GPIHDRAWTHICKFRAME *PGPIHDRAWTHICKFRAME; 155 156 VOID XWPENTRY gpihDraw3DFrame2(HPS hps, 157 PRECTL prcl, 158 USHORT usWidth, 159 LONG lColorLeft, 160 LONG lColorRight); 161 typedef VOID XWPENTRY GPIHDRAW3DFRAME2(HPS hps, 162 PRECTL prcl, 163 USHORT usWidth, 164 LONG lColorLeft, 165 LONG lColorRight); 166 typedef GPIHDRAW3DFRAME2 *PGPIHDRAW3DFRAME2; 155 167 156 168 VOID XWPENTRY gpihDraw3DFrame(HPS hps, -
trunk/src/helpers/cctl_splitwin.c
r184 r214 95 95 * 96 96 *@@added V0.9.1 (2000-02-05) [umoeller] 97 *@@changed V0.9.21 (2002-08-24) [umoeller]: added SBCF_3DEXPLORERSTYLE 97 98 */ 98 99 99 100 static VOID PaintSplitWindow(HWND hwndSplit) 100 101 { 101 HPS hps = WinBeginPaint(hwndSplit, (HPS)0, NULL); 102 HWND hwndSplitBar = WinWindowFromID(hwndSplit, ID_SPLITBAR); 103 PSPLITBARDATA pData = (PSPLITBARDATA)WinQueryWindowULong(hwndSplitBar, 104 QWL_USER); 105 106 if ((pData->hwndLinked1) && (pData->hwndLinked2)) 102 HPS hps; 103 104 if (hps = WinBeginPaint(hwndSplit, (HPS)0, NULL)) 107 105 { 108 // "3D-sunk" style? 109 if (pData->sbcd.ulCreateFlags & SBCF_3DSUNK) 110 { 111 // yes: draw sunk frame around split windows 112 POINTL ptl1; 106 HWND hwndSplitBar = WinWindowFromID(hwndSplit, ID_SPLITBAR); 107 PSPLITBARDATA pData = (PSPLITBARDATA)WinQueryWindowULong(hwndSplitBar, 108 QWL_USER); 109 110 if ((pData->hwndLinked1) && (pData->hwndLinked2)) 111 { 113 112 SWP swp; 114 113 115 114 // switch to RGB mode 116 GpiCreateLogColorTable(hps, 0, LCOLF_RGB, 0, 0, NULL); 117 118 WinQueryWindowPos(pData->hwndLinked1, &swp); 119 GpiSetColor(hps, WinQuerySysColor(HWND_DESKTOP, SYSCLR_BUTTONDARK, 0)); 120 ptl1.x = swp.x - 1; 121 ptl1.y = swp.y - 1; 122 GpiMove(hps, &ptl1); 123 ptl1.y = swp.y + swp.cy; 124 GpiLine(hps, &ptl1); 125 ptl1.x = swp.x + swp.cx; 126 GpiLine(hps, &ptl1); 127 GpiSetColor(hps, WinQuerySysColor(HWND_DESKTOP, SYSCLR_BUTTONLIGHT, 0)); 128 ptl1.y = swp.y - 1; 129 GpiLine(hps, &ptl1); 130 ptl1.x = swp.x - 1; 131 GpiLine(hps, &ptl1); 132 133 WinQueryWindowPos(pData->hwndLinked2, &swp); 134 GpiSetColor(hps, WinQuerySysColor(HWND_DESKTOP, SYSCLR_BUTTONDARK, 0)); 135 ptl1.x = swp.x - 1; 136 ptl1.y = swp.y - 1; 137 GpiMove(hps, &ptl1); 138 ptl1.y = swp.y + swp.cy; 139 GpiLine(hps, &ptl1); 140 ptl1.x = swp.x + swp.cx; 141 GpiLine(hps, &ptl1); 142 GpiSetColor(hps, WinQuerySysColor(HWND_DESKTOP, SYSCLR_BUTTONLIGHT, 0)); 143 ptl1.y = swp.y - 1; 144 GpiLine(hps, &ptl1); 145 ptl1.x = swp.x - 1; 146 GpiLine(hps, &ptl1); 147 } 115 gpihSwitchToRGB(hps); 116 117 // "3D-sunk" style? 118 if (pData->sbcd.ulCreateFlags & SBCF_3DEXPLORERSTYLE) 119 { 120 // this style is new with V0.9.21 (2002-08-24) [umoeller]; 121 // simulate the Warp 4 entry field margins around the 122 // right control only, but leave the left control flat. 123 RECTL rcl; 124 WinQueryWindowPos(pData->hwndLinked2, &swp); 125 rcl.xLeft = swp.x - 2; 126 rcl.yBottom = swp.y - 2; 127 rcl.xRight = swp.x + swp.cx + 1; 128 rcl.yTop = swp.y + swp.cy + 1; 129 gpihDraw3DFrame2(hps, 130 &rcl, 131 1, 132 RGBCOL_BLACK, 133 pData->lcol3DLight); 134 gpihDraw3DFrame2(hps, 135 &rcl, 136 1, 137 RGBCOL_BLACK, 138 pData->lcolInactiveBorder); 139 } 140 else if (pData->sbcd.ulCreateFlags & SBCF_3DSUNK) 141 { 142 // yes: draw sunk frame around split windows 143 POINTL ptl1; 144 145 WinQueryWindowPos(pData->hwndLinked1, &swp); 146 GpiSetColor(hps, pData->lcol3DDark); 147 ptl1.x = swp.x - 1; 148 ptl1.y = swp.y - 1; 149 GpiMove(hps, &ptl1); 150 ptl1.y = swp.y + swp.cy; 151 GpiLine(hps, &ptl1); 152 ptl1.x = swp.x + swp.cx; 153 GpiLine(hps, &ptl1); 154 GpiSetColor(hps, pData->lcol3DLight); 155 ptl1.y = swp.y - 1; 156 GpiLine(hps, &ptl1); 157 ptl1.x = swp.x - 1; 158 GpiLine(hps, &ptl1); 159 160 WinQueryWindowPos(pData->hwndLinked2, &swp); 161 GpiSetColor(hps, pData->lcol3DDark); 162 ptl1.x = swp.x - 1; 163 ptl1.y = swp.y - 1; 164 GpiMove(hps, &ptl1); 165 ptl1.y = swp.y + swp.cy; 166 GpiLine(hps, &ptl1); 167 ptl1.x = swp.x + swp.cx; 168 GpiLine(hps, &ptl1); 169 GpiSetColor(hps, pData->lcol3DLight); 170 ptl1.y = swp.y - 1; 171 GpiLine(hps, &ptl1); 172 ptl1.x = swp.x - 1; 173 GpiLine(hps, &ptl1); 174 } 175 } 176 177 WinEndPaint(hps); 148 178 } 149 150 WinEndPaint(hps);151 179 } 152 180 … … 407 435 rclBar; 408 436 POINTL ptl1; 409 hps = WinBeginPaint(hwndBar, NULLHANDLE, &rcl); 410 WinQueryWindowRect(hwndBar, &rclBar); 411 // switch to RGB mode 412 GpiCreateLogColorTable(hps, 0, LCOLF_RGB, 0, 0, NULL); 413 414 // inflate top and right, because WinFillRect 415 // considers this inclusive 416 /* rclBar.xRight++; 417 rclBar.yTop++; */ 418 419 WinFillRect(hps, 420 &rclBar, 421 WinQuerySysColor(HWND_DESKTOP, 422 SYSCLR_INACTIVEBORDER, 423 0)); 424 425 if ((pData->sbcd.ulCreateFlags & SBCF_3DSUNK) == 0) 437 if (hps = WinBeginPaint(hwndBar, NULLHANDLE, &rcl)) 426 438 { 427 GpiSetColor(hps, 428 WinQuerySysColor(HWND_DESKTOP, 429 SYSCLR_BUTTONLIGHT, 430 0)); 431 // draw left border (bottom to up) 432 ptl1.x = 0; 433 ptl1.y = 0; 434 GpiMove(hps, &ptl1); 435 ptl1.y = (rclBar.yTop - rclBar.yBottom) - 1; 436 if (pData->sbcd.ulCreateFlags & SBCF_VERTICAL) 437 // vertical: 438 GpiLine(hps, &ptl1); 439 else 439 WinQueryWindowRect(hwndBar, &rclBar); 440 // switch to RGB mode 441 GpiCreateLogColorTable(hps, 0, LCOLF_RGB, 0, 0, NULL); 442 443 WinFillRect(hps, 444 &rclBar, 445 pData->lcolInactiveBorder); 446 447 if ((pData->sbcd.ulCreateFlags & SBCF_3DSUNK) == 0) 448 { 449 GpiSetColor(hps, pData->lcol3DLight); 450 // draw left border (bottom to up) 451 ptl1.x = 0; 452 ptl1.y = 0; 440 453 GpiMove(hps, &ptl1); 441 442 // draw top border (to right) 443 ptl1.x = (rclBar.xRight - rclBar.xLeft) - 1; 444 if (pData->sbcd.ulCreateFlags & SBCF_VERTICAL) 445 // vertical: 446 GpiMove(hps, &ptl1); 447 else 448 GpiLine(hps, &ptl1); 449 450 GpiSetColor(hps, 451 WinQuerySysColor(HWND_DESKTOP, 452 SYSCLR_BUTTONDARK, 453 0)); 454 // draw right border (to bottom) 455 ptl1.y = 0; 456 if (pData->sbcd.ulCreateFlags & SBCF_VERTICAL) 457 // vertical: 458 GpiLine(hps, &ptl1); 459 else 460 GpiMove(hps, &ptl1); 461 462 if (!(pData->sbcd.ulCreateFlags & SBCF_VERTICAL)) 463 { 464 // horizontal: 465 // draw bottom border 466 ptl1.x = 0; 467 GpiLine(hps, &ptl1); 468 } 454 ptl1.y = (rclBar.yTop - rclBar.yBottom) - 1; 455 if (pData->sbcd.ulCreateFlags & SBCF_VERTICAL) 456 // vertical: 457 GpiLine(hps, &ptl1); 458 else 459 GpiMove(hps, &ptl1); 460 461 // draw top border (to right) 462 ptl1.x = (rclBar.xRight - rclBar.xLeft) - 1; 463 if (pData->sbcd.ulCreateFlags & SBCF_VERTICAL) 464 // vertical: 465 GpiMove(hps, &ptl1); 466 else 467 GpiLine(hps, &ptl1); 468 469 GpiSetColor(hps, pData->lcol3DDark); 470 // draw right border (to bottom) 471 ptl1.y = 0; 472 if (pData->sbcd.ulCreateFlags & SBCF_VERTICAL) 473 // vertical: 474 GpiLine(hps, &ptl1); 475 else 476 GpiMove(hps, &ptl1); 477 478 if (!(pData->sbcd.ulCreateFlags & SBCF_VERTICAL)) 479 { 480 // horizontal: 481 // draw bottom border 482 ptl1.x = 0; 483 GpiLine(hps, &ptl1); 484 } 485 } 486 487 WinEndPaint(hps); 469 488 } 470 471 WinEndPaint(hps);472 489 } 473 490 … … 769 786 // copy control data 770 787 memcpy(&(pData->sbcd), psbcd, sizeof(SPLITBARCDATA)); 771 // set other data 772 /* WinQueryWindowRect(hwndBar, &(pData->rclBar)); 773 (pData->rclBar.xRight)--; 774 (pData->rclBar.yTop)--; */ 788 775 789 // subclass static control to make it a split bar 776 790 pData->OldStaticProc = WinSubclassWindow(hwndBar, ctl_fnwpSplitBar); … … 785 799 pData->hwndLinked2 = NULLHANDLE; 786 800 801 // caching these colors now V0.9.21 (2002-08-21) [umoeller] 802 pData->lcol3DDark = WinQuerySysColor(HWND_DESKTOP, SYSCLR_BUTTONDARK, 0); 803 pData->lcol3DLight = WinQuerySysColor(HWND_DESKTOP, SYSCLR_BUTTONLIGHT, 0); 804 pData->lcolInactiveBorder = WinQuerySysColor(HWND_DESKTOP, SYSCLR_INACTIVEBORDER, 0); 805 787 806 WinSetWindowULong(hwndBar, QWL_USER, (ULONG)pData); 788 807 } … … 806 825 * 807 826 *@@added V0.9.0 [umoeller] 827 *@@changed V0.9.21 (2002-08-24) [umoeller]: added support for SBCF_3DEXPLORERSTYLE 808 828 */ 809 829 … … 811 831 { 812 832 BOOL brc = FALSE; 813 HWND hwndSplitBar = WinWindowFromID(hwndSplit, ID_SPLITBAR); 814 815 if (hwndSplitBar) 833 HWND hwndSplitBar; 834 PSPLITBARDATA psbd; 835 836 if ( (hwndSplitBar = WinWindowFromID(hwndSplit, ID_SPLITBAR)) 837 && (psbd = (PSPLITBARDATA)WinQueryWindowPtr(hwndSplitBar, QWL_USER)) 838 ) 816 839 { 817 PSPLITBARDATA psbd = (PSPLITBARDATA)WinQueryWindowULong(hwndSplitBar, QWL_USER); 818 819 if (psbd) 820 { 821 PSPLITBARCDATA psbcd = &(psbd->sbcd); 822 RECTL rclSplit, 823 rclBar; 824 ULONG ul3DOfs = 0; 825 826 // _Pmpf(("Entering ctlUpdateSplitWindow for hwndSplit 0x%lX", hwndSplit)); 827 828 // query the rectangle of the split window's parent; 829 // this is either the client or another split window 830 WinQueryWindowRect(hwndSplit, &rclSplit); 831 832 /* _Pmpf((" rect: %d, %d, %d, %d", 833 rclSplit.xLeft, 834 rclSplit.yBottom, 835 rclSplit.xRight - rclSplit.xLeft, 836 rclSplit.yTop - rclSplit.yBottom)); */ 837 838 // set anti-recursion flag; 839 // this is neccessary, because ctl_fnwpSplitWindow 840 // calls this func again when 841 // WM_WINDOWPOSCHANGED comes in 842 // psbd->fNoAdjust = TRUE; 843 // set split window to the same 844 /* WinSetWindowPos(hwndSplit, HWND_TOP, 845 rclSplit.xLeft, 846 rclSplit.yBottom, 847 rclSplit.xRight - rclSplit.xLeft, 848 rclSplit.yTop - rclSplit.yBottom, 849 SWP_MOVE | SWP_SIZE); */ 850 // psbd->fNoAdjust = FALSE; 851 852 // update split bar 853 if (psbcd->ulCreateFlags & SBCF_HORIZONTAL) 854 { 855 // _Pmpf((" Calc horizontal")); 856 // horizontal split bar: 857 if (psbcd->ulCreateFlags & SBCF_PERCENTAGE) 858 // take height of client and apply percentage 840 PSPLITBARCDATA psbcd = &(psbd->sbcd); 841 RECTL rclSplit, 842 rclBar; 843 LONG l3DOfsLink1 = 0, 844 l3DOfsLink2 = 0; 845 846 // _Pmpf(("Entering ctlUpdateSplitWindow for hwndSplit 0x%lX", hwndSplit)); 847 848 // query the rectangle of the split window's parent; 849 // this is either the client or another split window 850 WinQueryWindowRect(hwndSplit, &rclSplit); 851 852 /* _Pmpf((" rect: %d, %d, %d, %d", 853 rclSplit.xLeft, 854 rclSplit.yBottom, 855 rclSplit.xRight - rclSplit.xLeft, 856 rclSplit.yTop - rclSplit.yBottom)); */ 857 858 // update split bar 859 if (psbcd->ulCreateFlags & SBCF_HORIZONTAL) 860 { 861 // _Pmpf((" Calc horizontal")); 862 // horizontal split bar: 863 if (psbcd->ulCreateFlags & SBCF_PERCENTAGE) 864 // take height of client and apply percentage 865 rclBar.yBottom = (rclSplit.yTop - rclSplit.yBottom) 866 * psbcd->lPos 867 / 100; 868 else 869 if (psbcd->lPos > 0) 870 // offset from bottom: 871 rclBar.yBottom = psbcd->lPos; 872 else 873 // offset from right: 859 874 rclBar.yBottom = (rclSplit.yTop - rclSplit.yBottom) 860 * psbcd->lPos 861 / 100; 875 + psbcd->lPos; // which is negative 876 877 rclBar.yTop = rclBar.yBottom + WinQuerySysValue(HWND_DESKTOP, 878 SV_CXSIZEBORDER); 879 rclBar.xLeft = 0; 880 // take width of client 881 rclBar.xRight = (rclSplit.xRight - rclSplit.xLeft); 882 } 883 else 884 { 885 // _Pmpf((" Calc vertical")); 886 // vertical split bar: 887 if (psbcd->ulCreateFlags & SBCF_PERCENTAGE) 888 // take width of client and apply percentage 889 rclBar.xLeft = (rclSplit.xRight - rclSplit.xLeft) 890 * psbcd->lPos 891 / 100; 892 else 893 if (psbcd->lPos > 0) 894 // offset from left: 895 rclBar.xLeft = psbcd->lPos; 862 896 else 863 if (psbcd->lPos > 0) 864 // offset from bottom: 865 rclBar.yBottom = psbcd->lPos; 866 else 867 // offset from right: 868 rclBar.yBottom = (rclSplit.yTop - rclSplit.yBottom) 869 + psbcd->lPos; // which is negative 870 871 rclBar.yTop = rclBar.yBottom + WinQuerySysValue(HWND_DESKTOP, 872 SV_CXSIZEBORDER); 873 rclBar.xLeft = 0; 874 // take width of client 875 rclBar.xRight = (rclSplit.xRight - rclSplit.xLeft); 876 } 877 else 878 { 879 // _Pmpf((" Calc vertical")); 880 // vertical split bar: 881 if (psbcd->ulCreateFlags & SBCF_PERCENTAGE) 882 // take width of client and apply percentage 897 // offset from right: 883 898 rclBar.xLeft = (rclSplit.xRight - rclSplit.xLeft) 884 * psbcd->lPos 885 / 100; 886 else 887 if (psbcd->lPos > 0) 888 // offset from left: 889 rclBar.xLeft = psbcd->lPos; 890 else 891 // offset from right: 892 rclBar.xLeft = (rclSplit.xRight - rclSplit.xLeft) 893 + psbcd->lPos; // which is negative 894 895 rclBar.xRight = rclBar.xLeft + WinQuerySysValue(HWND_DESKTOP, 896 SV_CXSIZEBORDER); 897 rclBar.yBottom = 0; 898 // take height of client 899 rclBar.yTop = (rclSplit.yTop - rclSplit.yBottom); 900 } 901 902 // reposition split bar 903 brc = WinSetWindowPos(hwndSplitBar, 904 HWND_TOP, 905 rclBar.xLeft, 906 rclBar.yBottom, 907 rclBar.xRight - rclBar.xLeft, 908 rclBar.yTop - rclBar.yBottom, 909 SWP_MOVE | SWP_SIZE); 910 911 /* _Pmpf((" Set splitbar hwnd %lX to %d, %d, %d, %d; rc: %d", 912 hwndSplitBar, 913 rclBar.xLeft, 914 rclBar.yBottom, 915 rclBar.xRight - rclBar.xLeft, 916 rclBar.yTop - rclBar.yBottom, 917 brc)); */ 918 919 // reposition left/bottom window of split bar 920 if (psbcd->ulCreateFlags & SBCF_3DSUNK) 921 ul3DOfs = 1; 922 // else 0 923 924 // now reposition the linked windows 925 if (psbcd->ulCreateFlags & SBCF_HORIZONTAL) 926 { 927 // horizontal: 928 // reposition bottom window of split bar 929 WinSetWindowPos(psbd->hwndLinked1, 930 HWND_TOP, 931 ul3DOfs, 932 ul3DOfs, 933 rclBar.xRight - rclBar.xLeft - ul3DOfs*2, 934 rclBar.yBottom - ul3DOfs*2, // the window rect is non-inclusive 935 SWP_MOVE | SWP_SIZE); 936 937 // reposition top window of split bar 938 WinSetWindowPos(psbd->hwndLinked2, 939 HWND_TOP, 940 ul3DOfs, 941 rclBar.yTop + ul3DOfs, // the window rect is non-inclusive 942 rclBar.xRight - rclBar.xLeft - ul3DOfs*2, 943 rclSplit.yTop - rclBar.yTop - ul3DOfs*2, 944 SWP_MOVE | SWP_SIZE); 945 } 946 else 947 { 948 // vertical: 949 // reposition left window of split bar 950 WinSetWindowPos(psbd->hwndLinked1, 951 HWND_TOP, 952 ul3DOfs, 953 ul3DOfs, 954 rclBar.xLeft - ul3DOfs*2, // the window rect is non-inclusive 955 rclBar.yTop - rclBar.yBottom - ul3DOfs*2, 956 SWP_MOVE | SWP_SIZE); 957 958 // reposition right window of split bar 959 WinSetWindowPos(psbd->hwndLinked2, 960 HWND_TOP, 961 rclBar.xRight + ul3DOfs, // the window rect is non-inclusive 962 ul3DOfs, 963 rclSplit.xRight - rclBar.xRight - ul3DOfs*2, 964 rclBar.yTop - rclBar.yBottom - ul3DOfs*2, 965 SWP_MOVE | SWP_SIZE); 966 } 967 968 // repaint split window (3D frame) 969 WinInvalidateRect(hwndSplit, 970 NULL, // all 971 FALSE); // don't repaint children 972 } 899 + psbcd->lPos; // which is negative 900 901 rclBar.xRight = rclBar.xLeft + WinQuerySysValue(HWND_DESKTOP, 902 SV_CXSIZEBORDER); 903 rclBar.yBottom = 0; 904 // take height of client 905 rclBar.yTop = (rclSplit.yTop - rclSplit.yBottom); 906 } 907 908 // reposition split bar 909 brc = WinSetWindowPos(hwndSplitBar, 910 HWND_TOP, 911 rclBar.xLeft, 912 rclBar.yBottom, 913 rclBar.xRight - rclBar.xLeft, 914 rclBar.yTop - rclBar.yBottom, 915 SWP_MOVE | SWP_SIZE); 916 917 /* _Pmpf((" Set splitbar hwnd %lX to %d, %d, %d, %d; rc: %d", 918 hwndSplitBar, 919 rclBar.xLeft, 920 rclBar.yBottom, 921 rclBar.xRight - rclBar.xLeft, 922 rclBar.yTop - rclBar.yBottom, 923 brc)); */ 924 925 // reposition left/bottom window of split bar 926 if (psbcd->ulCreateFlags & SBCF_3DEXPLORERSTYLE) 927 { 928 l3DOfsLink2 = 2; 929 } 930 else if (psbcd->ulCreateFlags & SBCF_3DSUNK) 931 { 932 l3DOfsLink1 = 1; 933 l3DOfsLink2 = 1; 934 } 935 // else 0 936 937 // now reposition the linked windows 938 if (psbcd->ulCreateFlags & SBCF_HORIZONTAL) 939 { 940 // horizontal: 941 // reposition bottom window of split bar 942 WinSetWindowPos(psbd->hwndLinked1, 943 HWND_TOP, 944 l3DOfsLink1, 945 l3DOfsLink1, 946 rclBar.xRight - rclBar.xLeft - 2 * l3DOfsLink1, 947 rclBar.yBottom - 2 * l3DOfsLink1, 948 // the window rect is non-inclusive 949 SWP_MOVE | SWP_SIZE); 950 951 // reposition top window of split bar 952 WinSetWindowPos(psbd->hwndLinked2, 953 HWND_TOP, 954 l3DOfsLink2, 955 rclBar.yTop + l3DOfsLink2, 956 // the window rect is non-inclusive 957 rclBar.xRight - rclBar.xLeft - 2 * l3DOfsLink2, 958 rclSplit.yTop - rclBar.yTop - 2 * l3DOfsLink2, 959 SWP_MOVE | SWP_SIZE); 960 } 961 else 962 { 963 // vertical: 964 // reposition left window of split bar 965 WinSetWindowPos(psbd->hwndLinked1, 966 HWND_TOP, 967 l3DOfsLink1, 968 l3DOfsLink1, 969 rclBar.xLeft - 2 * l3DOfsLink1, 970 // the window rect is non-inclusive 971 rclBar.yTop - rclBar.yBottom - 2 * l3DOfsLink1, 972 SWP_MOVE | SWP_SIZE); 973 974 // reposition right window of split bar 975 WinSetWindowPos(psbd->hwndLinked2, 976 HWND_TOP, 977 rclBar.xRight + l3DOfsLink2, 978 // the window rect is non-inclusive 979 l3DOfsLink2, 980 rclSplit.xRight - rclBar.xRight - 2 * l3DOfsLink2, 981 rclBar.yTop - rclBar.yBottom - 2 * l3DOfsLink2, 982 SWP_MOVE | SWP_SIZE); 983 } 984 985 // repaint split window (3D frame) 986 WinInvalidateRect(hwndSplit, 987 NULL, // all 988 FALSE); // don't repaint children 973 989 } 974 990 -
trunk/src/helpers/gpih.c
r201 r214 468 468 469 469 /* 470 *@@ gpihDraw3DFrame :470 *@@ gpihDraw3DFrame2: 471 471 * this draws a rectangle in 3D style with a given line width 472 472 * and the given colors. … … 481 481 * the bottom left and top right pixels to be drawn. 482 482 * 483 * Note: With V0.9.21, this now modifies prcl to be smaller towards 484 * the center of the rectangle by usWidth so you can call this several 485 * times with different colors. 486 * 483 487 *@@changed V0.9.0 [umoeller]: changed function prototype to have colors specified 484 488 *@@changed V0.9.7 (2000-12-20) [umoeller]: now really using inclusive rectangle... 485 * /486 487 VOID gpihDraw3DFrame(HPS hps, 488 PRECTL prcl, // in: rectangle (inclusive) 489 USHORT usWidth, // in: line width (>= 1)490 LONG lColorLeft, // in: color to use for left and top; e.g. SYSCLR_BUTTONLIGHT491 LONG lColorRight) // in: color to use for right and bottom; e.g. SYSCLR_BUTTONDARK492 { 493 RECTL rcl2 = *prcl; 489 *@@changed V0.9.21 (2002-08-24) [umoeller]: renamed, now modifying prcl on output 490 */ 491 492 VOID gpihDraw3DFrame2(HPS hps, 493 PRECTL prcl, // in: rectangle (inclusive) 494 USHORT usWidth, // in: line width (>= 1) 495 LONG lColorLeft, // in: color to use for left and top; e.g. SYSCLR_BUTTONLIGHT 496 LONG lColorRight) // in: color to use for right and bottom; e.g. SYSCLR_BUTTONDARK 497 { 494 498 USHORT us; 495 499 POINTL ptl1; … … 501 505 GpiSetColor(hps, lColorLeft); 502 506 // draw left line 503 ptl1.x = rcl2.xLeft;504 ptl1.y = rcl2.yBottom;507 ptl1.x = prcl->xLeft; 508 ptl1.y = prcl->yBottom; 505 509 GpiMove(hps, &ptl1); 506 ptl1.y = rcl2.yTop; // V0.9.7 (2000-12-20) [umoeller]510 ptl1.y = prcl->yTop; // V0.9.7 (2000-12-20) [umoeller] 507 511 GpiLine(hps, &ptl1); 508 512 // go right -> draw top 509 ptl1.x = rcl2.xRight; // V0.9.7 (2000-12-20) [umoeller]513 ptl1.x = prcl->xRight; // V0.9.7 (2000-12-20) [umoeller] 510 514 GpiLine(hps, &ptl1); 511 515 // go down -> draw right 512 516 GpiSetColor(hps, lColorRight); 513 ptl1.y = rcl2.yBottom;517 ptl1.y = prcl->yBottom; 514 518 GpiLine(hps, &ptl1); 515 519 // go left -> draw bottom 516 ptl1.x = rcl2.xLeft;520 ptl1.x = prcl->xLeft; 517 521 GpiLine(hps, &ptl1); 518 522 519 rcl2.xLeft++;520 rcl2.yBottom++;521 rcl2.xRight--;522 rcl2.yTop--;523 prcl->xLeft++; 524 prcl->yBottom++; 525 prcl->xRight--; 526 prcl->yTop--; 523 527 } 528 } 529 530 /* 531 *@@ gpihDraw3DFrame: 532 * compatibility function for those who used the 533 * export. As opposed to gpihDraw3DFrame2, this 534 * does not modify prcl. 535 * 536 *@@added V0.9.21 (2002-08-24) [umoeller] 537 */ 538 539 VOID gpihDraw3DFrame(HPS hps, 540 PRECTL prcl, // in: rectangle (inclusive) 541 USHORT usWidth, // in: line width (>= 1) 542 LONG lColorLeft, // in: color to use for left and top; e.g. SYSCLR_BUTTONLIGHT 543 LONG lColorRight) // in: color to use for right and bottom; e.g. SYSCLR_BUTTONDARK 544 { 545 RECTL rcl2 = *prcl; 546 gpihDraw3DFrame2(hps, &rcl2, usWidth, lColorLeft, lColorRight); 524 547 } 525 548
Note:
See TracChangeset
for help on using the changeset viewer.