Ignore:
Timestamp:
Oct 9, 1999, 6:28:25 PM (26 years ago)
Author:
cbratschi
Message:

merged with WINE, button: gray text for radio/checkbox, more to do

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/button.cpp

    r1210 r1229  
    1 /* $Id: button.cpp,v 1.6 1999-10-09 11:03:22 sandervl Exp $ */
     1/* $Id: button.cpp,v 1.7 1999-10-09 16:28:24 cbratschi Exp $ */
    22/* File: button.cpp -- Button type widgets
    33 *
     
    962962          } else {
    963963            if (dwStyle & WS_DISABLED)
    964                 SetTextColor( hDC, GetSysColor(COLOR_GRAYTEXT) );
    965             DrawTextA( hDC, text, -1, &rtext,
    966                          DT_SINGLELINE | DT_VCENTER );
     964            {
     965              RECT rect = rtext;
     966              COLORREF oldMode;
     967              HPEN oldPen;
     968
     969//CB: bug in Open32 DrawText: underscore is always black!, need workaround
     970//    extract to PaintText(HDC hdc,char* text,RECT* rect);
     971              SetTextColor(hDC,GetSysColor(COLOR_3DHILIGHT));
     972              oldPen = SelectObject(hDC,GetSysColorPen(COLOR_3DHIGHLIGHT));
     973              DrawTextA(hDC,text,-1,&rect,DT_SINGLELINE | DT_VCENTER);
     974              SetTextColor(hDC,GetSysColor(COLOR_GRAYTEXT));
     975              SelectObject(hDC,GetSysColorPen(COLOR_GRAYTEXT));
     976              oldMode = SetBkMode(hDC,TRANSPARENT);
     977              OffsetRect(&rect,-1,-1);
     978              DrawTextA(hDC,text,-1,&rect,DT_SINGLELINE | DT_VCENTER);
     979              SetBkMode(hDC,oldMode);
     980              SelectObject(hDC,oldPen);
     981            } else DrawTextA(hDC,text,-1,&rtext,DT_SINGLELINE | DT_VCENTER);
    967982          }
    968983        }
     
    10491064        GetWindowTextA(hwnd,text,textLen);
    10501065        if (infoPtr->hFont) SelectObject( hDC, infoPtr->hFont );
    1051         if (dwStyle & WS_DISABLED)
    1052             SetTextColor( hDC, GetSysColor(COLOR_GRAYTEXT) );
    10531066        rc.left += 10;
    1054         DrawTextA( hDC, text, -1, &rc, DT_SINGLELINE | DT_NOCLIP );
     1067        if (dwStyle & WS_DISABLED &&
     1068            GetSysColor(COLOR_GRAYTEXT) == GetBkColor(hDC))
     1069            PaintGrayOnGray( hDC,infoPtr->hFont,&rc,text,DT_SINGLELINE | DT_NOCLIP );
     1070         else
     1071        {
     1072            SetTextColor( hDC, (dwStyle & WS_DISABLED) ?
     1073                                 GetSysColor(COLOR_GRAYTEXT) :
     1074                                 GetSysColor(COLOR_BTNTEXT) );
     1075            DrawTextA( hDC, text, -1, &rc,
     1076                         DT_SINGLELINE | DT_NOCLIP );
     1077        }
     1078
    10551079        free(text);
    10561080    }
Note: See TracChangeset for help on using the changeset viewer.