X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/13ff9344d600ab38ad5ad4088d4a4797184405d2..d21d2e5adf7a5acf3b496a9c4e87eab220bd75d8:/src/msw/treectrl.cpp diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index e34ecfac62..a0713416ab 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -47,6 +47,7 @@ #if defined(__WIN95__) +#include "wx/app.h" #include "wx/log.h" #include "wx/dynarray.h" #include "wx/imaglist.h" @@ -546,6 +547,13 @@ bool wxTreeCtrl::Create(wxWindow *parent, if ( m_windowStyle & wxTR_LINES_AT_ROOT ) wstyle |= TVS_LINESATROOT; + + if ( m_windowStyle & wxTR_FULL_ROW_HIGHLIGHT ) + { + if ( wxTheApp->GetComCtl32Version() >= 471 ) + wstyle |= TVS_FULLROWSELECT; + } + // using TVS_CHECKBOXES for emulation of a multiselection tree control // doesn't work without the new enough headers @@ -1032,6 +1040,15 @@ void wxTreeCtrl::SetItemDropHighlight(const wxTreeItemId& item, bool highlight) DoSetItem(&tvItem); } +void wxTreeCtrl::RefreshItem(const wxTreeItemId& item) +{ + wxRect rect; + if ( GetBoundingRect(item, rect) ) + { + RefreshRect(rect); + } +} + void wxTreeCtrl::SetItemTextColour(const wxTreeItemId& item, const wxColour& col) { @@ -1046,7 +1063,8 @@ void wxTreeCtrl::SetItemTextColour(const wxTreeItemId& item, } attr->SetTextColour(col); - Refresh(); + + RefreshItem(item); } void wxTreeCtrl::SetItemBackgroundColour(const wxTreeItemId& item, @@ -1063,7 +1081,8 @@ void wxTreeCtrl::SetItemBackgroundColour(const wxTreeItemId& item, } attr->SetBackgroundColour(col); - Refresh(); + + RefreshItem(item); } void wxTreeCtrl::SetItemFont(const wxTreeItemId& item, const wxFont& font) @@ -1079,7 +1098,8 @@ void wxTreeCtrl::SetItemFont(const wxTreeItemId& item, const wxFont& font) } attr->SetFont(font); - Refresh(); + + RefreshItem(item); } // ---------------------------------------------------------------------------- @@ -1097,7 +1117,6 @@ bool wxTreeCtrl::IsVisible(const wxTreeItemId& item) const // FALSE means get item rect for the whole item, not only text return SendMessage(GetHwnd(), TVM_GETITEMRECT, FALSE, (LPARAM)&rect) != 0; - } bool wxTreeCtrl::ItemHasChildren(const wxTreeItemId& item) const