]> git.saurik.com Git - wxWidgets.git/commitdiff
use solid bacgkround for static box as pattern brush can't be properly aligned when...
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 13 Dec 2004 00:12:37 +0000 (00:12 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 13 Dec 2004 00:12:37 +0000 (00:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30978 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/statbox.h
src/msw/statbox.cpp

index 06956d91b545af86f62d64440a6f89afe68b2f25..4109ac7a1920cc3a8ab7fb8e5249c0addfe0e174 100644 (file)
@@ -42,6 +42,8 @@ public:
 protected:
     virtual wxSize DoGetBestSize() const;
 
+    virtual WXHBRUSH MSWGetBgBrushForSelf(wxWindow *parent, WXHDC hDC);
+
 private:
     DECLARE_DYNAMIC_CLASS_NO_COPY(wxStaticBox)
 };
index 672b7eb6ff3683e90aa7e18e0a6464234b5401d6..4173fcfee65cf00e76f34dcc66a408c7be9ab7da 100644 (file)
@@ -38,6 +38,7 @@
 #include "wx/statbox.h"
 
 #include "wx/msw/private.h"
+#include "wx/msw/notebook.h"
 
 // ----------------------------------------------------------------------------
 // wxWin macros
@@ -134,4 +135,18 @@ wxSize wxStaticBox::DoGetBestSize() const
     return wxSize(wBox, hBox);
 }
 
+WXHBRUSH
+wxStaticBox::MSWGetBgBrushForSelf(wxWindow *parent, WXHDC WXUNUSED(pDC))
+{
+    // we can't use pattern brushes because, apparently, the window proc of our
+    // class does something which invalidates the brush origin before drawing
+    // with it and so any patetrn brush is used incorrectly as can be seen by
+    // putting a static box inside a (themed) notebook
+    //
+    // so always use solid brush for painting the background (note that this
+    // only applies to the background of the box label, not the insides of the
+    // box itself)
+    return parent->MSWGetSolidBgBrushForChild(this);
+}
+
 #endif // wxUSE_STATBOX