controls/menu.c

Ge van Geldorp gvg at reactos.com
Fri Apr 16 12:55:32 CDT 2004


This fixes the black text on white background in AbiWord menus

Changelog:
  Ge van Geldorp <gvg at reactos.com>
  Setup menu drawing colors before calling owner draw routine

Index: controls/menu.c
===================================================================
RCS file: /home/wine/wine/controls/menu.c,v
retrieving revision 1.181
diff -u -r1.181 menu.c
--- controls/menu.c	2 Apr 2004 19:29:18 -0000	1.181
+++ controls/menu.c	16 Apr 2004 17:52:23 -0000
@@ -1116,6 +1116,30 @@
 	return;
     }
 
+      /* Setup colors */
+
+    if (lpitem->fState & MF_HILITE)
+    {
+        if(menuBar) {
+	    SetTextColor(hdc, GetSysColor(COLOR_MENUTEXT));
+            SetBkColor(hdc, GetSysColor(COLOR_MENU));
+	} else {
+	    if(lpitem->fState & MF_GRAYED)
+		SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
+	    else
+		SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT));
+            SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT));
+	}
+    }
+    else
+    {
+	if (lpitem->fState & MF_GRAYED)
+	    SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) );
+	else
+	    SetTextColor( hdc, GetSysColor( COLOR_MENUTEXT ) );
+	SetBkColor( hdc, GetSysColor( COLOR_MENU ) );
+    }
+
     if (lpitem->fType & MF_OWNERDRAW)
     {
         /*
@@ -1193,30 +1217,6 @@
 	    DrawEdge (hdc, &rc, EDGE_ETCHED, BF_TOP);
 	    return;
         }
-    }
-
-      /* Setup colors */
-
-    if (lpitem->fState & MF_HILITE)
-    {
-        if(menuBar) {
-	    SetTextColor(hdc, GetSysColor(COLOR_MENUTEXT));
-            SetBkColor(hdc, GetSysColor(COLOR_MENU));
-	} else {
-	    if(lpitem->fState & MF_GRAYED)
-		SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
-	    else
-		SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT));
-            SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT));
-	}
-    }
-    else
-    {
-	if (lpitem->fState & MF_GRAYED)
-	    SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) );
-	else
-	    SetTextColor( hdc, GetSysColor( COLOR_MENUTEXT ) );
-	SetBkColor( hdc, GetSysColor( COLOR_MENU ) );
     }
 
 	/* helper lines for debugging */



More information about the wine-patches mailing list