Applied patch [ 605189 ] add edit cancel notify to wxTreeEvent
Benjamin I. Williams Currently there is no way of receiving notification that a user cancelled an edit operation on a wxTreeCtrl tree node label. This patch adds a method "IsEditCancelled" to the wxTreeEvent class. During an EVT_TREE_END_LABEL_EDIT event, the programmer can now determine whether or not the edit operation was cancelled by the user (by pressing <ESC>). This patch provides this implementation for both wxMSW's wxTreeCtrl and the wxGenericTreeCtrl. Both situations have been tested and work well. The patch is not very invasive, and is much smaller than I had expected. Please see the relevent discussion on the wx-dev list for more details. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16995 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -239,6 +239,9 @@ public:
|
||||
// label (for EVT_TREE_{BEGIN|END}_LABEL_EDIT only)
|
||||
const wxString& GetLabel() const { return m_label; }
|
||||
|
||||
// edit cancel flag (for EVT_TREE_{BEGIN|END}_LABEL_EDIT only)
|
||||
bool IsEditCancelled() const { return m_editCancelled; }
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_2
|
||||
// for compatibility only, don't use
|
||||
int GetCode() const { return m_evtKey.GetKeyCode(); }
|
||||
@@ -251,6 +254,7 @@ private:
|
||||
m_itemOld;
|
||||
wxPoint m_pointDrag;
|
||||
wxString m_label;
|
||||
bool m_editCancelled;
|
||||
|
||||
friend class WXDLLEXPORT wxTreeCtrl;
|
||||
friend class WXDLLEXPORT wxGenericTreeCtrl;
|
||||
|
Reference in New Issue
Block a user