The cegui event seems do not fire for one time.
I put two button in the same postion but different layer.
The first button fire the event first .
If set the button hidden or removed in it`s event dealing function,the second button`s event dealing function will be fired.
So when I change from one state to another by button clicked.If there is a button with the same postion in the second state.It will be fired.This is exactly what I met.
Is there any setting function to make the event be fired for only one time.
Thanks!
Problem of event passing!
Moderators: CEGUI MVP, CEGUI Team
- martignasse
- Just can't stay away
- Posts: 227
- Joined: Thu Apr 14, 2005 08:10
- Location: Lyon, FRANCE
Re: Problem of event passing!
...So when I change from one state to another by button clicked...
maybe you just make you'r layers visible or not to manage you'r states, if it's the case, try to desactivate them, it should prevent event firing.
hope it help
Re: Problem of event passing!
But if the button is the return button of a framewindow or state. Then it`s job is to call the state manager to change state .Hid or remove current state is must to be done.
- martignasse
- Just can't stay away
- Posts: 227
- Joined: Thu Apr 14, 2005 08:10
- Location: Lyon, FRANCE
Re: Problem of event passing!
maybe i misanderstand something,
you have two layers superposed, and they represents to differents stat of you'r app. And you want only one to be visible and active at a time. is it correct ?
you have two layers superposed, and they represents to differents stat of you'r app. And you want only one to be visible and active at a time. is it correct ?
Re: Problem of event passing!
Sorry for my poor description.
Thank you for your eager reply.
You have got the point of my problem.
When I click the back button of the first state,It fires the event to change state.But the back button in the same position of the second state get the click event too. Then it`s event fired without exception.
Thanks again!
Thank you for your eager reply.
You have got the point of my problem.
you have two layers superposed, and they represents to differents stat of you'r app. And you want only one to be visible and active at a time. is it correct ?
When I click the back button of the first state,It fires the event to change state.But the back button in the same position of the second state get the click event too. Then it`s event fired without exception.
Thanks again!
- martignasse
- Just can't stay away
- Posts: 227
- Joined: Thu Apr 14, 2005 08:10
- Location: Lyon, FRANCE
Re: Problem of event passing!
no problems, helping you is helping me...to learn CEGUISorry for my poor description.
Thank you for your eager reply.
ok, so :When I click the back button of the first state,It fires the event to change state.But the back button in the same position of the second state get the click event too. Then it`s event fired without exception.
you have you'r app with these two superposed layer. but only one have te be active at a time, depend on the state, say the first for now. so the second should be hidden and deactivated.
when you click on the first back button, only this one should fire event (cause the second layer is hidden and deactivated.) ok.
and in responding to this event, you have to :
-make the first layer hidden and deactivated.
-make the second layer visible and activated.
and at this point, the system will find this new activated back button of the second layer and fire a second event
So, you have to tell the system to not continu the event distribution after you handle fonction.
I believe Event::ScopedConnection is made for that but not sure of the way to use it... or if it's completly implemented now.
can't help more for now...CEGUI expert needed
i'm afraid that you'll have to found a workaround.
Re: Problem of event passing!
olivierwpz,
If you haven't yet found a solution to your problem, then i would try unsubscribing to the event for the button that you do not want to get activated. Then, when you handle the event, unsubscribe the current button and subscribe the other.
Hope this helps.
If you haven't yet found a solution to your problem, then i would try unsubscribing to the event for the button that you do not want to get activated. Then, when you handle the event, unsubscribe the current button and subscribe the other.
Hope this helps.
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 2 guests