+void wxTreeTextCtrl::EndEdit(bool discardChanges)
+{
+ m_aboutToFinish = true;
+
+ if ( discardChanges )
+ {
+ m_owner->OnRenameCancelled(m_itemEdited);
+
+ Finish( true );
+ }
+ else
+ {
+ // Notify the owner about the changes
+ AcceptChanges();
+
+ // Even if vetoed, close the control (consistent with MSW)
+ Finish( true );
+ }
+}
+