OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: stephan_35 on November 20, 2009, 03:08:48 AM

Title: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on November 20, 2009, 03:08:48 AM
Hello,

With 6.0.0.13 OnDragnDropFromControl is not called on event.

Thanks
Best regards
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: owenwengerd on November 20, 2009, 08:30:55 AM
I could not reproduce this. Can you attach a saimple example?
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on November 20, 2009, 08:41:07 AM
I needed to set keepFocus on it !
And all controls are set to asynchronous.

I saw the difference between 6.0.0.3 to 6.0.0.13, because my tools can't work as it should !

Too much trouble with this treeview !  ;)

Thanks for your job.
Best regards.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: Fred Tomke on November 20, 2009, 12:17:52 PM
Quote from: owenwengerd on November 20, 2009, 08:30:55 AM
I could not reproduce this. Can you attach a saimple example?

Hi Owen,

DragnDropFromControl returns a list instead of a key as string. If it should be a a 2D-point in future there should be a HitPointTest, too.

Fred

[EDIT] Added as bug report: https://sourceforge.net/tracker/?func=detail&aid=2901395&group_id=187950&atid=923363
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on November 20, 2009, 12:24:16 PM
Quote from: Fred Tomke on November 20, 2009, 12:17:52 PM
DragnDropFromControl returns a list instead of a key as string. If it should be a a 2D-point in future there should be a HitPointTest, too.

Hi Fred,

Do you have meet this trouble about DragnDropFromCrontrol event not called with 6.0.0.13 in treeview ?

Thanks
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: Fred Tomke on November 20, 2009, 12:37:49 PM
No, stephan, DragnDropFromCrontrol will be called in my forms. But I have other several problems with it.

Fred
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on November 20, 2009, 01:54:04 PM
To Owen.
If it can help you, i can try every runtime and tell you from wich one dragndropfromcontrol event disapear .
Best regards

Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: owenwengerd on November 22, 2009, 02:45:09 PM
Stephan, a simple example is most useful in this case. I will take a look at the files you attached.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: owenwengerd on November 22, 2009, 04:01:38 PM
Stephan, your test project seems to be working for me. Please test again in Alpha 14. It's possible that fixing the bug that Fred reported also affected your issue.
Title: The shift and control keys are not activated during the movement of a node
Post by: stephan_35 on November 23, 2009, 01:22:03 AM
Quote from: owenwengerd on November 22, 2009, 04:01:38 PM
Stephan, your test project seems to be working for me. Please test again in Alpha 14. It's possible that fixing the bug that Fred reported also affected your issue.

Hello Owen,

Yes, with version 6.0.0.14 Event DragnDropFromControl is called.

However a new incident occurs:
The shift and control keys are not activated during the movement of a node.

If you wish, you can send me corrections by email to validate the tests.

Thank you.

Best regards.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: owenwengerd on November 23, 2009, 08:09:28 AM
Stephan, the fix I made for Fred was to force the drag to be a 'copy' when the OnDragnDropBegin event handler is defined. I thought this is what both of you wanted.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on November 23, 2009, 09:42:32 AM
Quote from: owenwengerd on November 23, 2009, 08:09:28 AM
Stephan, the fix I made for Fred was to force the drag to be a 'copy' when the OnDragnDropBegin event handler is defined. I thought this is what both of you wanted.

good evening,

No, not at all, Instead I've never asked for this change!
it is sad to not be able to move nodes within a treeview.
This would condemn me to use only the version 6.0.0.3 which is functional.

What was annoying was that he did not master the difference between the two actions

This problem is solved as follows: I am testing on the selected node, so there is that the action is a copy, if it disappears, is that the action is shifting.

All this works through a combination of different events listed in the screenshot above.



Thank you

Best regards.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: owenwengerd on November 23, 2009, 09:57:53 AM
I can easily change it back. Hopefully Fred can describe his needs, or what has changed since earlier versions, so that I can come up with a solution that doesn't affect your code.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on November 23, 2009, 12:04:08 PM
Quote from: owenwengerd on November 23, 2009, 09:57:53 AM
I can easily change it back. Hopefully Fred can describe his needs, or what has changed since earlier versions, so that I can come up with a solution that doesn't affect your code.

Good evening,

I'm glad to hear that this choice is not final!

If I can help Fred by any means I am present, even if only to describe how I adopted.

From my side it must find a way to restart the Shift and Ctrl keys that determine the movement or copying of nodes, not least as an option, which would meet both our cases!

I return in detail the problems encountered to date with the movement of nodes:

