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
This commit is contained in:
Vadim Zeitlin 2006-05-28 23:45:39 +00:00
parent b5b0a35d6b
commit 8b713759b6

View File

@ -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() )