comparison os2/dw.c @ 1687:831aa3a679e6

Gr... messed up tabs in the last commit.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 30 Apr 2012 16:23:42 +0000
parents 35c5314083a7
children 72ac6eb33d76
comparison
equal deleted inserted replaced
1686:35c5314083a7 1687:831aa3a679e6
2032 2032
2033 if(blah && blah->oldproc) 2033 if(blah && blah->oldproc)
2034 { 2034 {
2035 PFNWP myfunc = blah->oldproc; 2035 PFNWP myfunc = blah->oldproc;
2036 2036
2037 switch(msg) 2037 switch(msg)
2038 { 2038 {
2039 case WM_PAINT: 2039 case WM_PAINT:
2040 { 2040 {
2041 HPS hpsPaint; 2041 HPS hpsPaint;
2042 RECTL rclPaint; 2042 RECTL rclPaint;
2043 int len = WinQueryWindowTextLength(hWnd); 2043 int len = WinQueryWindowTextLength(hWnd);
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 2049
2050 hpsPaint = WinBeginPaint(hWnd, 0, 0); 2050 hpsPaint = WinBeginPaint(hWnd, 0, 0);
2051 WinQueryWindowRect(hWnd, &rclPaint); 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))
2057 GpiSetColor(hpsPaint, fcolor); 2057 GpiSetColor(hpsPaint, fcolor);
2058 WinDrawText(hpsPaint, -1, tempbuf, &rclPaint, DT_TEXTATTRS, DT_TEXTATTRS, style | DT_TEXTATTRS | DT_ERASERECT); 2058 WinDrawText(hpsPaint, -1, tempbuf, &rclPaint, DT_TEXTATTRS, DT_TEXTATTRS, style | DT_TEXTATTRS | DT_ERASERECT);
2059 WinEndPaint(hpsPaint); 2059 WinEndPaint(hpsPaint);
2060 return (MRESULT)TRUE; 2060 return (MRESULT)TRUE;
2061 } 2061 }
2062 default: 2062 default:
2063 return myfunc(hWnd, msg, mp1, mp2); 2063 return myfunc(hWnd, msg, mp1, mp2);
2064 } 2064 }
2065 } 2065 }
2066 2066
2067 return WinDefWindowProc(hWnd, msg, mp1, mp2); 2067 return WinDefWindowProc(hWnd, msg, mp1, mp2);
2068 } 2068 }
2069 2069