Ignore:
Timestamp:
Nov 1, 2001, 6:43:18 PM (24 years ago)
Author:
umoeller
Message:

More updates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/comctl.c

    r111 r116  
    133133 *
    134134 *@@added V0.9.13 (2001-06-21) [umoeller]
     135 *@@changed V0.9.16 (2001-10-24) [umoeller]: fixed wrong hatch color and paint offset
     136 *@@changed V0.9.16 (2001-10-28) [umoeller]: added bitmap support, fixed bad clip rectangle
    135137 */
    136138
     
    172174    {
    173175        // button border:
    174 
    175176        // now paint button frame
     177
     178        // make rcl inclusive
    176179        rclWin.xRight--;
    177180        rclWin.yTop--;
     
    203206        cy = rclWin.yTop - rclWin.yBottom;
    204207
    205         ptl.x = rclWin.xLeft + ((cx - pxbd->cxMiniIcon) / 2);
    206         ptl.y = rclWin.yBottom + ((cy - pxbd->cxMiniIcon) / 2);
     208        ptl.x = rclWin.xLeft + ((cx - pxbd->cxIconOrBitmap) / 2);
     209        ptl.y = rclWin.yBottom + ((cy - pxbd->cyIconOrBitmap) / 2);
    207210
    208211        if (fl & XBF_INUSE)
     
    214217            ptl2.y = ptl.y - 2;
    215218            GpiMove(hps,
    216                     &ptl);
     219                    &ptl2);     // &ptl
     220                                // duh, typo V0.9.16 (2001-10-24) [umoeller]
    217221            GpiSetPattern(hps, PATSYM_DIAG1);
    218             ptl2.x = ptl.x + pxbd->cxMiniIcon + 1; // inclusive!
    219             ptl2.y = ptl.y + pxbd->cxMiniIcon + 1; // inclusive!
     222            GpiSetColor(hps, RGBCOL_BLACK);     // V0.9.16 (2001-10-24) [umoeller]
     223            ptl2.x = ptl.x + pxbd->cxIconOrBitmap + 1; // inclusive!
     224            ptl2.y = ptl.y + pxbd->cyIconOrBitmap + 1; // inclusive!
    220225            GpiBox(hps,
    221226                   DRO_FILL,
     
    226231
    227232        // now paint icon
    228         GpiIntersectClipRectangle(hps, &rclWin);    // exclusive!
    229         WinDrawPointer(hps,
    230                        // center this in remaining rectl
    231                        ptl.x + ulOfs,
    232                        ptl.y - ulOfs,
    233                        pxbd->hptr,
    234                        DP_MINI);
     233
     234        // make rcl inclusive           // V0.9.16 (2001-10-28) [umoeller]
     235        rclWin.xRight--;
     236        rclWin.yTop--;
     237        GpiIntersectClipRectangle(hps,
     238                                  &rclWin);    // inclusive!
     239
     240        // center this in remaining rectl
     241        ptl.x += ulOfs;
     242        ptl.y -= ulOfs;
     243        if (fl & XBF_BITMAP)
     244            // V0.9.16 (2001-10-28) [umoeller]
     245            WinDrawBitmap(hps,
     246                          pxbd->hptr,           // a bitmap really
     247                          NULL,                 // entire bitmap
     248                          &ptl,
     249                          0,
     250                          0,
     251                          DBM_NORMAL);
     252        else
     253            WinDrawPointer(hps,
     254                           // center this in remaining rectl
     255                           ptl.x + ulOfs,
     256                           ptl.y - ulOfs,
     257                           pxbd->hptr,
     258                           DP_MINI);
    235259    }
    236260}
Note: See TracChangeset for help on using the changeset viewer.