0

Is it possible to override the default "dropSites" when drag-dropping into RV?

Hi,

I'm new to RV development and could use some help figuring this one out.

I'm trying to handle drops in my custom mode by making my custom "drop regions" to replace the standard ones ("Add souce to session" and "Add as Layer").

The problem I'm facing is that, if I implement this in the render method of my Mode, it seems to be called on top of the default rvui render method, so I get my drop regions drawn on top of the standard ones.

Not knowing a better way to get around this, I've tried the brute force method of making a copy of the entire rvui.render and modifying it to draw my own drop regions instead.

Then I bind this to the global render event whenever my mode is active, and bind the original rvui.render again when my method is inactive.

This works, but seems very hacky... 

Is there a better way to do this? Any way I can bypass the drawing of drop sites in rvui.render without overriding the whole thing? 

Thanks in advance,

Ivan

1 条评论

  • 0
    Avatar
    Jon Morley

    Hi Ivan,

    Can you please share the package you have written? If you have bound methods in your package to the same drag and drop events that rvui uses, then yours should get called first. If you do not reject the events then only yours should used. Here are the events that rvui is using (though I suspect you already know this if you have been in there to modify the file):

        bindRegex("default", "global", "dragdrop--.*enter", dragEnter);
        bindRegex("default", "global", "dragdrop--.*move", dragShow);
        bindRegex("default", "global", "dragdrop--.*leave", dragLeave);
        bindRegex("default", "global", "dragdrop--.*release", dragRelease);

    You can unbind those but that also seems hacky. Please share your package with us and we can see what is going on. Feel free to do so in a private ticket.

    Thanks,
    Jon

请先登录再写评论。