- Timestamp:
- Nov 22, 2000, 2:44:50 PM (25 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/button.cpp
r3662 r4674 1 /* $Id: button.cpp,v 1.3 7 2000-06-07 14:51:24sandervl Exp $ */1 /* $Id: button.cpp,v 1.38 2000-11-22 13:44:49 sandervl Exp $ */ 2 2 /* File: button.cpp -- Button type widgets 3 3 * … … 21 21 #include <misc.h> 22 22 #include "initterm.h" 23 #include "syscolor.h" 23 24 24 25 #define DBG_LOCALLOG DBG_button … … 951 952 if (infoPtr->hFont) SelectObject( hDC, infoPtr->hFont ); 952 953 953 /* Something is still not right, checkboxes (and edit controls) 954 * in wsping32 have white backgrounds instead of dark grey. 955 * BUTTON_SEND_CTLCOLOR() is even worse since it returns 0 in this 956 * particular case and the background is not painted at all. 954 /* GetControlBrush16 sends WM_CTLCOLORBTN, plus it returns default brush 955 * if parent didn't return valid one. So we kill two hares at once 957 956 */ 958 //SvL: 20/09/99: This works well for us. Now the background of 959 // the dialog button strings in Solitaire is gray 960 SendMessageA(GetParent(hwnd),WM_CTLCOLORBTN,hDC,hwnd); 961 962 hBrush = GetSysColorBrush(COLOR_BTNFACE); 957 hBrush = GetControlBrush( hwnd, hDC, CTLCOLOR_BTN ); 963 958 964 959 /* In order to make things right, draw the rectangle background! */ … … 1091 1086 INT textLen; 1092 1087 char* text; 1088 HBRUSH hbr; 1093 1089 1094 1090 if (action != ODA_DRAWENTIRE) return; 1095 1091 1096 SendMessageA(GetParent(hwnd),WM_CTLCOLORBTN,hDC,hwnd); 1092 /* GroupBox acts like static control, so it sends CTLCOLORSTATIC */ 1093 hbr = GetControlBrush( hwnd, hDC, CTLCOLOR_STATIC ); 1097 1094 1098 1095 GetClientRect(hwnd,&rc); … … 1117 1114 rc.left += 10; 1118 1115 1119 if (dwStyle & WS_DISABLED) DrawDisabledText(hDC,text,&rc,format); else 1116 if (dwStyle & WS_DISABLED) { 1117 DrawDisabledText(hDC,text,&rc,format); 1118 } 1119 else 1120 1120 { 1121 SetTextColor(hDC,GetSysColor(COLOR_BTNTEXT));1122 DrawTextA(hDC,text,-1,&rc,format);1121 SetTextColor(hDC,GetSysColor(COLOR_BTNTEXT)); 1122 DrawTextA(hDC,text,-1,&rc,format); 1123 1123 } 1124 1124 … … 1143 1143 1144 1144 if (infoPtr->hFont) SelectObject( hDC, infoPtr->hFont ); 1145 hBrush = GetSysColorBrush(COLOR_BTNFACE); 1146 1145 hBrush = GetControlBrush( hwnd, hDC, CTLCOLOR_BTN ); 1146 1147 FillRect( hDC, &rc, hBrush ); 1147 1148 if ((action == ODA_FOCUS) || 1148 1149 ((action == ODA_DRAWENTIRE) && (infoPtr->state & BUTTON_HASFOCUS) && IsWindowEnabled(hwnd))) … … 1151 1152 InflateRect(&rc,-1,-1); 1152 1153 } 1153 FillRect( hDC, &rc, hBrush );1154 1154 } 1155 1155 -
trunk/src/user32/dc.cpp
r4597 r4674 1 /* $Id: dc.cpp,v 1.7 8 2000-11-15 13:57:56sandervl Exp $ */1 /* $Id: dc.cpp,v 1.79 2000-11-22 13:44:49 sandervl Exp $ */ 2 2 3 3 /* … … 1232 1232 } 1233 1233 else { 1234 dprintf2(("WinInvalidateRect (%d,%d)(%d,%d)", rectl.xLeft, rectl.yBottom, rectl.xRight, rectl.yTop)); 1234 1235 success = WinInvalidateRect (hwnd, &rectl, IncludeChildren); 1235 1236 //SvL: If all children are included, then WinInvalidateRect is called -
trunk/src/user32/syscolor.cpp
r4494 r4674 1 /* $Id: syscolor.cpp,v 1.2 3 2000-10-17 17:11:07sandervl Exp $ */1 /* $Id: syscolor.cpp,v 1.24 2000-11-22 13:44:50 sandervl Exp $ */ 2 2 3 3 /* … … 27 27 #define DBG_LOCALLOG DBG_syscolor 28 28 #include "dbglocal.h" 29 30 #define CTLCOLOR_MAX CTLCOLOR_STATIC 29 31 30 32 //SvL: Open32 colors are much better than those in the table below … … 306 308 return hPattern55AABitmap; 307 309 } 310 //****************************************************************************** 311 //****************************************************************************** 312 HBRUSH WIN32API GetControlBrush(HWND hwnd, HDC hdc, DWORD ctlType) 313 { 314 HBRUSH bkgBrush = 0; 315 316 if(ctlType <= CTLCOLOR_MAX) 317 { 318 bkgBrush = (HBRUSH)SendMessageA(GetParent(hwnd), WM_CTLCOLORMSGBOX + ctlType, 319 (WPARAM)hdc, (LPARAM)hwnd ); 320 321 if(GetObjectType(bkgBrush) != OBJ_BRUSH) 322 bkgBrush = DefWindowProcA(hwnd, WM_CTLCOLORMSGBOX + ctlType, hdc, ctlType); 323 } 324 return bkgBrush; 325 } 326 //****************************************************************************** 327 //****************************************************************************** -
trunk/src/user32/syscolor.h
r2873 r4674 1 /* $Id: syscolor.h,v 1.1 2 2000-02-23 17:05:17 cbratschiExp $ */1 /* $Id: syscolor.h,v 1.13 2000-11-22 13:44:50 sandervl Exp $ */ 2 2 3 3 /* … … 22 22 extern BOOL SYSCOLOR_GetUseWinColors(VOID); 23 23 24 HBRUSH WIN32API GetControlBrush(HWND hwnd, HDC hdc, DWORD ctlType); 25 24 26 #endif /* __WINE_SYSCOLOR_H */
Note:
See TracChangeset
for help on using the changeset viewer.