|
virtual | ~CGUIBehaviourDecorator () |
|
virtual CGUIBehaviourDecorator * | Clone () const |
|
virtual eC_Bool | IsCompositeBehaviour () const |
|
virtual eC_Bool | DoScale (const eC_Value &vDelta) |
|
virtual eC_Bool | DoUserEvent (CGUIEvent *const pEvent) |
|
virtual void | OnCreate () |
|
virtual void | OnDataPool (const DataPoolResource_t &eID) |
|
virtual void | OnDelete () |
|
virtual void | OnHide () |
|
virtual void | OnShow () |
|
virtual eC_Bool | DoClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
|
virtual eC_Bool | DoLongClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
|
virtual eC_Bool | DoDoubleClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
|
virtual eC_Bool | DoButtonDown (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
|
virtual eC_Bool | DoButtonUp (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
|
virtual eC_Bool | DoDrag (const eC_Value &vDeltaX=eC_FromInt(-1), const eC_Value &vDeltaY=eC_FromInt(-1), const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
|
virtual eC_Bool | DoDragEnd (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
|
virtual eC_Bool | DoMouseEnter (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
|
virtual eC_Bool | DoMouseLeave (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
|
virtual eC_Bool | DoMouseMove (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
|
virtual eC_Bool | FocusPrevious (CGUIObject *const pRefObj=NULL, const eC_Bool &bSubTreeOfRefObjDone=false) |
|
virtual eC_Bool | FocusNext (CGUIObject *const pRefObj=NULL, const eC_Bool &bSubTreeOfRefObjDone=false) |
|
virtual void | GetFocus () |
|
virtual void | LoseFocus () |
|
virtual eC_Bool | Decrease () |
|
virtual eC_Bool | Increase () |
|
virtual eC_Bool | DoKeyDown (const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers) |
|
virtual eC_Bool | DoKeyUp (const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers) |
|
virtual eC_Bool | DoChar (const eC_UInt &uiKey, const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers) |
|
virtual eC_Bool | DoScroll (const eC_Value &vAbsX, const eC_Value &vAbsY, const eC_Value &vDelta, const eC_Bool &bModifierActive) |
|
const eC_String & | GetXMLTag () const |
|
virtual void | ReadFromStream () |
|
void | SetXMLTag (const eC_String &kXMLTag) |
|
virtual void | WriteToStream (const eC_Bool bWriteClassID=false) |
|
GUIBehaviourDecorator base class.
Behavioural decorators enable the developer to implement standard object behaviours which are not integral part of a specific control, but can in fact be appended to any CGUIObject. A behaviour's event handling slots are always called before those of its corresponding CGUIObject. You can thus override the object's reaction to a given event without having the need to derive a whole new class for this task. As always, a method's return value indicates whether the corresponding object's event-handling method will still be called (=false) or the event was already completed and no further treatment is required (=true).
The following example shows a simple behaviour decorator which prints out a debug message whenever the GUIObject to which it is attached is being clicked. Note that the DoClick()-implementation returns false, which means that the click will still be forwarded to the corresponding GUIObject afterwards.
You can even attach such a behaviour-decorator to objects which do otherwise not implement any standard behaviour. For instance, you could attach the example behaviour to a CGUIImage-object, let it receive events by calling pPointerToImageObject->SetDisabled(false), and the behaviour will print out a debug-message upon every click on the corresponding GUIImage:
class CExampleBehaviour
{
public:
eC_Bool
DoClick(
const eC_Value& vAbsX,
const eC_Value& vAbsY)
{
GUILOG(GUI_TRACE_DEBUG, "some incredibly impressive clicking behaviour \n");
return false;
}
};
GUIBehaviourDecorator base class.
Definition: GUIBehaviourDecorator.h:78
virtual eC_Bool DoClick(const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
The following line shows how to attach a BehaviourDecorator to an object:
pPointerToObject->SetBehaviour(new CExampleBehaviour());
Ownership
Note that there is always a one-on-one relationship between a CGUIBehaviourDecorator and its associated CGUIObject OR its parent CGUICompositeBehaviour. That means if you first attach your behaviour to an object within the GUI, and then add it as a child-object to a composite-behaviour, it will be removed from the CGUIObject.
Note also that a behaviour will automatically delete itself if nobody (i.e. neither any CGUIObject, nor any CGUICompositeBehaviour) is still using it!
The following code demonstrates the ownership philosophy
delete pkObject;
This is the Guiliani base class all controls are derived from.
Definition: GUIObject.h:81
void SetBehaviour(CGUIBehaviourDecorator *pkBehaviour)
Execute a command when a specific event occurs.
Definition: GUISingleCmdBehaviour.h:21