comparison os2/dw.c @ 1688:72ac6eb33d76

Fixed dw_window_set_color() not removing the transparent flag on OS/2. This was preventing background colors from being set on controls that default to having a transparent background color by default.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 30 Apr 2012 16:49:38 +0000
parents 831aa3a679e6
children 3fb7002e4de6
comparison
equal deleted inserted replaced
1687:831aa3a679e6 1688:72ac6eb33d76
2044 ULONG style = WinQueryWindowULong(hWnd, QWL_STYLE) & (DT_TOP|DT_VCENTER|DT_BOTTOM|DT_LEFT|DT_CENTER|DT_RIGHT|DT_WORDBREAK); 2044 ULONG style = WinQueryWindowULong(hWnd, QWL_STYLE) & (DT_TOP|DT_VCENTER|DT_BOTTOM|DT_LEFT|DT_CENTER|DT_RIGHT|DT_WORDBREAK);
2045 char *tempbuf = alloca(len + 2); 2045 char *tempbuf = alloca(len + 2);
2046 ULONG fcolor = DT_TEXTATTRS, bcolor = DT_TEXTATTRS; 2046 ULONG fcolor = DT_TEXTATTRS, bcolor = DT_TEXTATTRS;
2047 2047
2048 WinQueryWindowText(hWnd, len + 1, (PSZ)tempbuf); 2048 WinQueryWindowText(hWnd, len + 1, (PSZ)tempbuf);
2049 WinQueryWindowRect(hWnd, &rclPaint);
2049 2050
2050 hpsPaint = WinBeginPaint(hWnd, 0, 0); 2051 hpsPaint = WinBeginPaint(hWnd, 0, 0);
2051 WinQueryWindowRect(hWnd, &rclPaint);
2052 if(WinQueryPresParam(hWnd, PP_BACKGROUNDCOLOR, 0, NULL, sizeof(bcolor), &bcolor, QPF_NOINHERIT) || 2052 if(WinQueryPresParam(hWnd, PP_BACKGROUNDCOLOR, 0, NULL, sizeof(bcolor), &bcolor, QPF_NOINHERIT) ||
2053 WinQueryPresParam(hWnd, PP_BACKGROUNDCOLORINDEX, 0, NULL, sizeof(bcolor), &bcolor, QPF_NOINHERIT)) 2053 WinQueryPresParam(hWnd, PP_BACKGROUNDCOLORINDEX, 0, NULL, sizeof(bcolor), &bcolor, QPF_NOINHERIT))
2054 GpiSetBackColor(hpsPaint, bcolor); 2054 GpiSetBackColor(hpsPaint, bcolor);
2055 if(WinQueryPresParam(hWnd, PP_FOREGROUNDCOLOR, 0, NULL, sizeof(fcolor), &fcolor, QPF_NOINHERIT) || 2055 if(WinQueryPresParam(hWnd, PP_FOREGROUNDCOLOR, 0, NULL, sizeof(fcolor), &fcolor, QPF_NOINHERIT) ||
2056 WinQueryPresParam(hWnd, PP_FOREGROUNDCOLORINDEX, 0, NULL, sizeof(fcolor), &fcolor, QPF_NOINHERIT)) 2056 WinQueryPresParam(hWnd, PP_FOREGROUNDCOLORINDEX, 0, NULL, sizeof(fcolor), &fcolor, QPF_NOINHERIT))
5185 rgb2.bGreen = DW_GREEN_VALUE(back); 5185 rgb2.bGreen = DW_GREEN_VALUE(back);
5186 rgb2.bRed = DW_RED_VALUE(back); 5186 rgb2.bRed = DW_RED_VALUE(back);
5187 rgb2.fcOptions = 0; 5187 rgb2.fcOptions = 0;
5188 5188
5189 WinSetPresParam(handle, PP_BACKGROUNDCOLOR, sizeof(RGB2), &rgb2); 5189 WinSetPresParam(handle, PP_BACKGROUNDCOLOR, sizeof(RGB2), &rgb2);
5190 dw_window_set_data(handle, "_dw_transparent", NULL);
5190 } 5191 }
5191 else if(back != DW_CLR_DEFAULT) 5192 else if(back != DW_CLR_DEFAULT)
5192 { 5193 {
5193 back = _internal_color(back); 5194 back = _internal_color(back);
5194 5195
5195 WinSetPresParam(handle, PP_BACKGROUNDCOLORINDEX, sizeof(ULONG), &back); 5196 WinSetPresParam(handle, PP_BACKGROUNDCOLORINDEX, sizeof(ULONG), &back);
5197 dw_window_set_data(handle, "_dw_transparent", NULL);
5196 } 5198 }
5197 /* If this is a box... check if any of the children are transparent */ 5199 /* If this is a box... check if any of the children are transparent */
5198 _handle_transparent(handle); 5200 _handle_transparent(handle);
5199 return DW_ERROR_NONE; 5201 return DW_ERROR_NONE;
5200 } 5202 }