]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/treectrl.cpp
Added wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT to fix tree and list control selection rendering.
[wxWidgets.git] / src / msw / treectrl.cpp
index 4fd9657d16d5814f2ef7d31fa24819e95cb36230..326e1544699aa308032ad237697d871cb71e1633 100644 (file)
@@ -42,6 +42,7 @@
 
 #include "wx/imaglist.h"
 #include "wx/msw/dragimag.h"
+#include "wx/msw/uxtheme.h"
 
 // macros to hide the cast ugliness
 // --------------------------------
@@ -741,6 +742,20 @@ bool wxTreeCtrl::Create(wxWindow *parent,
 
     wxSetCCUnicodeFormat(GetHwnd());
 
+    if ( m_windowStyle & wxTR_TWIST_BUTTONS )
+    {
+        // Under Vista and later Explorer uses rotating ("twist") buttons
+        // instead of the default "+/-" ones so apply its theme to the tree
+        // control to implement this style.
+        if ( wxGetWinVersion() >= wxWinVersion_Vista )
+        {
+            if ( wxUxThemeEngine *theme = wxUxThemeEngine::GetIfActive() )
+            {
+                theme->SetWindowTheme(GetHwnd(), L"EXPLORER", NULL);
+            }
+        }
+    }
+
     return true;
 }