groupComponents dont trigger mouseEnter


#1

mouseEnter on my main UI component triggers for all components except groupComponents.
Anyone else encountered this?

For my UI’s I have a heriarchy like:
PluginEditor > MainUI > sliders & components

in the contstructor for MainUI I include::
addMouseListener(this, true);

Finally I’ve overridden void mouseEnter(const MouseEvent& event) override;

With a big long bunch of ifs containing if (event.eventComponent == <component ptr>) ...e.g.update the help text

for those lines where the component ptr is a groupComponent, the if doesn’t trigger.

Cheers for any pointers,
Dave


#2

IIRC group components don’t intercept the mouse, so won’t respond to any mouse events. See Component::getInterceptsMouseClicks


#3

Much appreciated Julian.

I’ve added a <groupComponent>->setInterceptsMouseClicks(true, true); and it works.

I’ve also found that using:
(groupComponent->isMouseOver(true)
is more efficient than
(event.eventComponent == <groupComponent ptr>)

Cheers,
Dave