]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/treectlg.cpp
Make it possible to actually build cvs with a version of bakefile
[wxWidgets.git] / src / generic / treectlg.cpp
index 98b64ffcddeecd6e221d478e9499400a62919088..c028be3798240b0e8b598ba4519a08b90ddf1216 100644 (file)
@@ -390,6 +390,12 @@ bool wxTreeTextCtrl::AcceptChanges()
     if ( value == m_startValue )
     {
         // nothing changed, always accept
+        // when an item remains unchanged, the owner
+        // needs to be notified that the user decided
+        // not to change the tree item label, and that
+        // the edit has been cancelled
+
+        m_owner->OnRenameCancelled(m_itemEdited);
         return true;
     }
 
@@ -414,7 +420,7 @@ void wxTreeTextCtrl::Finish()
         wxPendingDelete.Append(this);
 
         m_finished = true;
-
+        
         m_owner->SetFocusIgnoringChildren();
     }
 }
@@ -1009,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)
 {