Page 1 of 1

Generalized subscriber routines...

Posted: Fri Jan 14, 2005 05:37
by Derek
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

Generalized subscriber routines...

Posted: Fri Jan 14, 2005 11:16
by CrazyEddie
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.

Generalized subscriber routines...

Posted: Fri Jan 14, 2005 17:17
by fog
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.

Generalized subscriber routines...

Posted: Sat Jan 15, 2005 13:50
by CrazyEddie
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