Guiliani  Version 2.4 revision 5970 (build 3)
CGUIEventHandler Class Reference

This is the event handler. More...

#include <GUIEventHandler.h>

Public Member Functions

void AddModalDialogException (CGUICompositeObject *pkException)
 
eC_Bool ExecuteClickHandler (CGUIObject *pObject)
 
void FocusLost ()
 
const CGUIEventGetCurrentEvent () const
 
CGUICompositeObjectGetCurrentModalDialog () const
 
eC_Bool GetDisableEventHandling () const
 
eC_UInt GetDoubleClickTime () const
 
CGUIObjectGetDraggedObject () const
 
void GetDragStart (eC_Int &iDragStartX, eC_Int &iDragStartY)
 
eC_Int GetDragThreshold () const
 
CGUIObjectGetFocussedObject () const
 
CGUIObjectGetFormerlyFocussedObject () const
 
CGUIObjectGetFormerlyUnderMouseObject () const
 
CGUIObjectGetHighlightedObject () const
 
eC_UInt GetIdleTime ()
 
eC_UInt GetLastButtonDownTime ()
 
void GetLastMousePos (eC_UInt &uiMouseX, eC_UInt &uiMouseY) const
 
eC_UInt GetLongClickTime () const
 
CGUIObjectGetObjectUnderMousePointer () const
 
CGUIObjectGetPressedObject () const
 
eC_Bool IsObjModalDialog (CGUICompositeObject *const pObj) const
 
eC_Bool IsWithinModalDialogIfAny (const CGUIObject *pObj) const
 
eC_Bool MouseWasUsed () const
 
void ReleaseModalDialog (CGUICompositeObject *pModalDialog)
 
void RemoveModalDialogException (CGUICompositeObject *pkException)
 
void SetDisableEventHandling (eC_Bool bDisableEventHandling)
 
void SetDoubleClickTime (const eC_UInt uiDoubleClickTime)
 
void SetDragThreshold (const eC_Int iDragThreshold)
 
void SetHighlightingDisabled (const eC_Bool bDisabled)
 
void SetLegacyBehaviour (const eC_Bool bLegacyBehaviour)
 
void SetLongClickTime (const eC_UInt uiLongClickTime)
 
void SetModalDialog (CGUICompositeObject *pModalDialog)
 
void SetMouseWasUsed (eC_Bool bMouseUsed)
 
void SetScrollModifiers (eC_UInt uiScrollModifiers)
 

Static Public Member Functions

static CGUIEventHandlerGetInstance ()
 

Friends

class CGUI
 
class CGUIObject
 

Detailed Description

This is the event handler.

It handles keyboard and mouse events based on CGUIEvent in HandleEvent by calling the appropriate methods on GUI objects. It also manages the focus, keeps track of the currently highlighted and pressed objects and the current modal dialog.

To learn more about event handling, see Input event handling.

Member Function Documentation

◆ AddModalDialogException()

void CGUIEventHandler::AddModalDialogException ( CGUICompositeObject pkException)

Add a new exception for modal dialogs. this object can be used even when a modal dialog is shown use with caution!!

Parameters
pkExceptionobject for exception

◆ ExecuteClickHandler()

eC_Bool CGUIEventHandler::ExecuteClickHandler ( CGUIObject pObject)

Executes a click on a given object, iterates through whole event hierarchy

Parameters
pObjectObject to be clicked
Returns
true if executed

◆ FocusLost()

void CGUIEventHandler::FocusLost ( )

Informs the event handler that the focus is lost. This happens for instance automatically if the currently focused object changes to a state (such as grayed out, disabled or invisible) in which it must not remain focused.

◆ GetCurrentEvent()

const CGUIEvent * CGUIEventHandler::GetCurrentEvent ( ) const

Returns a pointer to the event that is currently being handled.

Use this method in an event handling slot to examine the current event in greater detail, for instance for checking keyboard modifier keys.

This method returns NULL if the event handler is not currently handling an event. This means that user code can only expect to receive a valid pointer from this method in any of the event handling slots declared in CGUIBehaviour.

Returns
pointer to the event that is currently being handled.

◆ GetCurrentModalDialog()

CGUICompositeObject * CGUIEventHandler::GetCurrentModalDialog ( ) const

Get the current modal dialog that is active.

Returns
current active modal dialog

◆ GetDisableEventHandling()

