X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0377efa2e9cd4d6622857ce2e418ce241c791cf6..10992a81d39da31b79063387b7b71c0ff68737ce:/src/msw/treectrl.cpp diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 84ec966cea..d4995dd32f 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -951,6 +951,12 @@ wxTreeItemData *wxTreeCtrl::GetItemData(const wxTreeItemId& item) const void wxTreeCtrl::SetItemData(const wxTreeItemId& item, wxTreeItemData *data) { + // first, associate this piece of data with this item + if ( data ) + { + data->SetId(item); + } + wxTreeViewItem tvItem(item, TVIF_PARAM); if ( HasIndirectData(item) ) @@ -2298,8 +2304,12 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) break; case TVN_ENDLABELEDIT: - // return TRUE to set the label to the new string + // return TRUE to set the label to the new string: note that we + // also must pretend that we did process the message or it is going + // to be passed to DefWindowProc() which will happily return FALSE + // cancelling the label change *result = event.IsAllowed(); + processed = TRUE; // ensure that we don't have the text ctrl which is going to be // deleted any more