Consider KeepFocus.
Determine the current action: Move or Copy?
The selected node before DragNDrop.
Rehabilitate the tree if the action requested by the user is not authorized, is a big problem with moving node. I can detail if you wish. But the best solution is, in my opinion, can intervene in the action during the overflight of nodes (Forbidden / Allowed / Copy / Move).
For the reconstruction of nodes (tree), I found an interim solution, pending which I do not like.

To conclude it all, I am not able to distribute a demonstration program, but I can make you a video that might be more meaningful than the long text?

Thank you for everything.
Best regards.
(hope that google translate all correctly )
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: Fred Tomke on November 24, 2009, 03:58:05 AM
Hello,

I need it as it was in earlier releases (5.x) and in ObjectDCL: I need full control of the tree when DragDrop begins and when DragDrop ends.
Until now it was defined that an item was automatically moved when the events are not activated. That is a really pragmatic solution. Owen told me that the Move-method is active if no Ctrl-key is pressed. If the user moves an item by holding Ctrl-key the item will be copied. This is consistent to Windows explorer.

What happens in my code if drag and drop is starting at tree? Most of my code changes databases (Access, MySQL and AcDbDictionaries and AcDbXrecords). Some nodes are not allowed to be moved. Some items are not to be allowed to be a dragdrop destinations. I have to control it by myself to make sure that only legal changes are made. It's the only way to work with Drag&Drop in trees for me.

An example:
There is a layertheme manager to take control of the drawing order. In the root there are all layer themes listed. Under the layer themes there are all layer groups listed and optional dwg-underlays (xref). The user can move all the layergroups of one layertheme within the layertheme as I want. But the user cannot

I see no problem if an additional property would be introduced for Drag&Drop control style. But there must be a chance to get full control to avoid unauthorized actions in a tree.
This is only one example. I could give much more.

