Page 1 of 1

Window event problem

Posted: Thu Feb 07, 2008 16:04
by ianstangoe
Hi All,

I have a problem with the setMousePassThroughEnabled() function when I'm trying to disable all mouse events on a StaticText widget.

It works fine for passing through the mouseover (mouseEnter/mouseLeave) events but when I try to click on the underlying PushButton widget, the event isn't propagated through.

What I have at the moment is a PushButton widget with a Static Text widget overlayed on top and to the right of the button. I setMousePassThroughEnabled(true), on the StaticText widget and that allows the mouseHover event to work fine, however when I try to click in the area covered by the StaticText widget but also over the button, nothing happens, my EventClicked callback isn't triggered :?

I've tried also setting a callback on the StaticText widget for a mouseButtonUp event with no success, is this a bug?

Any solutions greatfully received.

Thanks.

Posted: Fri Feb 08, 2008 14:48
by CrazyEddie
Hi,

Sorry to hear about your problems - nothing springs to mind, and I've not had time to investigate. Unless someone else can offer a solution, I'll try and see what I can come up with tomorrow.

So, I'm mainly replying now to let you know that somebody has actually read your message :)

Posted: Fri Feb 08, 2008 19:22
by Rackle
I'm not sufficiently familiar with events to trace the functions called but I have found the following. CEGUIWindow.h/cpp contain the fonction getTargetChildAtPosition() which makes use of isMousePassThroughEnabled(). However this code only works for a hierarchy of children. If your StaticText a child of Pushbutton or is it simply "on top" of it? It's an idea, although I find it strange that it would work while hovering but not when clicking.

A workaround would be for the StaticText to subscribe to a mouse click event which would simply feed it back to the pushbutton's click event.

Posted: Fri Feb 08, 2008 20:12
by ianstangoe
Hi,

Thanks for the replies, the StaticText widget is a child of the Pushbutton widget so is this a potential problem or should that work ok?

I'll try picking up the mouseclicked event and pass it to my main handling function.

Thanks.

Posted: Fri Feb 08, 2008 20:15
by Rackle
From the code I saw this is the way it should be, the StaticText as a child of the Pushbutton.

Posted: Sat Feb 09, 2008 20:51
by CrazyEddie
Hi,

Turns out this was actually a bug, see http://www.cegui.org.uk/mantis/view.php?id=154 for someone else reporting the same issue.

As mentioned on Mantis, this is fixed in svn trunk r1531.

CE.

Posted: Mon Feb 11, 2008 10:00
by ianstangoe
Ah ha,

was just about to post that I tried subscribing to another window event but that didn't work either, I shall download me that SVN trunk now...

Thanks for your help!

Cheers,

Ian.

[edit] Woohoo!! succes, thanks guys :)