Problem of event passing!

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
olvierwpz
Just popping in
Just popping in
Posts: 8
Joined: Wed Mar 09, 2005 07:06

Problem of event passing!

Postby olvierwpz » Fri Oct 28, 2005 11:12

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!

User avatar
martignasse
Just can't stay away
Just can't stay away
Posts: 227
Joined: Thu Apr 14, 2005 08:10
Location: Lyon, FRANCE

Re: Problem of event passing!

Postby martignasse » Fri Oct 28, 2005 15:55

...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

User avatar
olvierwpz
Just popping in
Just popping in
Posts: 8
Joined: Wed Mar 09, 2005 07:06

Re: Problem of event passing!

Postby olvierwpz » Sat Oct 29, 2005 00:17

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.

User avatar
martignasse
Just can't stay away
Just can't stay away
Posts: 227
Joined: Thu Apr 14, 2005 08:10
Location: Lyon, FRANCE

Re: Problem of event passing!

Postby martignasse » Sat Oct 29, 2005 09:20

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 ?

User avatar
olvierwpz
Just popping in
Just popping in
Posts: 8
Joined: Wed Mar 09, 2005 07:06

Re: Problem of event passing!

Postby olvierwpz » Mon Oct 31, 2005 02:48

Sorry for my poor description.
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!

User avatar
martignasse
Just can't stay away
Just can't stay away
Posts: 227
Joined: Thu Apr 14, 2005 08:10
Location: Lyon, FRANCE

Re: Problem of event passing!

Postby martignasse » Tue Nov 01, 2005 12:58

Sorry for my poor description.
Thank you for your eager reply.
no problems, helping you is helping me...to learn CEGUI :cool:

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.
ok, so :

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 :oops:
i'm afraid that you'll have to found a workaround.

User avatar
Viper
Just popping in
Just popping in
Posts: 16
Joined: Mon Aug 29, 2005 01:27
Location: US
Contact:

Re: Problem of event passing!

Postby Viper » Thu Dec 08, 2005 03:25

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.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 1 guest