Commit in reactos/lib/user32/windows on MAIN
draw.c+20-281.38 -> 1.39
draw patterned focus rectangles

reactos/lib/user32/windows
draw.c 1.38 -> 1.39
diff -u -r1.38 -r1.39
--- draw.c	26 Jan 2004 09:32:17 -0000	1.38
+++ draw.c	5 Apr 2004 22:18:35 -0000	1.39
@@ -1843,39 +1843,31 @@
 BOOL STDCALL
 DrawFocusRect(HDC hdc, CONST RECT *rect)
 {
-/* FIXME PS_ALTERNATE and R2_XORPEN not yet implemented */
-#if 0 
-   HBRUSH hOldBrush;
-   HPEN hOldPen, hNewPen;
-   INT oldDrawMode, oldBkMode;
-
-   hOldBrush = SelectObject(hdc, GetStockObject(NULL_BRUSH));
-   hNewPen = CreatePen(PS_ALTERNATE, 1, GetSysColor(COLOR_WINDOWTEXT));
-   hOldPen = SelectObject(hdc, hNewPen);
-   oldDrawMode = SetROP2(hdc, R2_XORPEN);
-   oldBkMode = SetBkMode(hdc, TRANSPARENT);
-
-   Rectangle(hdc, rect->left, rect->top, rect->right, rect->bottom);
-
-   SetBkMode(hdc, oldBkMode);
-   SetROP2(hdc, oldDrawMode);
-   SelectObject(hdc, hOldPen);
-   DeleteObject(hNewPen);
-   SelectObject(hdc, hOldBrush);
-
-   return TRUE;
-#else
+   static HBRUSH hFocusRectBrush = NULL;
+   HGDIOBJ OldObj;
+   
+   if(!hFocusRectBrush)
+   {
+      static HBITMAP hFocusPattern = NULL;
+      const DWORD Pattern[4] = {0x5555AAAA, 0x5555AAAA, 0x5555AAAA, 0x5555AAAA};
+      
+      hFocusPattern = CreateBitmap(8, 8, 1, 1, Pattern);
+      hFocusRectBrush = CreatePatternBrush(hFocusPattern);
+   }
+   
+   OldObj = SelectObject(hdc, hFocusRectBrush);
+   
    PatBlt(hdc, rect->left, rect->top,
-      rect->right - rect->left - 1, 1, DSTINVERT);
+      rect->right - rect->left - 1, 1, PATINVERT);
    PatBlt(hdc, rect->left, rect->top + 1, 1,
-      rect->bottom - rect->top - 1, DSTINVERT);
+      rect->bottom - rect->top - 1, PATINVERT);
    PatBlt(hdc, rect->left + 1, rect->bottom - 1,
-      rect->right - rect->left - 1, -1, DSTINVERT);
+      rect->right - rect->left - 1, -1, PATINVERT);
    PatBlt(hdc, rect->right - 1, rect->top, -1,
-      rect->bottom - rect->top - 1, DSTINVERT);
-
+      rect->bottom - rect->top - 1, PATINVERT);
+   
+   SelectObject(hdc, OldObj);
    return TRUE;
-#endif
 }
 
 /*
CVSspam 0.2.8