I’m trying to implement my audio plugin so that it accepts files to be dropped on it anywhere in the window, regardless of other widgets.
I tried to use FileDragAndDropTarget, and while I can get it to work on its own, problems arise when I try to add other widgets underneath it.
I created a class that inherits from both Component and FileDragAndDropTarget. The paint method will draw a translucent fill over the whole window (that’s why I want this component on top), and I also call setBounds() on it from the AudioProcessorEditor that contains it.
(Later I will replace this target with a couple of smaller ones that cover different sections of the GUI)
I would like it to listen to all the drag events, i e isInterestedInFileDrag, fileDragEnter, fileDragExit and filesDropped.
But I want it to ignore all other mouse events, so that they are passed through to the other components underneath.
I tried setting InterceptsMouseClicks to false, but then it would start ignoring the file dragging events too, and if it’s set to true, then the Components underneath stop responding, of course.
Is there any neat and simple way to make this work?