Wires drawing suggestion [REASON][HOBNOX]


#1

Hi everybody,

is anyone has suggestions how making such graphical representation with Juce ?
(I think of wires, and the fact that paint management assumes all is rectangular)


#2

You have to draw it yourself. The rectangle is just the largest region that you can paint in, but as long as your rectangle includes the two points you want your wire to go from (plus any fancy cable swag :wink: you just draw the ‘wire’.

The two obvious approaches are to create a component for each connection, that covers the whole equipment area and draw each one, or to use the either a foreground component that draws all the cable, or use the major component that holds or draws the equipment images and use it’s ‘draw on top’ function to paint the connections.

It’s not bad at all, once you understand that each gear/component can’t draw it’s own connections.

Bruce


#3

have a look at juce’s audio plugin host which does exactly that with one component per wire and overriding the hitTest() method.


#4

Muchas gracias !


#5

Asair, do you want the wires to “wobble” when you go over them with the mouse? Or do you want them to be just “fixed”?


#6

…them to be fixed.

I dont need to create a dynamic imitation, just static one.


#7

I got it.

Thanks