]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/button.cpp
Added m_nSelection = -1 fixes to RemovePage, DeleteAllPages (from Scott Newham)
[wxWidgets.git] / src / msw / button.cpp
index b1001d59308051dc4ceb497275be0f9d71bd1e4c..e369bf170dfe762c98730786a978ed77e7ab182a 100644 (file)
@@ -249,9 +249,20 @@ WXHBRUSH wxButton::OnCtlColor(WXHDC pDC,
                               WXWPARAM wParam,
                               WXLPARAM lParam)
 {
-  wxBrush *backgroundBrush = wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID);
+    const HDC& hdc = (HDC)pDC;
 
-  return (WXHBRUSH) backgroundBrush->GetResourceHandle();
+    const wxColour& colBack = GetBackgroundColour();
+    ::SetBkColor(hdc, RGB(colBack.Red(), colBack.Green(), colBack.Blue()));
+
+    const wxColour& colFor = GetForegroundColour();
+    ::SetTextColor(hdc, RGB(colFor.Red(), colFor.Green(), colFor.Blue()));
+
+    ::SetBkMode(hdc, OPAQUE);
+
+    wxBrush *backgroundBrush = wxTheBrushList->FindOrCreateBrush(colBack,
+                                                                 wxSOLID);
+    backgroundBrush->RealizeResource();
+    return (WXHBRUSH)backgroundBrush->GetResourceHandle();
 }
 
 long wxButton::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)