Window event problem

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

ianstangoe
Quite a regular
Quite a regular
Posts: 79
Joined: Wed Jan 09, 2008 11:06

Window event problem

Postby ianstangoe » Thu Feb 07, 2008 16:04

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.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Fri Feb 08, 2008 14:48

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 :)

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Fri Feb 08, 2008 19:22

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.

ianstangoe
Quite a regular
Quite a regular
Posts: 79
Joined: Wed Jan 09, 2008 11:06

Postby ianstangoe » Fri Feb 08, 2008 20:12

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.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Fri Feb 08, 2008 20:15

From the code I saw this is the way it should be, the StaticText as a child of the Pushbutton.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Sat Feb 09, 2008 20:51

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.

ianstangoe
Quite a regular
Quite a regular
Posts: 79
Joined: Wed Jan 09, 2008 11:06

Postby ianstangoe » Mon Feb 11, 2008 10:00

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 :)


Return to “Help”

Who is online

Users browsing this forum: Bing [Bot] and 18 guests