From 8b713759b615fc1530d1f476f37d6d213e7934a5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 28 May 2006 23:45:39 +0000 Subject: [PATCH] correct painting of the items with custom colours in TVIS_DROPHILITED state (patch 1491478) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39405 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/treectrl.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 932ae78390..dfd2f6ebec 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -2693,9 +2693,15 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) wxTreeItemAttr * const attr = it->second; + wxTreeViewItem tvItem((void *)nmcd.dwItemSpec, + TVIF_STATE, TVIS_DROPHILITED); + DoGetItem(&tvItem); + const UINT tvItemState = tvItem.state; + // selection colours should override ours, - // otherwise it is too confusing ot the user - if ( !(nmcd.uItemState & CDIS_SELECTED) ) + // otherwise it is too confusing to the user + if ( !(nmcd.uItemState & CDIS_SELECTED) && + !(tvItemState & TVIS_DROPHILITED) ) { wxColour colBack; if ( attr->HasBackgroundColour() ) @@ -2709,8 +2715,9 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) // colour when we don't have focus (we can't keep // it when we do, it would usually be unreadable on // the almost inverted bg colour...) - if ( !(nmcd.uItemState & CDIS_SELECTED) || - FindFocus() != this ) + if ( ( !(nmcd.uItemState & CDIS_SELECTED) || + FindFocus() != this ) && + !(tvItemState & TVIS_DROPHILITED) ) { wxColour colText; if ( attr->HasTextColour() ) -- 2.45.2