Generalized subscriber routines...

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

User avatar
Derek
Quite a regular
Quite a regular
Posts: 70
Joined: Wed Jan 12, 2005 12:06

Generalized subscriber routines...

Postby Derek » Fri Jan 14, 2005 05:37

instead of something like (as in one of the demos):

Code: Select all

bool handleRadio(const CEGUI::EventArgs& e)


can we get something like:

Code: Select all

bool handleRadioItems(Window *pWnd, const CEGUI::EventArgs& e)


This would allow one to do some type of general event. It is pretty much given that the user will be obtaining the window pointer some way or another anyway for an event... so wouldn't it be easier than having to call WindowManager::getSingleton().getWindow(..)? This would also remove the necessity of looking up the window by a specific name via the getWindow proc, thus leaving out all layout-specific stuff.

-Derek

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

Generalized subscriber routines...

Postby CrazyEddie » Fri Jan 14, 2005 11:16

This is basically the same, or very similar, to the global events system that me and 'gcarlton' were discussing. A patch for this has been submitted and I'm hoping to get this looked at and put in to the system over the coming weekend.

With regards to the Window pointer, you can get this out of the EventArgs argument. For most window events you can cast the EventArgs to a WindowEventArgs, this struct has a 'window' field that (usually) contains the Window that generated the event (exceptions are noted in the docs).

CE.

User avatar
fog
Just popping in
Just popping in
Posts: 12
Joined: Wed Jan 12, 2005 12:06
Location: Torino, ITALY
Contact:

Generalized subscriber routines...

Postby fog » Fri Jan 14, 2005 17:17

With regards to the Window pointer, you can get this out of the EventArgs argument. For most window events you can cast the EventArgs to a WindowEventArgs, this struct has a 'window' field that (usually) contains the Window that generated the event (exceptions are noted in the docs).


It would be really helpfull to have the docs tell to what EventArgs subclass an event object can be casted for every event type. I.e., ClickEvent handlers receive a XXXEvent, etc.

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

Generalized subscriber routines...

Postby CrazyEddie » Sat Jan 15, 2005 13:50

fog wrote:
It would be really helpfull to have the docs tell to what EventArgs subclass an event object can be casted for every event type. I.e., ClickEvent handlers receive a XXXEvent, etc.


Yeah, I have these things mentioned in the on<whatever> handlers, I'll make a note to update the docs for the Event names to include this information; as this is probably the part of the docs that people look at with regards to events.

CE


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 5 guests