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; 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, // selection colours should override ours,
// otherwise it is too confusing ot the user // otherwise it is too confusing to the user
if ( !(nmcd.uItemState & CDIS_SELECTED) ) if ( !(nmcd.uItemState & CDIS_SELECTED) &&
!(tvItemState & TVIS_DROPHILITED) )
{ {
wxColour colBack; wxColour colBack;
if ( attr->HasBackgroundColour() ) 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 // colour when we don't have focus (we can't keep
// it when we do, it would usually be unreadable on // it when we do, it would usually be unreadable on
// the almost inverted bg colour...) // the almost inverted bg colour...)
if ( !(nmcd.uItemState & CDIS_SELECTED) || if ( ( !(nmcd.uItemState & CDIS_SELECTED) ||
FindFocus() != this ) FindFocus() != this ) &&
!(tvItemState & TVIS_DROPHILITED) )
{ {
wxColour colText; wxColour colText;
if ( attr->HasTextColour() ) if ( attr->HasTextColour() )