Fred
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on November 24, 2009, 05:05:23 AM
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.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: owenwengerd on November 24, 2009, 07:41:45 AM
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.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on November 24, 2009, 08:27:50 AM
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.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: Fred Tomke on November 24, 2009, 12:41:02 PM
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
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on November 24, 2009, 01:37:57 PM
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
Title: Another question about Treeview
Post by: stephan_35 on November 25, 2009, 12:26:52 AM
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
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: 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.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on November 25, 2009, 07:29:24 AM
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
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on November 25, 2009, 07:37:17 AM
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.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: 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.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on November 25, 2009, 09:59:29 AM
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.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: 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.
Title: Re: Another question about Treeview
Post by: Fred Tomke on November 25, 2009, 11:55:36 AM
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
Title: Re: Another question about Treeview
Post by: stephan_35 on November 25, 2009, 12:00:50 PM
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
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on November 25, 2009, 12:10:11 PM
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.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: Fred Tomke on November 25, 2009, 12:27:26 PM
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
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: owenwengerd on November 25, 2009, 12:36:18 PM
Stephan, the OnDragOver event is not exposed to AutoLISP. I am talking about how drag and drop works in the underlying code.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: Fred Tomke on November 28, 2009, 11:36:29 AM
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 (http://www.opendcl.com/forum/index.php?topic=1035.msg5340#msg5340)).

Fred
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: owenwengerd on November 28, 2009, 01:36:36 PM
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.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: Fred Tomke on November 29, 2009, 12:20:14 AM
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
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: owenwengerd on November 29, 2009, 08:34:43 AM
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.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on December 09, 2009, 03:06:45 AM
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.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: owenwengerd on December 09, 2009, 12:16:35 PM
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.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on December 09, 2009, 12:41:44 PM
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
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: owenwengerd on December 09, 2009, 01:01:32 PM
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"?
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on December 09, 2009, 01:43:50 PM
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.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: 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.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on December 09, 2009, 02:33:32 PM
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
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: owenwengerd on December 09, 2009, 02:44:07 PM
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.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on December 09, 2009, 03:00:54 PM
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
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on December 09, 2009, 03:03:26 PM
Oops, Sorry, i didn't try the [Shift] key with keypressed Event.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on December 09, 2009, 03:11:56 PM
I tried KeyDown Event, but Failed !!!

Is there any dcl order to catch wich key was pressed [Shift] or [Ctrl] ???

Best regards
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: owenwengerd on December 09, 2009, 06:21:02 PM
Quote from: stephan_35 on December 09, 2009, 03:00:54 PM
Is it possible by returning 5 , to enable copy and move, but with no delete the selected node ?

The return value is a bit field, so 5 would not work. It would probably be possible to invent some value with special meaning, but it seems like a lot of work with a lot of potential for problems.

It doesn't seem logical to not delete the original object when the user believes they are moving it. This may be good enough in your specific case, but it's very bad programming in my opinion.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: Fred Tomke on December 09, 2009, 11:35:49 PM
Quote from: owenwengerd on December 09, 2009, 06:21:02 PM
It doesn't seem logical to not delete the original object when the user believes they are moving it. This may be good enough in your specific case, but it's very bad programming in my opinion.

Is it allowed to give an example?

I have a tree control with layerthemes. In each theme there is a layergroup with all containing layers which are not sorted into other layergroups yet (for drawing order) named "not sorted layers". It's like the layer 0 in each drawing. But the user can create own layergroups in each layertheme and move layers from one group into another within a single layertheme.

Since I see all the layerthemes in the tree, my boss asked me how to copy a layergroup from one layertheme to another. So we came to the conclusion:
- dragging a layergroup within a single layertheme means sorting the moved layergroup to an other position in the drawing order of the layertheme > move method
- dragging the layergroup from one layertheme to an other layertheme means to copy the layergroup with its properties and contained layers into the destination layertheme > copy method
- it is not allowed to copy the layergroup named "not sorted layers" between different layerthemes.

My problem is: to decide whether copy, move or allowing nothing is only possible in the OnDragnDropFromControl event and not yet in the OnDragBegin (because I still don't know, where the user will the picked item drop at).

Fred
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on December 09, 2009, 11:59:56 PM
Quote from: Fred Tomke on December 09, 2009, 11:35:49 PM
My problem is: to decide whether copy, move or allowing nothing is only possible in the OnDragnDropFromControl event and not yet in the OnDragBegin (because I still don't know, where the user will the picked item drop at).

Yes Fred, That is our both trouble !!!  ;D

Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on December 10, 2009, 12:15:11 AM
Deleting node on user action should be forbidden !!!

As soon we can check where the user drop node, we can take decision , yes or no , delete selected node .

And delete selected node before knowing if action was authorised doesn't seem logical , isn't it ?

Sorry to insist on this point, but it seems to be the center of our troubles.

Especially this is true for all actions DragnDropFromControl from controls wich it is authorised from ...

Thanks .

Best regards.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: owenwengerd on December 10, 2009, 08:14:13 AM
Fred, what you describe is exactly as I understand it. The user must be allowed to choose whether to copy or move depending on the response to OnDragnDropBegin, and the developer must be allowed to choose which action(s) are allowed based on the drop point as the user drags (not after it is dropped, as Fred suggests).

I understand the problem that Fred describes. I also know how to fix it by breaking existing code. My goal is to make sure that any solution resolves Stephan's need as well (which as I underestand is slightly different than Fred's).

I'm trying to find a solution that solves the problem without breaking existing code, but that may not be entirely possible. If not, I want to be sure to minimize any breaking changes.

At this point, I think the best way to go forward is for me to implement something, then see if it works for both of you.

Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: Fred Tomke on December 10, 2009, 08:51:06 AM
Quote from: owenwengerd on December 10, 2009, 08:14:13 AM
[...] I'm trying to find a solution that solves the problem without breaking existing code [...]
Owen, thanks for your efforts and your patience with us, but sometimes new goals cannot be reached without leaving the current position even if some are crying. And I'm sure that it is possible to adjust existing code for everyone who wants to earn the benefits of the new runtime. As you already know, I'd do anything to keep my code working. And I must honestly say, I'd like to play "God of my code" (and anywhere else, of course  ;D ), and the less OpenDCL will do at this point, the less I'd have to manage afterwards. But that is my personal view and so it does not mean anything speacial. But the practice will show that futurely.

Stephan, I'd say, let's wait for the next Build(s) or how long it will take Owen to change and let's create a tutorial for that which also we can follow futurely. This tutorial can be a base to test the new features as well as a sample for adjusting existing code.
Stephan, when I saw you last remembered that it is an Alpha release? I do only use the Alpha just for testing, not for production, and certainly not for deploying, so there's still much time for testing and tuning up the code. We all need the time. We should spend the time. That's my point of view.

Fred
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on December 10, 2009, 09:54:38 AM
Hello to everyone.

Of course I also thank Owen for all this dedication and all that time spent on developing OpenDCL.

To date, I assume full use made of my use of an alpha version in production, it complies fully with some of my requirements.
And to get there, sometimes with a little programming chivalrous. (not translation)

This will involve rewriting some lines of my code if that happens!

I believe in OpenDCL is a great tool!

Now, from my side, I lean on a test tool for future versions of OpenDCL, like a checklist, it will require some work on my side, but I'll be able to validate the next versions.

Best regards.
Thank you to everyone.
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: Fred Tomke on December 10, 2009, 10:12:56 AM
Stephan, I'd be glad to invite you for a small tutorial for a drag and drop sample. Not today, but soon.

Fred
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: owenwengerd on December 13, 2009, 05:22:53 PM
In Alpha 16, I've added a new OnDragOverFromControl event for you guys to test. (I haven't tested it, so be warned that it might not work!)
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: owenwengerd on December 13, 2009, 10:49:48 PM
BTW, Fred, the following DEU files need to be updated:
http://www.opendcl.com/HelpFiles/index.php?page=Reference/Event/DragOverFromControl.htm (http://www.opendcl.com/HelpFiles/index.php?page=Reference/Event/DragOverFromControl.htm)
http://www.opendcl.com/HelpFiles/index.php?page=Reference/Event/DragnDropBegin.htm (http://www.opendcl.com/HelpFiles/index.php?page=Reference/Event/DragnDropBegin.htm)
Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: Fred Tomke on December 14, 2009, 12:34:32 AM
Thanks, Owen, I will do it later this week.

Fred
Title: Error during installation
Post by: stephan_35 on December 15, 2009, 02:40:24 AM
Hello,

I've got this error message ....

I don't really know if it's come from my computer or from opendcl.

Thanks

Title: Re: [6.0.0.13] OnDragnDropFromControl Event not called
Post by: stephan_35 on December 15, 2009, 02:43:39 AM
Failed with :
OpenDCL.Studio.ENU.6.0.0.16

Work with :
OpenDCL.Studio.FRA.6.0.0.16

What is different between them ? (after language  ;D)

Best regards.
Title: [6.0.0.16] OnDragnDropOverFromControl
Post by: stephan_35 on December 15, 2009, 04:08:11 AM
Here is reults of my first try with this new event.

Depending of droppoint node.

Code (autolisp) Select

(defun c:Test_Form1_TREE_OnDragOverFromControl (ProjectName FormName ControlName DropPoint /)
 (cond
   (
    (= (substr DropPoint 1 3) "(0)")
     0
     )
   (
    (= (substr DropPoint 1 3) "(1)")
     1
     )
   (
    (= (substr DropPoint 1 3) "(2)")
     2
     )
   (
    (= (substr DropPoint 1 3) "(3)")
     3
     )
   (
    (= (substr DropPoint 1 3) "(4)")
     4
     )
   (
    (= (substr DropPoint 1 3) "(5)")
     Nil
     )
   )
)


Return 0 = None > True
Return 1 = Copy > True
Return 2 = Move > True
Return 3 = Missing in documentation > Move or copy, depending of [Ctrl] or [Shift] key
Return 4 = Link > False , Nothing appening, seem like None , missing link icon ?
Return Nil (5) = Default > True, depending of Ctrl or Shift KEY !

Anyway , this is a great job owen !!! Seem to work as expected , maybe just have to correct link icon ?

Now i have to try DragnDropBegin event ...

Best regards.
Thanks a lot !  ;)
Stéphan.
Title: [6.0.0.16] OnDragnDropBegin Event
Post by: stephan_35 on December 15, 2009, 05:46:55 AM
Here is my try with new OnDragnDropBegin Event

