]> git.saurik.com Git - wxWidgets.git/commitdiff
Commited SetHilightDropEffect patch.
authorRobert Roebling <robert@roebling.de>
Sun, 30 Jan 2005 12:44:50 +0000 (12:44 +0000)
committerRobert Roebling <robert@roebling.de>
Sun, 30 Jan 2005 12:44:50 +0000 (12:44 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31647 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/treectlg.h
src/generic/treectlg.cpp

index b4093ccb2550c5339f1192931a9901c2d341c2c3..b1046c7c01cd1cbc0188a8ca30929420c461e9a8 100644 (file)
@@ -150,6 +150,9 @@ public:
         // the item will be shown in bold
     void SetItemBold(const wxTreeItemId& item, bool bold = true);
 
+        // the item will be shown with a drop highlight
+    void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = true);
+
         // set the item's text colour
     void SetItemTextColour(const wxTreeItemId& item, const wxColour& col);
 
index 0811ee2069748b6eae731b333730b19b37257f4d..c028be3798240b0e8b598ba4519a08b90ddf1216 100644 (file)
@@ -420,7 +420,7 @@ void wxTreeTextCtrl::Finish()
         wxPendingDelete.Append(this);
 
         m_finished = true;
-
+        
         m_owner->SetFocusIgnoringChildren();
     }
 }
@@ -1015,6 +1015,25 @@ void wxGenericTreeCtrl::SetItemBold(const wxTreeItemId& item, bool bold)
     }
 }
 
+void wxGenericTreeCtrl::SetItemDropHighlight(const wxTreeItemId& item,
+                                             bool highlight)
+{
+    wxCHECK_RET( item.IsOk(), wxT("invalid tree item") );
+
+    wxColour fg, bg;
+
+    if (highlight)
+    {
+        bg = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT);
+        fg = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
+    }
+
+    wxGenericTreeItem *pItem = (wxGenericTreeItem*) item.m_pItem;
+    pItem->Attr().SetTextColour(fg);
+    pItem->Attr().SetBackgroundColour(bg);
+    RefreshLine(pItem);
+}
+
 void wxGenericTreeCtrl::SetItemTextColour(const wxTreeItemId& item,
                                    const wxColour& col)
 {