Easyer way of use event DragnDropFromControl in treecontrol.

Started by stephan_35, August 19, 2009, 03:42:37 PM

Previous topic - Next topic

stephan_35

Hello,

I encounter enormous problems in the process "event" DragnDropFromControl in treecontrol.   :'(

Firstly I do not know how to recognize the user's actions, indeed the CTRL and SHIFT keys are usable, but I do not master the result.

The "event" keydown KeyUp and can not be combined with the "event" DragnDropFromControl.

The movement of "node" are performed dynamically in treecontrol, while it was desirable that it be made by the developer (in my point of view  ;) )

And finally, this deleted node is the only clue that I have to know the action of the user ...

So, to know the user action, I must test the "node" delete previously stored "n -2" by the event "onclick" in the "treecontrol" ... Yes, because the "event" onclick "is also called during the process of displacement" DragnDropFromControl "...

In short, I think I will get it, but I wanted to show the difficulty of programming and process.

My tools will smell like "bloatware" or "white elephant" (sorry for my translate   ;D)

Thank you to make your experience   ;)

Best regards.
OpenDCL 6.0.0.6 / Editor 5.1.2.3  / Vista 32 Bits
Development of  specific tools for trades in AutoLisp - php - sql

stephan_35

Hello,

Should be better if you can add in the "event" return, the selected point as DropPoint is, like :

Code (autolisp) Select
(defun c:event_DragnDropFromControl (ProjectName FormName ControlName DropPoint SelectedPoint / )


Just because , as i try to explain, we have to store the previous last selected point (node) , and this is not an eaysy way.

Actual process to be write inside event in lisp
Code (autolisp) Select

(defun c:Tree_onclicked(/)
; have to store the last selected because of event DragnDrop !!!!
(if &selected (setq &last &selected))
(setq &selected (list
(dcl_tree_GetParentItem tree (dcl_tree_GetSelectedItem Tree))
(dcl_tree_GetSelectedItem Tree)
(dcl_tree_GetItemLabel tree (dcl_tree_GetSelectedItem Tree))
(dcl_tree_GetItemImages tree (dcl_tree_GetSelectedItem Tree))
)
....
)

)
(defun c:event_DragnDropFromControl (ProjectName FormName ControlName DropPoint / )
; test if last selected item is alive, if not, move action
(if (dcl_tree_SelectItem (nth 1 &Last)
...
...
)
; if action is unautorized, restore the delected item , ARRRGGGHHH
(if (do my test)
(dcl_tree_addchild (all nth from &last)
)
)
)


Also, in a move case, the selected node is deleted, so it could be interesting to give back all data from selected node, like parent, key, label and icones ....

Other way, is to do nothing in event, and all process shoud be write by developper ...  ;D

Thanks
OpenDCL 6.0.0.6 / Editor 5.1.2.3  / Vista 32 Bits
Development of  specific tools for trades in AutoLisp - php - sql