[6.0.0.13] OnDragnDropFromControl Event not called

Started by stephan_35, November 20, 2009, 03:08:48 AM

Previous topic - Next topic

Fred Tomke

Hi, Owen,
Quote from: owenwengerd link=topic=1018I wonder whether it would solve this problem if I change OnDragnDropBegin so that the return value from the event handler is used to decide whether move is allowed.

My English is not as well as to understand completely all your explainations. But I have the strong feeling that drag&drop always can only by Copy or by Move method and not neither by Copy nor Move method?

Quote from: owenwengerd on November 25, 2009, 11:12:54 AM
If I undo the Alpha 14 change, this means Fred's code would need to return 1 to enable only the copy effect.

I'd do handstandings to make my code working. But there's a doubt in my mind: I have some palette forms. All my events (except OnCancelClose) have a (princ) at the last line to avoid returning values at the commandline. I'd have to see the result then.

I'm out of office until mid of december. But I try to create a sample to show you what I do and to have a sample to test.

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

Stephan, the OnDragOver event is not exposed to AutoLISP. I am talking about how drag and drop works in the underlying code.
Owen Wengerd (Outside The Box) / ManuSoft

Fred Tomke

Owen, just a question: as far as I remember in the old ObjectDCL DragBegin started with a timer. The user has to hold the item to be dragged as long enough until DragBegin starts. How do you solve it now? I ask this because in a listview with enabled AllowDragBegin both events are called even at OnClicked (see here).

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

The OpenDCL code uses the MFC drag and drop mechanism for everything. I don't think this has changed, it's just that things are now streamlined so that all controls use the same code to do the work (unless they override it). There is no timer or delay as far as I know, but it is supposed to require a mouse move of at least the number of pixels that your system double click size is set to before the drag is initiated.
Owen Wengerd (Outside The Box) / ManuSoft

Fred Tomke

Quote from: owenwengerd on November 28, 2009, 01:36:36 PM
[...] the number of pixels that your system double click size is set [...]

Oha, what is a "double click size"? Can I find it in the mouse settings of control panel?

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

Yes, somewhere.  But when I tested your code, the drag and drop occurred even if I don't move the mouse, so there is something causing it to malfunction.  I will investigate later today.
Owen Wengerd (Outside The Box) / ManuSoft

stephan_35

Hi everybody.

Thanks owen for OnDragnDropFromControl  Event call with 6.0.0.15.

Now, what can we do for fred and me ,with treeview ?

First, how can i catch the OnDragnDropBegin return value ?

After this work,  i think that treeview should not delete the selected node !

Why ?

Actually, remeber that DragnDrop move action do not move selected node but delete it !

So if an DragnDrop  move action was forbidden, i have to rebuild the deleted node !
But, if the DragnDrop  move action was right, i know how to delete or move selected node .

If Fred and Owen are agree with this, i think this could be the better way to solve both trouble.

I forget this: it is also true for a DragnDrop move from another control ....

Thanks everybody !
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

owenwengerd

Stephan, I'm afraid I don't understand.

There is not currently any way to change the drag action depending on the drop point. As of Alpha 15, you can return an integer value from OnDragnDropBegin to determine whether move, copy, or both are allowed. Please try this, maybe it will solve your problem.
Owen Wengerd (Outside The Box) / ManuSoft

stephan_35

Quote from: owenwengerd on December 09, 2009, 12:16:35 PM
Stephan, I'm afraid I don't understand.

Because of my english  ;D  ?

Quote from: owenwengerd on December 09, 2009, 12:16:35 PM
There is not currently any way to change the drag action depending on the drop point.

Ok, we will try another way.

Quote from: owenwengerd on December 09, 2009, 12:16:35 PM
You can return an integer value from OnDragnDropBegin to determine whether move, copy, or both are allowed. Please try this, maybe it will solve your problem.

I'm ok to try it, but, please give me the way to get the return value !

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

owenwengerd

Quote from: stephan_35 on December 09, 2009, 12:41:44 PM
I'm ok to try it, but, please give me the way to get the return value !

What exactly do you mean by "return value"?
Owen Wengerd (Outside The Box) / ManuSoft

stephan_35

I'm stupid !

I think now i understand :

You asked me to try to return a value at the end of OnDragnDropBegin event ?, like this :

Code (autolisp) Select

(defun c:OnDragnDropBegin_exmple ( / )
  (if (@do_my_test)
    1
    0
    )
  )


But in this case, i'm not able to tell you if move,copy or both are allowed .

I must know the droppoint node before ,wich is know at OnDragnDropFromControl Event .

I'm afraid to go round around the trouble ...

I staying beleve that the bestest way could be to do not delete the selected node whatever action was done , and let programmer to delete node as he want depending of action asked by the user.

But for this, i still need to know action asked by the user in DragnDropFromControl Event.

So,
Could it be possible to you to do not delete the selected node ?
Could it be possible to send return the asked action in DragnDropFromControl Event ?

If yes to both, that mean the trouble could be solved.

Thanks again.
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

owenwengerd

It would be easy to include the desired action as an argument in the call to the DragnDropFromControl event, but this would break existing code.  Furthermore, this still would not solve the problem of changing the allowed actions depending on the drop point, because changing the allowed actions must be done *before* the drop, not after.
Owen Wengerd (Outside The Box) / ManuSoft

stephan_35

Quote from: owenwengerd on December 09, 2009, 02:19:03 PM
It would be easy to include the desired action as an argument in the call to the DragnDropFromControl event, but this would break existing code.  Furthermore, this still would not solve the problem of changing the allowed actions depending on the drop point, because changing the allowed actions must be done *before* the drop, not after.

I'm agree with you, but, i'm trying to find an issue ....

Actually, move action, delete the selected node, so no way to come back.
But,if you change this, and if we know the action asked by the user after the action was done, i think i could be easyer to delete or copy what we want by program , isn't it ?

Another way to explore, could it be possible to return action asked by user in DrognDrapBegin Event ?
This would also break existing code ....

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

owenwengerd

Quote from: stephan_35 on December 09, 2009, 02:33:32 PM
Actually, move action, delete the selected node, so no way to come back.
But,if you change this, and if we know the action asked by the user after the action was done, i think i could be easyer to delete or copy what we want by program , isn't it ?

You already can (by returning 1 from OnDragnDrpBegin) prevent the move action so that it always operates as a copy from OpenDCL's perspective. Perhaps it would be enough to do that, then use your own code to decide whether to delete the original based on e.g. whether the [Shift] key is pressed.

Quote from: stephan_35 on December 09, 2009, 02:33:32 PM
Another way to explore, could it be possible to return action asked by user in DrognDrapBegin Event ?

The user has not expressed any preference at the point where OnDragnDropBegin fires, so this would not be possible.
Owen Wengerd (Outside The Box) / ManuSoft

stephan_35

Quote from: owenwengerd on December 09, 2009, 02:44:07 PM
The user has not expressed any preference at the point where OnDragnDropBegin fires, so this would not be possible.

Ok.

Quote from: owenwengerd on December 09, 2009, 02:44:07 PM
You already can (by returning 1 from OnDragnDrpBegin) prevent the move action so that it always operates as a copy from OpenDCL's perspective. Perhaps it would be enough to do that, then use your own code to decide whether to delete the original based on e.g. whether the [Shift] key is pressed.

I tried these value :
0 > no action is possible.
1 > Only copy is possible.
2 > Only move is possible.
3 > Copy or Move are possible.
4 > Strange action , link ?
5 >  not assigned ?

Is it possible by returning 5 , to enable copy and move, but with no delete the selected node ?

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