X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1f77d487b7ce351b20033312a038f9bb1eb01efc..a4e5e0b90cd1213e9281843560b6979f37e20756:/src/msw/treectrl.cpp diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 4fd9657d16..d7aebb80d6 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -42,6 +42,7 @@ #include "wx/imaglist.h" #include "wx/msw/dragimag.h" +#include "wx/msw/uxtheme.h" // macros to hide the cast ugliness // -------------------------------- @@ -76,7 +77,7 @@ typedef struct tagNMTVITEMCHANGE // The vista tree control includes some new code that originally broke the // multi-selection tree, causing seemingly spurious item selection state changes // during Shift or Ctrl-click item selection. (To witness the original broken -// behavior, simply make IsLocked() below always return false). This problem was +// behaviour, simply make IsLocked() below always return false). This problem was // solved by using the following class to 'unlock' an item's selection state. class TreeItemUnlocker @@ -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; } @@ -3356,7 +3371,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) // the wrong items are deselected. // Fortunately, Vista provides a new notification, TVN_ITEMCHANGING - // that can be used to regulate this incorrect behavior. The + // that can be used to regulate this incorrect behaviour. The // following messages will allow only the unlocked item's selection // state to change