Mercurial > dwindows
diff win/dw.c @ 369:39983df2b93d
Updated the license information, and copyrights. Code to do background
color text drawing on Windows. dw_color_background_set(DW_CLR_DEFAULT)
will set background color to transparent.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 27 Apr 2003 18:34:48 +0000 |
parents | 3a71623fc219 |
children | e5156e7e5f19 |
line wrap: on
line diff
--- a/win/dw.c Sun Apr 27 17:05:13 2003 +0000 +++ b/win/dw.c Sun Apr 27 18:34:48 2003 +0000 @@ -4,6 +4,7 @@ * A GTK like implementation of the Win32 GUI * * (C) 2000-2003 Brian Smith <dbsoft@technologist.com> + * (C) 2003 Mark Hessling <m.hessling@qut.edu.au> * */ #define _WIN32_IE 0x0500 @@ -416,6 +417,8 @@ /* Convert to our internal color scheme */ ULONG _internal_color(ULONG color) { + if(color == DW_CLR_DEFAULT) + return DW_RGB_TRANSPARENT; if(color < 18) return DW_RGB(_red[color], _green[color], _blue[color]); return color; @@ -3054,7 +3057,7 @@ for(z=0;z<THREAD_LIMIT;z++) { _foreground[z] = RGB(128,128,128); - _background[z] = 0; + _background[z] = DW_RGB_TRANSPARENT; _hPen[z] = CreatePen(PS_SOLID, 1, _foreground[z]); _hBrush[z] = CreateSolidBrush(_foreground[z]); } @@ -6858,7 +6861,13 @@ } oldFont = SelectObject(hdc, hFont); SetTextColor(hdc, _foreground[threadid]); - SetBkMode(hdc, TRANSPARENT); + if(_background[threadid] == DW_RGB_TRANSPARENT) + SetBkMode(hdc, TRANSPARENT); + else + { + SetBkMode(hdc, OPAQUE); + SetBkColor(hdc, _background[threadid]); + } TextOut(hdc, x, y, text, strlen(text)); SelectObject(hdc, oldFont); if(mustdelete)