Forgot the patch. Here it is.

On Mon, 30 Oct 2000, Dmitry Timoshkov wrote:

> Francois Gouget <[EMAIL PROTECTED]> wrote:
> 
> >   This patch does not seem right to me. I base this on my observations
> >of the behavior of the grafmenu, a smaple program of the Petzold 95. 
> >This program creates a menu containing black and white bitmaps and here
> >is what it looks like:
> [skipped]
> 
> Actually my patch was addressing only fact, that bitmap menu items were
> never neither hilited nor inverted. I've never took into account any
> difference between Win95 and Win98 look either. But after your comments
> I had a look on those difference, and implemented hopely right look in both
> situations (only for hilited menu items). I think that it is a bug in windows95
> - not draw hilited background for bitmap menu items.

   I think your patch should not have the NOTSRCCOPY BitBlt stuff. Win9x
seems to just rely on properly setting the text and background colors. 

   I built on your patch and propose the following instead. It's not
exactly like Win98 but I think it looks even nicer. The reason is that
the look of the checkmark and the bitmaps is consistent with both looks
whereas in Windows they are not. 
   BTW, what happens for color bitmaps? Can they be used???


I've put up a couple screenshots showing how things look in Wine with
my patch applied: 
  Win95 look: http://fgouget.free.fr/wine/PrgWin95/grafmenu-wine952.png
  Win98 look: http://fgouget.free.fr/wine/PrgWin95/grafmenu-wine982.png

And if you go to this page you have the links to all the screenshots,
Windows and Wine: 
  http://fgouget.free.fr/wine/PrgWin95/Chap10.shtml#grafmenu

[...]


--
Francois Gouget         [EMAIL PROTECTED]        http://fgouget.free.fr/
                     f u kn rd ts, ur wy 2 gky 4 ur wn gd.


Index: controls/menu.c
===================================================================
RCS file: /home/wine/wine/controls/menu.c,v
retrieving revision 1.88
diff -u -r1.88 menu.c
--- controls/menu.c     2000/10/26 21:47:20     1.88
+++ controls/menu.c     2000/10/30 19:19:54
@@ -1112,15 +1110,27 @@
 
     rect = lpitem->rect;
 
-    if (!(lpitem->fType & MF_OWNERDRAW))
-    {
-        if ((lpitem->fState & MF_HILITE) && !(IS_BITMAP_ITEM(lpitem->fType)))
-            if ((menuBar) &&  (TWEAK_WineLook==WIN98_LOOK))
-               DrawEdge(hdc, &rect, BDR_SUNKENOUTER, BF_RECT);
-           else
-               FillRect( hdc, &rect, GetSysColorBrush(COLOR_HIGHLIGHT) );
-        else
+      if (!(lpitem->fType & MF_OWNERDRAW))
+      {
+       if (lpitem->fState & MF_HILITE)
+       {
+           if(TWEAK_WineLook == WIN98_LOOK)
+           {
+               if(menuBar)
+                   DrawEdge(hdc, &rect, BDR_SUNKENOUTER, BF_RECT);
+               else
+                   FillRect(hdc, &rect, GetSysColorBrush(COLOR_HIGHLIGHT));
+           }
+           else /* Not Win98 Look */
+           {
+               if(!IS_BITMAP_ITEM(lpitem->fType))
+                   FillRect(hdc, &rect, GetSysColorBrush(COLOR_HIGHLIGHT));
+           }
+       }
+        else {
            FillRect( hdc, &rect, GetSysColorBrush(COLOR_MENU) );
+       }
+       InflateRect(&rect,-1,-1);
     }
 
     SetBkMode( hdc, TRANSPARENT );
@@ -1168,15 +1178,29 @@
 
       /* Setup colors */
 
-    if ((lpitem->fState & MF_HILITE) && !(IS_BITMAP_ITEM(lpitem->fType)) )
+    if (lpitem->fState & MF_HILITE)
     {
-       if (lpitem->fState & MF_GRAYED)
-           SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) );
-       else if ((menuBar) &&  (TWEAK_WineLook==WIN98_LOOK))
-           SetTextColor( hdc, GetSysColor( COLOR_MENUTEXT ) );
-       else
-           SetTextColor( hdc, GetSysColor( COLOR_HIGHLIGHTTEXT ) );
-       SetBkColor( hdc, GetSysColor( COLOR_HIGHLIGHT ) );
+       if(TWEAK_WineLook == WIN98_LOOK)
+       {
+            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 /* Not Win98 Look */
+       {
+           SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT));
+           if(!IS_BITMAP_ITEM(lpitem->fType))
+               SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT));
+           else
+               SetBkColor(hdc, GetSysColor(COLOR_MENU));
+       }
     }
     else
     {

Reply via email to