edit selected text fix

Dan Engel dengel at sourceharvest.com
Thu Apr 12 21:10:25 CDT 2001


Okay, second try, this time with diff -u:

Problem: Edit boxes are, in some cases, displaying selected text as white-on-white, so that it disappeared.
 
Analysis: When text is drawn using the x11drv function X11DRV_ExtTextOut, the function does not paint a background rectangle if the background mode for the device context is transparent.  In the case of edit controls, there is no attempt to change the background mode to opaque for selected text.
 
Solution: In the case of painting reverse text in the edit control (function EDIT_PaintText) set the backgound mode to opaque, and then restore it before exiting the function.
 
The patch is attached (edit_selectedtext.diff).
 
 -Dan Engel

-------------- next part --------------
? wine.patch
Index: controls/edit.c
===================================================================
RCS file: /home/wine/wine/controls/edit.c,v
retrieving revision 1.78
diff -u -r1.78 edit.c
--- controls/edit.c	2001/04/10 21:46:27	1.78
+++ controls/edit.c	2001/04/13 01:59:07
@@ -2202,15 +2202,18 @@
 	COLORREF TextColor;
 	INT ret;
 	INT li;
+	INT BkMode;
 	SIZE size;
 
 	if (!count)
 		return 0;
+	BkMode = GetBkMode(dc);
 	BkColor = GetBkColor(dc);
 	TextColor = GetTextColor(dc);
 	if (rev) {
 		SetBkColor(dc, GetSysColor(COLOR_HIGHLIGHT));
 		SetTextColor(dc, GetSysColor(COLOR_HIGHLIGHTTEXT));
+		SetBkMode( dc, OPAQUE);
 	}
 	li = EDIT_EM_LineIndex(es, line);
 	if (es->style & ES_MULTILINE) {
@@ -2227,6 +2230,7 @@
 	if (rev) {
 		SetBkColor(dc, BkColor);
 		SetTextColor(dc, TextColor);
+		SetBkMode( dc, BkMode);
 	}
 	return ret;
 }


More information about the wine-patches mailing list