On Tue, 31 Oct 2000, Dmitry Timoshkov wrote:

> Okay, things are simpler than they look.
> Eyes are afraid - hands are doing (russian byword).
> 
> I have wrote a very simple sample that demonstrates bitmaps
> in the menu (mono and 16 colors, you can add your own of course).
> 
> Selected color bitmaps are inverted in both win95 and win98,
> but monochrome look very different. Do we need *exact* emulation here?


   I did some more experimentation and I found the 'formula' for Win98.
The right ROP is MERGEPAINT.
   With the other patch that I sent to wine-patches, the Win98 mode
looks exactly like in Win98. Actually part of the +/- 1 fixes necessary
for a good rendering of the sunken border are in this patch.

   But the Win95 mode still is not perfect. I tried many ROPs and
NOTSRCCOPY is the one that matches best Win95 except on monochrome
bitmaps. Now I believe the problem is that the pen/brush color must be
wrong (and then maybe the ROP is really the same and on Win98).

   Anyone with more luck than me?

   Otherwise I'll do some cleanup (maybe) and submit this patch to
wine-patches in a few days.


--
Francois Gouget         [EMAIL PROTECTED]        http://fgouget.free.fr/
  Any sufficiently advanced Operating System is indistinguishable from Linux
Index: controls/menu.c
===================================================================
RCS file: /home/wine/wine/controls/menu.c,v
retrieving revision 1.90
diff -u -r1.90 menu.c
--- controls/menu.c     2000/11/02 20:08:34     1.90
+++ controls/menu.c     2000/11/05 00:56:57
@@ -1182,16 +1185,16 @@
     {
        if(TWEAK_WineLook == WIN98_LOOK)
        {
-           if(menuBar)
+            if(menuBar) {
                SetTextColor(hdc, GetSysColor(COLOR_MENUTEXT));
-           else
-           {
+                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));
            }
-           SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT));
        }
        else /* Not Win98 Look */
        {
@@ -1279,7 +1282,9 @@
 
     /* Draw the item text or bitmap */
     if (IS_BITMAP_ITEM(lpitem->fType))
-    {   int top;
+    {
+        int left,top,w,h;
+        DWORD rop;
 
         HBITMAP resBmp = 0;
 
@@ -1307,10 +1312,19 @@
            /* handle fontsize >  bitmap_height */
            top = ((rect.bottom-rect.top)>bm.bmHeight) ? 
                rect.top+(rect.bottom-rect.top-bm.bmHeight)/2 : rect.top;
-
-           BitBlt( hdc, rect.left, top, rect.right - rect.left,
-                 rect.bottom - rect.top, hdcMem, 0, 0,
-                 ((lpitem->fState & MF_HILITE) && !((LOWORD((DWORD)lpitem->text)) < 
12)) ? NOTSRCCOPY : SRCCOPY );
+            h=rect.bottom - rect.top;
+            left=rect.left;
+            w=rect.right - rect.left;
+            if (TWEAK_WineLook == WIN95_LOOK) {
+                rop=((lpitem->fState & MF_HILITE) && !((LOWORD((DWORD)lpitem->text)) 
+< 12)) ? NOTSRCCOPY : SRCCOPY;
+            } else {
+                left++;
+                w-=2;
+                rop=((lpitem->fState & MF_HILITE) && !((LOWORD((DWORD)lpitem->text)) 
+< 12) && (!menuBar)) ? MERGEPAINT : SRCCOPY;
+            }
+           BitBlt( hdc, left, top, w,
+                 h, hdcMem, 0, 0,
+                  rop);
        }
        DeleteDC( hdcMem );
 

Reply via email to