Overlay a component without interrupting mouse events


Hello! I am trying to implement the ability to add patch cables from component to component. The GUI might look something like Arturia’s Moog Modular. However, I have just realized that overlaying a component (holding the cable graphics) will interrupt mouse events on the knobs and plugs of the underlying components. Are there any tricks around this, or any ways to pass mouse events to the component behind it? (This post seems to say no for that.)


You can have a transparent component that doesn’t eat mouse events, yes. You have to then pass mouse events from components below - maybe making a component for each connection point and use that data to draw the patch.

Take a look at how Jules does it. I think the Audio Demo in JuceDemo, or one of the audio graph extras has a patch system.



Great news!

“Transparent component” is the term I needed. With it I found this thread ( http://www.rawmaterialsoftware.com/viewtopic.php?f=2&t=6322 ), and the solution works perfectly. I was fearing that would be a much more difficult problem to solve, but I had simply overlooked the setInterceptsMouseClicks() function. Thank you!