The DrawFocusRect mystery is still not completely resolved.

   Because of this I think Wine's component should not try to draw their
focus box themselves. The only place I know of where we do this is
dlls/comctl32/tab.c. I tried modifying it to use DrawFocusRect and
attached the patch.
   But I don't know how to test it. Is it correct?


--
Francois Gouget         [EMAIL PROTECTED]        http://fgouget.free.fr/
                      Computers are like airconditioners
                They stop working properly if you open WINDOWS
Index: dlls/comctl32/tab.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/tab.c,v
retrieving revision 1.51
diff -u -r1.51 tab.c
--- dlls/comctl32/tab.c 2000/11/01 03:11:12     1.51
+++ dlls/comctl32/tab.c 2000/11/05 00:57:00
@@ -1594,10 +1594,7 @@
     HPEN hbPen  = GetSysColorPen (COLOR_3DDKSHADOW);
     HPEN hShade = GetSysColorPen (COLOR_BTNSHADOW);
 
-    HPEN   hfocusPen = CreatePen(PS_ALTERNATE, 1, GetSysColor(COLOR_BTNTEXT));
-
     HPEN   holdPen;
-    INT    oldBkMode;
     BOOL   deleteBrush = TRUE;
 
     if (lStyle & TCS_BUTTONS)
@@ -1824,8 +1821,6 @@
       }
     }
   
-    oldBkMode = SetBkMode(hdc, TRANSPARENT);
-
     /* This modifies r to be the text rectangle. */
     TAB_DrawItemInterior(hwnd, hdc, iItem, &r);
 
@@ -1834,20 +1829,14 @@
         (GetFocus() == hwnd) &&
         (iItem == infoPtr->uFocus) )
     {
-      HBRUSH hOldBrush;
       r = itemRect;
       InflateRect(&r, -1, -1);
 
-      hOldBrush = SelectObject(hdc, GetStockObject(NULL_BRUSH));
-      SelectObject(hdc, hfocusPen);
-      Rectangle(hdc, r.left, r.top, r.right, r.bottom);
-      SelectObject(hdc, hOldBrush);
+      DrawFocusRect(hdc, &r);
     }
 
     /* Cleanup */
-    SetBkMode(hdc, oldBkMode);
     SelectObject(hdc, holdPen);
-    DeleteObject(hfocusPen);
     if (deleteBrush) DeleteObject(hbr);
   }
 }

Reply via email to