MSG_DRAGANDDROP
-
On 18/02/2013 at 00:36, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 13
Platform: Windows ;
Language(s) : C++ ;---------
Hello,how can I control in the object manager, if an objectdata can drag and drop under a other object? I need the control if it's possible or forbitten to move under a other object type.
regards
Marky -
On 18/02/2013 at 05:51, xxxxxxxx wrote:
mhh, I believe nobody has an idea.
At the moment, I receive the MSG_DRAGANDDROP message in the target object and know also the type of the drag object. Now I'm searching for a possibility to set a flag, that this object can't be dropped on my first object.
Is there anywhere a flag where I can set ? Or is in the DragAndDrop structure a property which Cinema4D used ?
Marky
-
On 18/02/2013 at 06:26, xxxxxxxx wrote:
Originally posted by xxxxxxxx
At the moment, I receive the MSG_DRAGANDDROP message in the target object and know also the type of the drag object. Now I'm searching for a possibility to set a flag, that this object can't be dropped on my first object.
Is there anywhere a flag where I can set ? Or is in the DragAndDrop structure a property which Cinema4D used ?
Yes, you can set DragAndDrop::flag to DRAGANDDROP_FLAG_FORBID to prevent the drop.
-
On 18/02/2013 at 06:43, xxxxxxxx wrote:
perfect... thanks a lot
-
On 19/02/2013 at 04:40, xxxxxxxx wrote:
Does somebody knows who the structure looks like in the basecontainer*msg of the DragAndDrop structure?
I have to set also the FORBID flag for some tags. But I don't get the information about the target object.
-
On 19/02/2013 at 05:59, xxxxxxxx wrote:
Originally posted by xxxxxxxx
Does somebody knows who the structure looks like in the basecontainer*msg of the DragAndDrop structure?
Just like any GUI message container.
Originally posted by xxxxxxxx
I have to set also the FORBID flag for some tags. But I don't get the information about the target object.
What do you mean by 'target object'?
-
On 19/02/2013 at 06:19, xxxxxxxx wrote:
oh target is the destination object
I need more control about a tag plugin, on which object I can assign it or move it by drag and drop from one object (e.g. sphere) to another object (e.g. cube). I like to forbit it to move my tag plugin to this object type. How can I do this ? -
On 20/02/2013 at 05:48, xxxxxxxx wrote:
Originally posted by xxxxxxxx
oh target is the destination object
I need more control about a tag plugin, on which object I can assign it or move it by drag and drop from one object (e.g. sphere) to another object (e.g. cube). I like to forbit it to move my tag plugin to this object type. How can I do this ?Thanks for the explanation, I understand it better now ;).
To get the object or tag you're on you can get the BaseList2D you're hovering while mouse dragging with this code:
case MSG_DRAGANDDROP: { DragAndDrop *dd = (DragAndDrop* )data; if (dd) { BaseList2D *bl = NULL; if (dd->flags & DRAGANDDROP_FLAG_SOURCE && dd->data!=NULL) { C4DAtom *atom = (C4DAtom* )dd->data; if (atom != NULL) { bl = (BaseList2D * )atom; GePrint(bl->GetName()); } } } } break;
This code will print to the console the name of the tag or object you're over with the mouse.
If you're hovering an object (IsInstanceOf()) you can simply convert it to a BaseObject*. And if it's a tag, convert it to a BaseTag then get the object it's attached to with BaseTag::GetObject(). -
On 20/02/2013 at 06:25, xxxxxxxx wrote:
ok, it's working if the mouse move over some objects or tags. But I have also the case, that I put an tag and move with the mouse on the right side of the object tree (right beside the column with the visible in editor and renderer points). The moving of tags works, but here I don't get an information about the destination object.
-
On 21/02/2013 at 03:30, xxxxxxxx wrote:
Originally posted by xxxxxxxx
ok, it's working if the mouse move over some objects or tags. But I have also the case, that I put an tag and move with the mouse on the right side of the object tree (right beside the column with the visible in editor and renderer points). The moving of tags works, but here I don't get an information about the destination object.
This may be a limitation of the drag&drop system in the object manager. I asked the developers if there's another way to get the target object.