eC_Bool CGUIEventHandler::GetDisableEventHandling ( ) const

Returns whether user input currently is ignored.

Returns
True if user input currently is ignored, otherwise False.

◆ GetDoubleClickTime()

eC_UInt CGUIEventHandler::GetDoubleClickTime ( ) const

Returns the time in milliseconds during which a button has to be clicked twice to generate a double click event.

Returns
Time in milliseconds during which a double click event is generated.

◆ GetDraggedObject()

CGUIObject * CGUIEventHandler::GetDraggedObject ( ) const

Return the object which is currently being dragged

Returns
currently dragged object, if any

◆ GetDragStart()

void CGUIEventHandler::GetDragStart ( eC_Int &  iDragStartX,
eC_Int &  iDragStartY 
)

Returns the start coordinates of an ongoing drag operation. The returned values are valid only if there currently is a drag operation in progress. Do not use them after the concluding DoDragEnd() event.

Parameters
iDragStartXX Position in screen coordinates where the drag sequence started
iDragStartYY Position in screen coordinates where the drag sequence started

◆ GetDragThreshold()

eC_Int CGUIEventHandler::GetDragThreshold ( ) const

Returns the current drag threshold.

Returns
Threshold (in pixels) after which a drag event shall not be recognized as a "click" anymore.

◆ GetFocussedObject()

CGUIObject * CGUIEventHandler::GetFocussedObject ( ) const

Get object that is currently focused.

Returns
Pointer to the currently focused object.

◆ GetFormerlyFocussedObject()

CGUIObject * CGUIEventHandler::GetFormerlyFocussedObject ( ) const

Return the object which was formerly focused.

Returns
object which lost the focus
Note
This is only valid within GetFocus())

◆ GetFormerlyUnderMouseObject()

CGUIObject * CGUIEventHandler::GetFormerlyUnderMouseObject ( ) const

Return the object which formerly was under the mouse pointer.

Returns
object formerly under mouse-pointer
Note
This is only valid within DoMouseEnter()

◆ GetHighlightedObject()

CGUIObject * CGUIEventHandler::GetHighlightedObject ( ) const

Return the currently highlighted object (the one beneath the cursor)

Returns
currently highlighted object, if any

◆ GetIdleTime()

eC_UInt CGUIEventHandler::GetIdleTime ( )

Returns the maximum allowed idle time in milliseconds.

Returns
maximum allowed idle time in milliseconds

◆ GetInstance()

CGUIEventHandler & CGUIEventHandler::GetInstance ( )
static

return reference to event handler instance

Returns
instance

◆ GetLastButtonDownTime()

eC_UInt CGUIEventHandler::GetLastButtonDownTime ( )

Returns the timestamp of the last ButtonDown-Event.

Returns
Timestamp of the last ButtonDown-Event

◆ GetLastMousePos()

void CGUIEventHandler::GetLastMousePos ( eC_UInt &  uiMouseX,
eC_UInt &  uiMouseY 
) const

Returns the last known mouse position

Parameters
uiMouseXx-position
uiMouseYy-position

◆ GetLongClickTime()

eC_UInt CGUIEventHandler::GetLongClickTime ( ) const

Returns the time in milliseconds that a mouse button needs be held down until a long click event is generated.

Returns
Time in milliseconds during which a long click event is generated.

◆ GetObjectUnderMousePointer()

CGUIObject * CGUIEventHandler::GetObjectUnderMousePointer ( ) const

Return the object which is currently under the mouse pointer.

Returns
object currently under mouse-pointer

◆ GetPressedObject()

CGUIObject * CGUIEventHandler::GetPressedObject ( ) const

Return the object which is currently being pressed

Returns
currently pressed object, if any

◆ IsObjModalDialog()

eC_Bool CGUIEventHandler::IsObjModalDialog ( CGUICompositeObject *const  pObj) const

Check whether the object is a modal dialog or not.

Parameters
pObjObject to query
Returns
True if modal, False otherwise

◆ IsWithinModalDialogIfAny()

eC_Bool CGUIEventHandler::IsWithinModalDialogIfAny ( const CGUIObject pObj) const

Checks if the given object lies within the currently active modal dialog (if there is one).

Parameters
pObjPointer to object which shall be checked
Returns
True if there is no modal dialog or if the object lies within the modal dialog, False otherwise

◆ MouseWasUsed()

