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~
[Solved] Fire event from a hidden window
Moderators: CEGUI MVP, CEGUI Team
-
- Just popping in
- Posts: 19
- Joined: Tue Jun 10, 2014 11:20
-
- Just popping in
- Posts: 19
- Joined: Tue Jun 10, 2014 11:20
Re: Send event to wnd
Well, i guess i have to use subclass to break the onmouseclick encapsulation.
Re: Send event to wnd
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?
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"
-
- Just popping in
- Posts: 19
- Joined: Tue Jun 10, 2014 11:20
Re: Send event to wnd
Yes, thanks, it solved my problem. Hidden wnd can also fire event.
I'm a fool, i tried to fireEvent on parent window and hope the click event to propergate to child yesterday.....
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.....
Re: [Solved] Fire event from a hidden window
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"
Who is online
Users browsing this forum: No registered users and 26 guests