Changeset 1229 for trunk/src/user32/button.cpp
- Timestamp:
- Oct 9, 1999, 6:28:25 PM (26 years ago)
- File:
-
- 1 edited
-
trunk/src/user32/button.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/button.cpp
r1210 r1229 1 /* $Id: button.cpp,v 1. 6 1999-10-09 11:03:22 sandervlExp $ */1 /* $Id: button.cpp,v 1.7 1999-10-09 16:28:24 cbratschi Exp $ */ 2 2 /* File: button.cpp -- Button type widgets 3 3 * … … 962 962 } else { 963 963 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); 967 982 } 968 983 } … … 1049 1064 GetWindowTextA(hwnd,text,textLen); 1050 1065 if (infoPtr->hFont) SelectObject( hDC, infoPtr->hFont ); 1051 if (dwStyle & WS_DISABLED)1052 SetTextColor( hDC, GetSysColor(COLOR_GRAYTEXT) );1053 1066 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 1055 1079 free(text); 1056 1080 }
Note:
See TracChangeset
for help on using the changeset viewer.
