I want to create a MyRoot
object under an object that is not allowed to be dragged by the user (like the Root
under the CA
object), I set DRAGANDDROP_FLAG_FORBID
to the flag
in the DragAndDrop
struct of MSG_DRAGANDDROP
, but I can still drag it out of the parent.
This is the code in Message()
.
Bool MyRoot::Message(GeListNode* node, Int32 type, void* data) {
if (type == MSG_DRAGANDDROP)
{
DragAndDrop* dnd = static_cast<DragAndDrop*>(data);
if (dnd == nullptr)
return false;
if (dnd->flags & DRAGANDDROP_FLAG_SOURCE)
dnd->flags |= DRAGANDDROP_FLAG_FORBID;
}
return true;
}