eC_Bool CGUIEventHandler::MouseWasUsed ( ) const

Indicates whether the last received Event was generated by a pointing device

Returns
true if mouse was used

◆ ReleaseModalDialog()

void CGUIEventHandler::ReleaseModalDialog ( CGUICompositeObject pModalDialog)

Release the given modal dialog (and thus remove it from the stack of modal dialogs) If there were other previous dialogs on the modal dialog stack, the most recent one will now become the active modal dialog again. In this case the framework will attemp to focus a child object of this newly actived modal dialog.

Parameters
pModalDialogPointer to the modal dialog object

◆ RemoveModalDialogException()

void CGUIEventHandler::RemoveModalDialogException ( CGUICompositeObject pkException)

Remove a previously added exception for modal dialogs

Parameters
pkExceptionobject to remove

◆ SetDisableEventHandling()

void CGUIEventHandler::SetDisableEventHandling ( eC_Bool  bDisableEventHandling)

Sets an attribute that controls whether user input ought to be ignored or not.

Parameters
bDisableEventHandlingtrue: Disable user input. else: Enable it.

◆ SetDoubleClickTime()

void CGUIEventHandler::SetDoubleClickTime ( const eC_UInt  uiDoubleClickTime)

Sets the time in milliseconds during which a button has to be clicked twice to generate a double click event.

Parameters
uiDoubleClickTimeTime in milliseconds in which a double click event is generated.

◆ SetDragThreshold()

void CGUIEventHandler::SetDragThreshold ( const eC_Int  iDragThreshold)

Set the threshold (in pixels) after which a drag event shall not be recognized as a "click" anymore. Especially for touch-screen devices, it is usually not desired that dragging an object also results in clicking it. This threshold defines the dragging distance after which releasing the finger will not call DoClick() anymore, but instead always result in a call to DoButtonUp().

Parameters
iDragThresholdThreshold (in pixels) after which a drag event shall not be recognized as a "click" anymore.
Deprecated:
Function call will not work anymore, use SetLongClickThresholdX, SetLongClickThresholdY, SetClickToleranceX, SetClickToleranceY instead.

◆ SetHighlightingDisabled()

void CGUIEventHandler::SetHighlightingDisabled ( const eC_Bool  bDisabled)

Disables highlighting of objects in reaction to "mouse-over" events. By default highlighting is enabled. It is advisable to disable highlighting on devices which do not require it.

Parameters
bDisabledTrue disables highlighting, False enables it.

◆ SetLegacyBehaviour()

void CGUIEventHandler::SetLegacyBehaviour ( const eC_Bool  bLegacyBehaviour)

Activate or De-Activate legacy behaviour to be backwards-compatible to older Guiliani-versions

Parameters
bLegacyBehaviourtrue if mode should be activated

◆ SetLongClickTime()

void CGUIEventHandler::SetLongClickTime ( const eC_UInt  uiLongClickTime)

Sets the time in milliseconds that a mouse button needs be held down until a long click event is generated.

Parameters
uiLongClickTimeTime in milliseconds until a long click event is generated.

◆ SetModalDialog()

void CGUIEventHandler::SetModalDialog ( CGUICompositeObject pModalDialog)

Make a specific dialog the active modal dialog. This also sets the focus into the dialog if there is at least one focusable object in this dialog. Modal dialogs can be stacked, and if the modal dialog is already in the list of modal dialogs, it will become the active modal dialog.

Parameters
pModalDialogPointer to the CompositeObject which will become the model dialog

◆ SetMouseWasUsed()

void CGUIEventHandler::SetMouseWasUsed ( eC_Bool  bMouseUsed)

Sets the MouseWasUsed flag

Parameters
bMouseUsed

◆ SetScrollModifiers()

void CGUIEventHandler::SetScrollModifiers ( eC_UInt  uiScrollModifiers)

Set the modifiers for mousewheel scrolling. When scroll events occur and these modifiers are pressed the DoScrollLeft() and DoScrollRight() slots are called instead of DoScrollUp() and DoScrollDown().

The default modifier is the SHIFT key.

Parameters
uiScrollModifiersThe modifiers bitfield.
See also
CGUIEvent::Modifier_t

Friends And Related Function Documentation

◆ CGUI

friend class CGUI
friend

◆ CGUIObject

friend class CGUIObject
friend

The documentation for this class was generated from the following files: