[6.0.0.13] OnDragnDropFromControl Event not called

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

Previous topic - Next topic

stephan_35

Hello Fred,

If I understood everything, your explanation merges mine on some points:
It must be able to authorize or prohibit the movement and / or copy certain nodes.
The most complicated will find the programming method for allowing this kind of action during the course of the program.

From my side of the operation DragNDrop and its control is very annoying, because I use almost five events to make sure the current action, hand over certain other related actions DragNDrop (to autocad) requires that any This can operate in asynchronous mode.

I am very open to a final solution that can satisfy everyone, even to change my existing code!

I hope that the language problem will not be a barrier for me!   ;D
(Pending google translate is my friend)

All these operations require more explanation, I think, before Owen began to change code or anything, but how?


Here's what I found through my  DragNDrop use:


1 - Very difficult to locate the selected node before the movement operation .
2 - Is it possible to establish a precise order of events triggered during movement operations .
3 - In its current operation, the move action is  performed, regardless of our agreement, would it be possible simply to do nothing and create an action "ConfirmActionDragnDrop" to execute the requested action.
4 - and in the same vein, create another event independent of what exists, we return all the information necessary as a result of our programming (AskDragnDropAction FromNode (List parent, child) ActionType (Move, Copy) NodeFinal (list parent, child))?

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

The pieces are now in place to eventually have much more control over drag and drop operatins, but that will be disruptive and require major changes on the API side. For now, I need to find a way to satsify Fred's requirement while also making it possible to both move and copy, and to do so without changing any API or adding any new properties. So, I need to know what existing conditions/events/properties can be used to distinguish when move should be allowed and when it should not.
Owen Wengerd (Outside The Box) / ManuSoft

stephan_35

Hi Owen,

Unfortunately, I do not think the answer is simple, I'll take a concrete example:
Creating a treeview representing the tree of a disk drive.
We have directories and files, and travel conditions may be limited in one case the movement of files in directories, but directories in other directories.
Following is the developer to set its own rules.
Mine prohibit moving a directory in a file, and prohibit the movement of a file in a file, I authorize a copy of a file in a directory, but I forbid copying a file in a file.
Things are complicated by the file extension.

That is why I return to my proposal first solution that would initially create a bit allowing the displacement function and / or copy of a general on the treeview.
For example:
AllowDragnDropMove True / false
AllowDragnDropCopy True / False


I also understand that the modication of the API may affect the existing operation, but want to write conditions for copying and moving nodes in hard could stifle the development of applications related to the use of OpenDCL...

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

Fred Tomke

Hello,

in ObjectDCL there was no automatical move or copy method. It was introduced in OpenDCL 5 the first time and I asked Owen to change back because all of our code would break and the OpenDCL internal tree control would be unusable for us. So he changed it that way that the automatical move or copy method works if no drag and drop event is activated.

My desire is very easy: no automatic move or copy method. As it was in ObjectDCL or in OpenDCL 5. As I already mentioned I have no problem with an addition property for drag & drop style. But it would break the current consistency.

Quote from: stephan_35 on November 24, 2009, 05:05:23 AM
I use almost five events to make sure the current action, hand over certain other related actions DragNDrop (to autocad) requires that any This can operate in asynchronous mode.

I must say that I have no problem to activate and to define many events to make drag and drop happen. But there's actually one thing which is improvable: At OnDragBegin I try to find out the dragged item. If I do not select the item (that I want to drag) before dragging it I have no chance to get the dragged item. In the product documentation I force the user to select the item at first (to let the event OnClicked or OnSelChanged release) and then he can start drag and drop operation.

Don't be angry with me!  ;)

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

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

stephan_35

Hi Fred.

First point: No, I'm not angry! (Just afraid)

QuoteMy desire is very easy: no automatic move or copy method.

Right, i think this could be too hard to define.

QuoteI have no problem with an addition property for drag & drop style.

Me too !  ;D

QuoteBut it would break the current consistency.

If there no choice, why not ???

QuoteI force the user to select the item at first (to let the event OnClicked or OnSelChanged release) and then he can start drag and drop operation.

Have a look to my second screenshot, that was also my trouble, and i cannot stand to force the user to select first the item to move ! this look like beginner  ;D

So, to get it right, i use OnSelChanged event, wich will give you the real seleted node  ::)
But another trouble will appear, so you have to store it ....
Don't use OnDragnDropBegin, but OnDragnDropFromControl, wich will give you more information about what to what action... This is why i really need it   ;)

As you can see, we have meet the same trouble .

You need to know selected node ? (This is what i need)
You need to know wich action (move or copy), or you need to define the action authorized ?(This is what i need)
I need to know from wich control the node was dropped , another tree .
I need to use asynchronous mode because of drop to autocad drawing, trouble with no asynchronous .

I hope that owen could find an issue for all these feathure  :-[

Thanks
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 Fred,

I just have a question for you :

Do you use Treeview with opendcl control, or do you use activeX ?

I didn't yet try activeX, i ask myself if we can customise activeX treeview as we can do with opendcl control ?

Thanks for help.

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

I 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.
Owen Wengerd (Outside The Box) / ManuSoft

stephan_35

Quote from: owenwengerd on November 25, 2009, 07:10:10 AM
I 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.
Hello Owen,
I'll try to answer :
To decide if move is allowed, i must know first wich item was selected "From node".
we can do this with OnSelChanged, wich must be alive and called before OnDragnDropBegin
Is it right ?
Then, i didn't really understand what you mean by "return value from the evant handler" ! return True ou False ?
Then, how would you get to allow or unallow move ?
Then, i think that we must know wich action was begin, move or copy ? and then with the selected "to" node we can confirm,(or set), move allowed or move unallowed.

Another way:
Wich is the selected node.
Wich action is required (copy or move ?)
Wich is the destination node ?
Allow or not allow move .
End of dragndrop


Need to be confirmed by fred .
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

The bestest way (as i see it) should be able to set "allow/unallow copy" and "allow/unallow move" during action of DragnDrop !

And this according to the destination node, with changing icon (the best of the best !)  ;D

But, i remember you said me too much modification inside api. (that i completely understand).  :'(

Thanks Owen.

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

Adding properties is not practical because it would require a property for every possible action. Eventually I want the events to mirror the internal drag/drop system whereby the OnDragOver event returns an appropriate effect depending on what is beneath the cursor. For now, returning a value (not necessarily a boolean -- I'm inclined to use an integer that matches the built in values) is a way to give you control without requiring any change to the documented API or to old code.
Owen Wengerd (Outside The Box) / ManuSoft

stephan_35

Quote from: owenwengerd on November 25, 2009, 09:17:44 AM
Adding properties is not practical because it would require a property for every possible action. Eventually I want the events to mirror the internal drag/drop system whereby the OnDragOver event returns an appropriate effect depending on what is beneath the cursor. For now, returning a value (not necessarily a boolean -- I'm inclined to use an integer that matches the built in values) is a way to give you control without requiring any change to the documented API or to old code.
Hello Owen,

If i correctly understood every things, you mean that it is possible to get with new OnDragOver event what is under the cursor ?
If right, we should have to take control is selected node could be deleted ! (move)
And then , we should have to take control of the mouse icon ...  ;D
All these, depending of first selected node, and during Dragndrop action ? i'm afraid than it's not possible !

Otherwise, i cannot really see what OnDragOver event can bring us .... i need more explain.

Thanks for your job.
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

The way that drag and drop works is that first, OnDragBegin returns an opaque "data" object along with an integer that controls what "effects" are supported on the data. For example, a value of 1 means that the data can be copied; a value of 2 means the data can be moved; a value of 3 means the data can be copied or moved. OnDragOver is then called every time the mouse moves, and its return value determines which "effect" is active. The cursor is chosen based on the active effect, and there is no way to control that via lisp in any case.

To reiterate, I need to know how I can make the code work for both you and Fred without breaking old code. If I change the code to check for an integer returned from OnDragnDropBegin, then use that integer as the "supported effects" value, will that allow both your code and Fred's code to work? If I undo the Alpha 14 change, this means Fred's code would need to return 1 to enable only the copy effect.
Owen Wengerd (Outside The Box) / ManuSoft

Fred Tomke

Quote from: stephan_35 on November 25, 2009, 12:26:52 AM
Do you use Treeview with opendcl control, or do you use activeX ?

Hi,
I've never used ActiveX tree control. There was no need 'cause the internal tree control did everything we need.
Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

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

stephan_35

Quote from: Fred Tomke on November 25, 2009, 11:55:36 AM
I've never used ActiveX tree control. There was no need 'cause the internal tree control did everything we need.

Thanks for reply !

I asked this because i saw some feature about changing mouse icone and SingelSel option.

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

Quote from: owenwengerd on November 25, 2009, 11:12:54 AM
The way that drag and drop works is that first, OnDragBegin returns an opaque "data" object along with an integer that controls what "effects" are supported on the data. For example, a value of 1 means that the data can be copied; a value of 2 means the data can be moved; a value of 3 means the data can be copied or moved. OnDragOver is then called every time the mouse moves, and its return value determines which "effect" is active. The cursor is chosen based on the active effect, and there is no way to control that via lisp in any case.

To reiterate, I need to know how I can make the code work for both you and Fred without breaking old code. If I change the code to check for an integer returned from OnDragnDropBegin, then use that integer as the "supported effects" value, will that allow both your code and Fred's code to work? If I undo the Alpha 14 change, this means Fred's code would need to return 1 to enable only the copy effect.

Owen, oh oh , I missed something ?
With Alpha 14, i didn't saw OnDragnDropBegin return value ! ether not any OnDragOver Event ?

I have to spend more time on this alpha version before answer you, or before asking you anything else !
Could you confirm me about  OnDragnDropBegin an OnDragOver event ?

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