Ignore:
Timestamp:
Aug 15, 1999, 9:11:02 PM (26 years ago)
Author:
cbratschi
Message:

wine-990731 update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/uitools.cpp

    r407 r500  
    1 /* $Id: uitools.cpp,v 1.2 1999-08-03 21:22:34 sandervl Exp $ */
     1/* $Id: uitools.cpp,v 1.3 1999-08-15 19:11:02 cbratschi Exp $ */
    22/*
    33 * User Interface Functions
     
    462462        LTInnerI = RBInnerI = LTRBInnerFlat[uType & (BDR_INNER|BDR_OUTER)];
    463463        LTOuterI = RBOuterI = LTRBOuterFlat[uType & (BDR_INNER|BDR_OUTER)];
     464
     465        /* Bertho Stultiens states above that this function exactly matches win95
     466         * In win98 BF_FLAT rectangels have an inner border same color as the
     467         * middle (COLOR_BTNFACE). I believe it's the same for win95 but since
     468         * I don't know I go with Bertho and just sets it for win98 until proven
     469         * otherwise.
     470         *                                          Dennis Björklund, 10 June, 99
     471         */
     472        if(LTInnerI != -1 )     
     473            LTInnerI = RBInnerI = COLOR_BTNFACE;
    464474    }
    465475    else if(uFlags & BF_SOFT)
     
    488498    if(RBOuterI != -1) RBOuterPen = GetSysColorPen(RBOuterI);
    489499
    490     if((uFlags & BF_MIDDLE) && retval)
    491     {
    492         FillRect(hdc, &InnerRect, GetSysColorBrush(uFlags & BF_MONO ?
    493                                             COLOR_WINDOW : COLOR_BTNFACE));
    494     }
    495 
    496500    MoveToEx(hdc, 0, 0, &SavePoint);
    497501
     
    545549    }
    546550
    547     /* Adjust rectangle if asked */
    548     if(uFlags & BF_ADJUST)
     551    if( ((uFlags & BF_MIDDLE) && retval) || (uFlags & BF_ADJUST) )
    549552    {
    550553        int add = (LTRBInnerMono[uType & (BDR_INNER|BDR_OUTER)] != -1 ? 1 : 0)
    551554                + (LTRBOuterMono[uType & (BDR_INNER|BDR_OUTER)] != -1 ? 1 : 0);
    552         if(uFlags & BF_LEFT)   rc->left   += add;
    553         if(uFlags & BF_RIGHT)  rc->right  -= add;
    554         if(uFlags & BF_TOP)    rc->top    += add;
    555         if(uFlags & BF_BOTTOM) rc->bottom -= add;
     555
     556        if(uFlags & BF_LEFT)   InnerRect.left   += add;
     557        if(uFlags & BF_RIGHT)  InnerRect.right  -= add;
     558        if(uFlags & BF_TOP)    InnerRect.top    += add;
     559        if(uFlags & BF_BOTTOM) InnerRect.bottom -= add;
     560
     561        if((uFlags & BF_MIDDLE) && retval)
     562        {
     563            FillRect(hdc, &InnerRect, GetSysColorBrush(uFlags & BF_MONO ?
     564                                                       COLOR_WINDOW : COLOR_BTNFACE));
     565        }
     566
     567        if(uFlags & BF_ADJUST)
     568            *rc = InnerRect;
    556569    }
    557570
     
    11241137    HBRUSH hbsave, hb, hb2;
    11251138    HPEN hpsave, hp, hp2;
    1126     int tri = 310*SmallDiam/1000;
     1139    int tri = 290*SmallDiam/1000 -1;
    11271140    int d46, d93;
    11281141
     
    11401153    case DFCS_SCROLLUP:
    11411154        Line[2].x = myr.left + 470*SmallDiam/1000 + 2;
    1142         Line[2].y = myr.top  + 313*SmallDiam/1000 + 1;
     1155        Line[2].y = myr.bottom - 687*SmallDiam/1000 + 1;
    11431156        Line[0].x = Line[2].x - tri;
    11441157        Line[1].x = Line[2].x + tri;
     
    11471160
    11481161    case DFCS_SCROLLLEFT:
    1149         Line[2].x = myr.left + 313*SmallDiam/1000 + 1;
     1162        Line[2].x = myr.right - 687*SmallDiam/1000 + 1;
    11501163        Line[2].y = myr.top  + 470*SmallDiam/1000 + 2;
    11511164        Line[0].y = Line[2].y - tri;
     
    12421255
    12431256    /* Here do the real scroll-bar controls end up */
    1244     UITOOLS95_DFC_ButtonPush(dc, r, uFlags & 0xff00);
     1257    if( ! (uFlags & (0xff00 & ~DFCS_ADJUSTRECT)) )
     1258      /* UITOOLS95_DFC_ButtonPush always uses BF_SOFT which we don't */
     1259      /* want for the normal scroll-arrow button. */
     1260      UITOOLS95_DrawRectEdge( dc, r, EDGE_RAISED, (uFlags&DFCS_ADJUSTRECT) | BF_MIDDLE | BF_RECT);
     1261    else
     1262      UITOOLS95_DFC_ButtonPush(dc, r, (uFlags & 0xff00) );
    12451263
    12461264    if(uFlags & DFCS_INACTIVE)
     
    12531271    }
    12541272
    1255     for(i = 0; i < 3; i++)
    1256     {
     1273    if( (uFlags & DFCS_INACTIVE) || !(uFlags & DFCS_PUSHED) )
     1274      for(i = 0; i < 3; i++)
     1275      {
    12571276        Line[i].x--;
    12581277        Line[i].y--;
    1259     }
     1278      }
    12601279
    12611280    i = uFlags & DFCS_INACTIVE ? COLOR_BTNSHADOW : COLOR_BTNTEXT;
Note: See TracChangeset for help on using the changeset viewer.