trouble with tree control OnEndLabelEdit Event

Started by maweilian, March 12, 2009, 09:08:45 AM

Previous topic - Next topic

maweilian

I have a tree control in my form with which I want my users to ba able to edit the labels.  However, I am having trouble figuring out how to do this.  So far I have this code in my LISP file:


;;;define action when the label has begun to be edited
(defun c:partlibmain_PartLibMain_Tree2_OnBeginLabelEdit (Key /)
  (setq LabelEditBeginValue (dcl_Tree_GetItemLabel partlibmain_PartLibMain_Tree2 Key))
);end defun

;;;define action when the label has finished editing [not working properly]
(defun c:partlibmain_PartLibMain_Tree2_OnEndLabelEdit (NewValue Key /)
  (if (= NewValue "")
    (dcl_Tree_SetItemLabel partlibmain_PartLibMain_Tree2 Key LabelEditBeginValue)
    (progn
     
     ... code here to perform operations with the new label value ...

    );end progn
  );end if
);end defun

;;define action when return is pressed while operating in the treeview control
(defun c:partlibmain_PartLibMain_Tree2_OnReturnPressed (/)
  (dcl_Tree_CancelLabelEdit partlibmain_PartLibMain_Tree2)
);end defun


When I run the application, I can edit the labels but once I press return or click somewhere else on the form, my edits disappear and are not passed to the OnEndLabelEdit event handler.

What am I missing or doing wrong?

Thanks,
Will

owenwengerd

It was a bug. I've fixed it now for the next build so that it passes back the new label and updates the control.
Owen Wengerd (Outside The Box) / ManuSoft