Hasty Badger
Small UI library (a branch of Turbo Badger)
|
TBWidgetListener listens to some callbacks from TBWidget. More...
#include <tb_widgets_listener.h>
Public Member Functions | |
virtual void | OnWidgetDelete (TBWidget *) |
Called when widget is being deleted (in its destructor, so virtual functions are already gone). More... | |
virtual bool | OnWidgetDying (TBWidget *) |
This is called when the widget request to be deleted. More... | |
virtual void | OnWidgetAdded (TBWidget *, TBWidget *) |
Called when the child has been added to parent, after its parents OnChildAdded. More... | |
virtual void | OnWidgetRemove (TBWidget *, TBWidget *) |
Called when the child is about to be removed from parent, after its parents OnChildRemove. More... | |
virtual void | OnWidgetFocusChanged (TBWidget *, bool) |
Called when widget focus has changed on a widget. More... | |
virtual bool | OnWidgetInvokeEvent (TBWidget *, const TBWidgetEvent &) |
Called when a event is about to be invoked on a widget. More... | |
Public Member Functions inherited from tb::TBLinkOf< TBWidgetListener > | |
TBWidgetListener * | GetPrev () const |
TBWidgetListener * | GetNext () const |
Public Member Functions inherited from tb::TBLink | |
bool | IsInList () const |
Return true if the link is currently added to a list. More... | |
Public Member Functions inherited from tb::TBLinkOf< TBWidgetListenerGlobalLink > | |
TBWidgetListenerGlobalLink * | GetPrev () const |
TBWidgetListenerGlobalLink * | GetNext () const |
Static Public Member Functions | |
static void | AddGlobalListener (TBWidgetListener *listener) |
Add a listener to all widgets. More... | |
static void | RemoveGlobalListener (TBWidgetListener *listener) |
Friends | |
class | TBWidget |
Additional Inherited Members | |
Public Attributes inherited from tb::TBLink | |
TBLink * | prev |
TBLink * | next |
TBLinkList * | linklist |
TBWidgetListener listens to some callbacks from TBWidget.
It may either listen to all widgets globally, or one specific widget.
Local listeners (added with TBWidget:AddListener) will be invoked before global listeners (added with TBWidgetListener::AddGlobalListener).
|
static |
Add a listener to all widgets.
Called when the child has been added to parent, after its parents OnChildAdded.
Local listeners are invoked on the parent widget.
|
inlinevirtual |
Called when widget is being deleted (in its destructor, so virtual functions are already gone).
|
inlinevirtual |
This is called when the widget request to be deleted.
Return true if you want the widget to not die immediately, f.ex. to fade it out before it is deleted. If you return true, it's up to you to finally remove it from its parent delete it.
Remember that the widget may still be deleted prematurely for many other reasons (f.ex if its parent is deleted or several listeners respond true and take on the task to delete it at some point). You can use TBWidgetSafePointer to safely handle that.
|
inlinevirtual |
Called when widget focus has changed on a widget.
|
inlinevirtual |
Called when a event is about to be invoked on a widget.
This make it possible to intercept events before they are handled, and block it (by returning true). Note, if returning true, other global listeners will still also be notified.
Called when the child is about to be removed from parent, after its parents OnChildRemove.
Local listeners are invoked on the parent widget.