Here is my code :
Code (autolisp) Select

(defun c:Test_Form1_TREE_OnDragnDropBegin (/ DropPoint)
  (setq DropPoint (dcl_Tree_GetSelectedItem Test_Form1_TREE))
  (cond
    (
     (= (substr DropPoint 1 3) "(0)")
      0
      )
    (
     (= (substr DropPoint 1 3) "(1)")
      1
      )
    (
     (= (substr DropPoint 1 3) "(2)")
      2
      )
    (
     (= (substr DropPoint 1 3) "(3)")
      3
      )
    (
     (= (substr DropPoint 1 3) "(4)")
      4
      )
    (
     (= (substr DropPoint 1 3) "(5)")
      Nil
      )
    )
)


Return 0 = None > True !
Return 1 = Copy > True !
Return 2 = Move > True !
Return 3 = Missing in documentation > Move or Copy, depending of [Ctrl] or [Shift] Key
Return 4 = Link > True !
Return Nil (5) = Default > True !

Great job Owen, working fine, as expected , i ask myself, if we can use twice event together with return value ?
Best regards.
Title: Re: Error during installation
Post by: owenwengerd on December 15, 2009, 08:45:01 AM
Quote from: stephan_35 on December 15, 2009, 02:40:24 AM
I've got this error message ....
I don't really know if it's come from my computer or from opendcl.

The error indicates a corrupted MSI file. Clear your cache and try downloading again.