]> git.saurik.com Git - wxWidgets.git/commitdiff
DrawButtonFrame was a bit wrong because it was ignoring COLOR_3DLIGHT;
authorGuillermo Rodriguez Garcia <guille@iies.es>
Wed, 1 Mar 2000 16:39:22 +0000 (16:39 +0000)
committerGuillermo Rodriguez Garcia <guille@iies.es>
Wed, 1 Mar 2000 16:39:22 +0000 (16:39 +0000)
fixed now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6375 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/button.cpp

index 86f833762c9e4a77ecac30d891699d595b399567..28dfc634dabbd708003b96dd51c9f7718fa53928 100644 (file)
@@ -338,10 +338,11 @@ bool wxButton::SetForegroundColour(const wxColour &colour)
    The button frame looks like this normally:
 
    WWWWWWWWWWWWWWWWWWB
-   W                GB
-   W                GB
-   W                GB  where W, G, B are white, grey and black pixels
-   W                GB
+   WHHHHHHHHHHHHHHHHGB  W = white       (HILIGHT)
+   WH               GB  H = light grey  (LIGHT)
+   WH               GB  G = dark grey   (SHADOW)
+   WH               GB  B = black       (DKSHADOW)
+   WH               GB
    WGGGGGGGGGGGGGGGGGB
    BBBBBBBBBBBBBBBBBBB
 
@@ -350,8 +351,9 @@ bool wxButton::SetForegroundColour(const wxColour &colour)
 
    BBBBBBBBBBBBBBBBBBB
    BWWWWWWWWWWWWWWWWBB
-   BW              GBB
-   BW              GBB
+   BWHHHHHHHHHHHHHHGBB
+   BWH             GBB
+   BWH             GBB
    BWGGGGGGGGGGGGGGGBB
    BBBBBBBBBBBBBBBBBBB
    BBBBBBBBBBBBBBBBBBB
@@ -363,6 +365,7 @@ bool wxButton::SetForegroundColour(const wxColour &colour)
    BG               GB
    BG               GB
    BG               GB
+   BG               GB
    BGGGGGGGGGGGGGGGGGB
    BBBBBBBBBBBBBBBBBBB
 */
@@ -373,9 +376,10 @@ static void DrawButtonFrame(HDC hdc, const RECT& rectBtn,
     RECT r;
     CopyRect(&r, &rectBtn);
 
-    HPEN hpenBlack = CreatePen(PS_SOLID, 1, GetSysColor(COLOR_3DDKSHADOW)),
-         hpenGrey = CreatePen(PS_SOLID, 1, GetSysColor(COLOR_3DSHADOW)),
-         hpenWhite = CreatePen(PS_SOLID, 1, GetSysColor(COLOR_3DHILIGHT));
+    HPEN hpenBlack   = CreatePen(PS_SOLID, 1, GetSysColor(COLOR_3DDKSHADOW)),
+         hpenGrey    = CreatePen(PS_SOLID, 1, GetSysColor(COLOR_3DSHADOW)),
+         hpenLightGr = CreatePen(PS_SOLID, 1, GetSysColor(COLOR_3DLIGHT)),
+         hpenWhite   = CreatePen(PS_SOLID, 1, GetSysColor(COLOR_3DHILIGHT));
 
     HPEN hpenOld = (HPEN)SelectObject(hdc, hpenBlack);
 
@@ -409,6 +413,11 @@ static void DrawButtonFrame(HDC hdc, const RECT& rectBtn,
         LineTo(hdc, r.left, r.top);
         LineTo(hdc, r.right, r.top);
 
+        (void)SelectObject(hdc, hpenLightGr);
+        MoveToEx(hdc, r.left + 1, r.bottom - 2, NULL);
+        LineTo(hdc, r.left + 1, r.top + 1);
+        LineTo(hdc, r.right - 1, r.top + 1);
+
         (void)SelectObject(hdc, hpenGrey);
         MoveToEx(hdc, r.left + 1, r.bottom - 1, NULL);
         LineTo(hdc, r.right - 1, r.bottom - 1);
@@ -417,6 +426,7 @@ static void DrawButtonFrame(HDC hdc, const RECT& rectBtn,
 
     (void)SelectObject(hdc, hpenOld);
     DeleteObject(hpenWhite);
+    DeleteObject(hpenLightGr);
     DeleteObject(hpenGrey);
     DeleteObject(hpenBlack);
 }