03-28-2008 12:49 PM
03-31-2008 10:56 AM
03-31-2008 11:01 AM
03-31-2008 11:10 AM
Hi Daniel,
I think there is a way to to this. You can edit a tree item's label by pressing the F2 button on your keyboard. If you would like to edit the label by slow double-clicking, you could emulate the F2 button using the FakeKeyStroke function. Only thing you need to do is monitor the time beween two callback functions with event set to EVENT_LEFT_CLICK. If you're stuck, just let me know and I might find the time to write you a piece of example code tomorrow...
03-31-2008 11:13 AM
04-01-2008 03:01 AM
Hello,
I made you a small example. Check the attachment to this post. You should make sure that the item's ATTR_NO_EDIT_LABEL attribute is not set. Also, note that the left-click event in the callback function is swallowed after the F2 key stroke is simulated (function returns 1 instead of 0). If you don't swallow the event, the left-click is passed to the control after the callback function is finished, which immediately stops editing the label...
04-01-2008 10:13 AM - edited 04-01-2008 10:17 AM
04-01-2008 10:30 AM
04-01-2008 10:35 AM
Just as an FYI....
You can call
SetCtrlAttribute(panel, control, ATTR_TREE_RUN_STATE, VAL_EDIT_STATE);
instead of
FakeKeystroke (VAL_F2_VKEY);
It has the same behaivior and I think it is a little cleaner.
- jared
04-01-2008 10:37 AM