[Solved] Fire event from a hidden window

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

fatmouse1984
Just popping in
Just popping in
Posts: 19
Joined: Tue Jun 10, 2014 11:20

[Solved] Fire event from a hidden window

Postby fatmouse1984 » Sat Nov 22, 2014 13:31

Hi everyone!

I have a button which is hidden.
I want to trigger mouse click event of the button.
I can not click ( also don't want to) a invisible button, is it possible to trigger ths button's on mouse click event?
I guess it must somehow like message in windows, just don't know where to send the message~ :?

fatmouse1984
Just popping in
Just popping in
Posts: 19
Joined: Tue Jun 10, 2014 11:20

Re: Send event to wnd

Postby fatmouse1984 » Sun Nov 23, 2014 06:21

Well, i guess i have to use subclass to break the onmouseclick encapsulation. :(

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Send event to wnd

Postby Ident » Sun Nov 23, 2014 11:54

You should be able to use fireEvent() http://static.cegui.org.uk/docs/0.7/cla ... 7983faee8e
You will need to create an instance of an appropriate Event Arg class for that (correct Event subclass). (See here for reference: http://cegui.org.uk/wiki/Event_reference )

I am not sure if hidden windows can fire events. If they can't, then just unhide, fireEvent, and hide again.

Did this solve the issue?
CrazyEddie: "I don't like GUIs"

fatmouse1984
Just popping in
Just popping in
Posts: 19
Joined: Tue Jun 10, 2014 11:20

Re: Send event to wnd

Postby fatmouse1984 » Sun Nov 23, 2014 13:05

:D Yes, thanks, it solved my problem. Hidden wnd can also fire event.

Code: Select all

getColourRect()->fireEvent(Window::EventMouseClick, WindowEventArgs(getColourRect()));


I'm a fool, i tried to fireEvent on parent window and hope the click event to propergate to child yesterday.....

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: [Solved] Fire event from a hidden window

Postby Ident » Sun Nov 23, 2014 13:16

Good that we could solve this so easily. I changed the topic name to something more precise, hope thats ok.
CrazyEddie: "I don't like GUIs"


Return to “Help”

Who is online

Users browsing this forum: No registered users and 26 guests