git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8654
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
void wxTreeCtrl::SetItemData(const wxTreeItemId& item, wxTreeItemData *data)
{
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) )
wxTreeViewItem tvItem(item, TVIF_PARAM);
if ( HasIndirectData(item) )
break;
case TVN_ENDLABELEDIT:
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();
*result = event.IsAllowed();
// ensure that we don't have the text ctrl which is going to be
// deleted any more
// ensure that we don't have the text ctrl which is going to be
// deleted any more