Make a childComponent transparent to Mouse Clicks


#1

how is this possible, to allow parent component intercepts mouse clicks ?

i set my ParentComponent "setInterceptsMouseClick(true,true)"
but the hitTest/contains/reallyContains methods only work when I click directly on the ParentComponent background.

thanks


#2

it was becaus eof such troubles that i was first looking for an openGl solution.

Im developping many windows in a main big window.

by clicking onto daughter windows since the main mother window instance, i d like to activate daughter window callback
(for example : flip(), randomizeChlidren(), …)
and above all function will let me attach many daughter windows alltogether since anchor button on these windows.


#3

is passing a getParent->MouseDown(e) in the daughter window MouseUp function is realistic ?


#4

i managed to pass mouseEvent to parent.
But i get strange e.x, e.y,
as if the getRelativeTo did not work.


#5

use Component::addMouseListener for your needs


#6

Really ?

It does not seem to be suffisant…
A chlid component always mask the parent one.


#7

I think the way you are using setInterceptsMouseClicks is wrong (atleast if you are using it on the parent, as stated above, this will not work).

You have to do this: childComponent->setInterceptsMouseClicks(false,false);
That’s how I did it and it worked for me.

Or perhaps also try parentComponent->setInterceptsMouseClicks(true,false); ,but I’m not sure if that one will work.


#8

Not possible cause I need my chlid to intercepts some clicks too.

The way getEventToRelative… is the good way.