]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/treectrl.cpp
header inclusion fix
[wxWidgets.git] / src / msw / treectrl.cpp
index 913713c5662a90651c628c422bb42793fce446f4..8171cae0a3ce9ebe4e3845b0aca6b22a921396f0 100644 (file)
@@ -45,6 +45,7 @@
 #include "wx/dynarray.h"
 #include "wx/imaglist.h"
 #include "wx/treectrl.h"
+#include "wx/settings.h"
 
 #ifdef __GNUWIN32__
 #ifndef wxUSE_NORLANDER_HEADERS
@@ -66,6 +67,7 @@
 // ----------------------------------------------------------------------------
 
 // a convenient wrapper around TV_ITEM struct which adds a ctor
+#pragma warning( disable : 4097 )
 struct wxTreeViewItem : public TV_ITEM
 {
     wxTreeViewItem(const wxTreeItemId& item,    // the item handle
@@ -78,6 +80,7 @@ struct wxTreeViewItem : public TV_ITEM
         hItem = (HTREEITEM) (WXHTREEITEM) item;
     }
 };
+#pragma warning( default : 4097 )
 
 // a class which encapsulates the tree traversal logic: it vists all (unless
 // OnVisit() returns FALSE) items under the given one
@@ -210,9 +213,9 @@ bool wxTreeCtrl::Create(wxWindow *parent,
     if ( !MSWCreateControl(WC_TREEVIEW, wstyle) )
         return FALSE;
 
-    // the treectrl with any other background looks ugly because the items
-    // background is white anyhow
-    SetBackgroundColour(*wxWHITE);
+    SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW));
+    SetForegroundColour(wxWindow::GetParent()->GetForegroundColour());
+
 
     // VZ: this is some experimental code which may be used to get the
     //     TVS_CHECKBOXES style functionality for comctl32.dll < 4.71.