Changeset 195
- Timestamp:
- Aug 5, 2002, 8:57:15 PM (23 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/helpers/dialog.h
r188 r195 403 403 id, CTL_COMMON_FONT, 0, {cx, cy}, COMMON_SPACING } 404 404 405 #define CONTROLDEF_CONTAINER_EXTSEL(id, cx, cy) { WC_CONTAINER, NULL, \ 406 WS_VISIBLE | WS_TABSTOP | CCS_EXTENDSEL, \ 407 id, CTL_COMMON_FONT, 0, {cx, cy}, COMMON_SPACING } 408 405 409 // the following require INCL_WINSTDSLIDER 406 410 -
trunk/include/helpers/gpih.h
r190 r195 349 349 ULONG ulIconSize); */ 350 350 351 BOOL gpihDrawPointer(HPS hps, 352 LONG x, 353 LONG y, 354 HPOINTER hptr, 355 PSIZEL pszlIcon, 356 PRECTL prclClip, 357 ULONG fl); 351 BOOL XWPENTRY gpihDrawPointer(HPS hps, 352 LONG x, 353 LONG y, 354 HPOINTER hptr, 355 PSIZEL pszlIcon, 356 PRECTL prclClip, 357 ULONG fl); 358 typedef BOOL XWPENTRY GPIHDRAWPOINTER(HPS hps, 359 LONG x, 360 LONG y, 361 HPOINTER hptr, 362 PSIZEL pszlIcon, 363 PRECTL prclClip, 364 ULONG fl); 365 typedef GPIHDRAWPOINTER *PGPIHDRAWPOINTER; 358 366 359 367 /* ****************************************************************** -
trunk/include/helpers/winh.h
r166 r195 715 715 typedef WINHQUERYPRESCOLOR *PWINHQUERYPRESCOLOR; 716 716 717 LONG XWPENTRY winhQueryPresColor2(HWND hwnd, 718 ULONG ulppRGB, 719 ULONG ulppIndex, 720 BOOL fInherit, 721 LONG lSysColor); 722 717 723 BOOL XWPENTRY winhSetPresColor(HWND hwnd, ULONG ulIndex, LONG lColor); 718 724 -
trunk/src/helpers/comctl.c
r184 r195 136 136 *@@changed V0.9.16 (2001-10-24) [umoeller]: fixed wrong hatch color and paint offset 137 137 *@@changed V0.9.16 (2001-10-28) [umoeller]: added bitmap support, fixed bad clip rectangle 138 *@@changed V0.9.20 (2002-08-04) [umoeller]: fixed button offset, depressed color 138 139 */ 139 140 … … 147 148 ulOfs = 0; 148 149 LONG lLeft, 149 lRight; 150 lRight, 151 lColorMiddle = pxbd->lMiddle; 150 152 RECTL rclWin; 153 151 154 memcpy(&rclWin, &pxbd->rcl, sizeof(RECTL)); 152 155 … … 165 168 if (ulBorder == 0) 166 169 ulBorder = 1; 170 171 // make the depressed color darker 172 // V0.9.20 (2002-07-31) [umoeller] 173 gpihManipulateRGB(&lColorMiddle, 174 .95); 167 175 } 168 176 else … … 196 204 WinFillRect(hps, 197 205 &rclWin, // exclusive 198 pxbd->lMiddle);206 lColorMiddle); 199 207 200 208 // get icon … … 254 262 WinDrawPointer(hps, 255 263 // center this in remaining rectl 256 ptl.x + ulOfs,257 ptl.y - ulOfs,264 ptl.x, // + ulOfs, 265 ptl.y, // - ulOfs, 258 266 pxbd->hptr, 259 267 DP_MINI); -
trunk/src/helpers/gpih.c
r191 r195 2507 2507 * replacement for WinDrawPointer that can do clipping. 2508 2508 * 2509 * To do clipping with WinDrawPointer, one has to 2510 * alter the clip rectangle for the current HPS, 2511 * which involves creating regions and is thus quite 2512 * some overhead. 2513 * 2514 * Instead, this function allows for specifying a clip 2515 * rectangle directly. Besides, since it uses GpiWCBitBlt, 2516 * it should probably work with all types of device contexts. 2509 * Normally, to do clipping with WinDrawPointer, one 2510 * would have to alter the clip rectangle for the current 2511 * HPS, which requires creating regions and is thus quite 2512 * expensive. 2513 * 2514 * Instead, this function allows for specifying a clip 2515 * rectangle directly. It blits the icon bitmaps directly 2516 * without calling WinDrawPointer. 2517 * Besides, since it uses GpiWCBitBlt, it should probably 2518 * work with all types of device contexts. 2517 2519 * 2518 2520 * This also replaces gpihIcon2Bitmap, which wasn't quite … … 2522 2524 * If you don't need clipping and are drawing to the 2523 2525 * screen only, this function has no advantage over 2524 * WinDrawPointer because it's presumably slower.2526 * WinDrawPointer because it's presumably a bit slower. 2525 2527 * 2526 2528 * Flags presently supported in fl: … … 2528 2530 * -- DP_MINI (not DP_MINIICON, as stated in PMREF): 2529 2531 * use mini-icon. 2532 * 2533 * -- DP_HALFTONED (V0.9.20) 2530 2534 * 2531 2535 * Preconditions: … … 2540 2544 * 2541 2545 *@@added V0.9.19 (2002-06-18) [umoeller] 2546 *@@changed V0.9.20 (2002-07-31) [umoeller]: optimized, saved one GpiQueryBitmapInfoHeader 2547 *@@changed V0.9.20 (2002-08-04) [umoeller]: added DP_HALFTONED 2542 2548 */ 2543 2549 … … 2559 2565 POINTL aptl[4]; 2560 2566 HBITMAP hbmThis; 2561 BITMAPINFOHEADER2 bmi; 2567 BITMAPINFOHEADER2 bmiAndXor, 2568 bmiColor; 2562 2569 2563 2570 // A HPOINTER really consists of two bitmaps, … … 2645 2652 GpiSetBackColor(hps, RGBCOL_BLACK); 2646 2653 2654 if (fl & DP_HALFTONED) // V0.9.20 (2002-08-04) [umoeller] 2655 GpiSetPattern(hps, PATSYM_HALFTONE); 2656 2647 2657 /* 2648 2658 * 1) work on the AND image … … 2656 2666 ) 2657 2667 { 2658 bmi .cbFix = sizeof(bmi);2659 GpiQueryBitmapInfoHeader(hbmThis, &bmi );2668 bmiAndXor.cbFix = sizeof(bmiAndXor); 2669 GpiQueryBitmapInfoHeader(hbmThis, &bmiAndXor); 2660 2670 2661 2671 // use only half the bitmap height 2662 cySrc = bmi .cy / 2;2672 cySrc = bmiAndXor.cy / 2; 2663 2673 2664 2674 // aptl[2]: source bottom-left 2665 2675 aptl[2].x = 0 2666 + lClipLeft * bmi .cx / cxIcon;2676 + lClipLeft * bmiAndXor.cx / cxIcon; 2667 2677 aptl[2].y = cySrc 2668 2678 + lClipBottom * cySrc / cyIcon; 2669 2679 2670 2680 // aptl[3]: source top-right (exclusive!) 2671 aptl[3].x = bmi .cx2672 - lClipRight * bmi .cx / cxIcon;2673 aptl[3].y = bmi .cy2681 aptl[3].x = bmiAndXor.cx 2682 - lClipRight * bmiAndXor.cx / cxIcon; 2683 aptl[3].y = bmiAndXor.cy 2674 2684 - lClipTop * cySrc / cyIcon; 2675 2685 … … 2693 2703 ) 2694 2704 { 2695 bmi .cbFix = sizeof(bmi);2696 GpiQueryBitmapInfoHeader(hbmThis, &bmi );2705 bmiColor.cbFix = sizeof(bmiColor); 2706 GpiQueryBitmapInfoHeader(hbmThis, &bmiColor); 2697 2707 2698 2708 // aptl[2]: source bottom-left 2699 2709 aptl[2].x = 0 2700 + lClipLeft * bmi .cx / cxIcon;2710 + lClipLeft * bmiColor.cx / cxIcon; 2701 2711 aptl[2].y = 0 2702 + lClipBottom * bmi .cy / cyIcon;2712 + lClipBottom * bmiColor.cy / cyIcon; 2703 2713 2704 2714 // aptl[3]: source top-right (exclusive!) 2705 aptl[3].x = bmi .cx2706 - lClipRight * bmi .cx / cxIcon;2707 aptl[3].y = bmi .cy2708 - lClipTop * bmi .cy / cyIcon;2715 aptl[3].x = bmiColor.cx 2716 - lClipRight * bmiColor.cx / cxIcon; 2717 aptl[3].y = bmiColor.cy 2718 - lClipTop * bmiColor.cy / cyIcon; 2709 2719 2710 2720 GpiWCBitBlt(hps, // target … … 2727 2737 ) 2728 2738 { 2729 bmi.cbFix = sizeof(bmi); 2730 GpiQueryBitmapInfoHeader(hbmThis, &bmi); 2739 /* we queried this one above V0.9.20 (2002-07-31) [umoeller] 2740 bmiAndXor.cbFix = sizeof(bmiAndXor); 2741 GpiQueryBitmapInfoHeader(hbmThis, &bmiAndXor); 2742 */ 2731 2743 2732 2744 // use only half the bitmap height 2733 cySrc = bmi .cy / 2;2745 cySrc = bmiAndXor.cy / 2; 2734 2746 2735 2747 // aptl[2]: source bottom-left 2736 2748 aptl[2].x = 0 2737 + lClipLeft * bmi .cx / cxIcon;2749 + lClipLeft * bmiAndXor.cx / cxIcon; 2738 2750 aptl[2].y = 0 2739 2751 + lClipBottom * cySrc / cyIcon; 2740 2752 2741 2753 // aptl[3]: source top-right (exclusive!) 2742 aptl[3].x = bmi .cx2743 - lClipRight * bmi .cx / cxIcon;2754 aptl[3].x = bmiAndXor.cx 2755 - lClipRight * bmiAndXor.cx / cxIcon; 2744 2756 aptl[3].y = cySrc 2745 2757 - lClipTop * cySrc / cyIcon; -
trunk/src/helpers/winh.c
r169 r195 2888 2888 2889 2889 /* 2890 *@@ winhQueryPresColor :2890 *@@ winhQueryPresColor2: 2891 2891 * returns the specified color. This is queried in the 2892 2892 * following order: … … 2966 2966 *@@changed V0.9.0 [umoeller]: added fInherit parameter 2967 2967 *@@changed V0.9.7 (2000-12-02) [umoeller]: added lSysColor == -1 support 2968 */ 2969 2970 LONG winhQueryPresColor(HWND hwnd, // in: window to query 2971 ULONG ulPP, // in: PP_* index 2972 BOOL fInherit, // in: search parent windows too? 2973 LONG lSysColor) // in: SYSCLR_* index or -1 2968 *@@changed V0.9.20 (2002-08-04) [umoeller]: added ulPPIndex, renamed func 2969 */ 2970 2971 LONG winhQueryPresColor2(HWND hwnd, // in: window to query 2972 ULONG ulppRGB, // in: PP_* index for RGB color 2973 ULONG ulppIndex, // in: PP_* index for color _index_ (can be null) 2974 BOOL fInherit, // in: search parent windows too? 2975 LONG lSysColor) // in: SYSCLR_* index or -1 2974 2976 { 2975 2977 ULONG ul, 2976 attrFound, 2977 abValue[32]; 2978 2979 if (ulPP != (ULONG)-1) 2978 attrFound; 2979 LONG lColorFound; 2980 2981 if (ulppRGB != (ULONG)-1) 2982 { 2983 ULONG fl = 0; 2984 if (!fInherit) 2985 fl = QPF_NOINHERIT; 2986 if (ulppIndex) 2987 fl |= QPF_ID2COLORINDEX; // convert indexed color 2 to RGB V0.9.20 (2002-08-04) [umoeller] 2988 2980 2989 if ((ul = WinQueryPresParam(hwnd, 2981 ul PP,2982 0,2990 ulppRGB, 2991 ulppIndex, 2983 2992 &attrFound, 2984 (ULONG)sizeof(abValue), 2985 (PVOID)&abValue, 2986 (fInherit) 2987 ? 0 2988 : QPF_NOINHERIT))) 2989 return (abValue[0]); 2993 sizeof(lColorFound), 2994 &lColorFound, 2995 fl))) 2996 return lColorFound; 2997 } 2990 2998 2991 2999 // not found: get system color 2992 3000 if (lSysColor != -1) 2993 return (WinQuerySysColor(HWND_DESKTOP, lSysColor, 0));3001 return WinQuerySysColor(HWND_DESKTOP, lSysColor, 0); 2994 3002 2995 3003 return -1; 3004 } 3005 3006 /* 3007 *@@ winhQueryPresColor: 3008 * compatibility function because this one was 3009 * exported. 3010 * 3011 *@@added V0.9.20 (2002-08-04) [umoeller] 3012 */ 3013 3014 LONG XWPENTRY winhQueryPresColor(HWND hwnd, 3015 ULONG ulPP, 3016 BOOL fInherit, 3017 LONG lSysColor) 3018 { 3019 return winhQueryPresColor2(hwnd, 3020 ulPP, 3021 0, 3022 fInherit, 3023 lSysColor); 2996 3024 } 2997 3025 … … 3339 3367 VOID winhSleep(ULONG ulSleep) // in: sleep time in milliseconds 3340 3368 { 3341 HWND hwnd; 3369 HWND hwnd; 3370 3342 3371 if (hwnd = winhCreateObjectWindow(WC_STATIC, NULL)) 3343 3372 { 3344 QMSG qmsg; 3345 HAB hab = WinQueryAnchorBlock(hwnd); 3346 if (WinStartTimer(hab, 3347 hwnd, 3348 1, 3349 ulSleep)) 3373 QMSG qmsg; 3374 HAB hab; 3375 3376 if ( (hab = WinQueryAnchorBlock(hwnd)) 3377 && (WinStartTimer(hab, 3378 hwnd, 3379 1, 3380 ulSleep)) 3381 ) 3350 3382 { 3351 3383 while (WinGetMsg(hab, &qmsg, NULLHANDLE, 0, 0)) -
trunk/src/helpers/wphandle.c
r180 r195 116 116 } 117 117 118 return (ERROR_WPH_NO_ACTIVEHANDLES_DATA);118 return ERROR_WPH_NO_ACTIVEHANDLES_DATA; 119 119 } 120 120
Note:
See TracChangeset
for help on using the changeset viewer.