]> git.saurik.com Git - wxWidgets.git/commitdiff
correct painting of the items with custom colours in TVIS_DROPHILITED state (patch...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 28 May 2006 23:45:39 +0000 (23:45 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 28 May 2006 23:45:39 +0000 (23:45 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39405 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/treectrl.cpp

index 932ae78390c8fec95e81371a87e1847adc711ee0..dfd2f6ebecf416666e0b24238c9a22f5f84d5c77 100644 (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
-                            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() )
                             {
                                 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...)
                             // 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() )
                             {
                                 wxColour colText;
                                 if ( attr->HasTextColour() )