Crazy Eddie's GUI System  0.8.4
CEGUI::GUIContext Class Reference
+ Inheritance diagram for CEGUI::GUIContext:
+ Collaboration diagram for CEGUI::GUIContext:

List of all members.

Public Member Functions

 GUIContext (RenderTarget &target)
WindowgetRootWindow () const
void setRootWindow (Window *new_root)
void setModalWindow (Window *window)
 Internal function to directly set the current modal window.
WindowgetModalWindow () const
 Return a pointer to the Window that is currently set as modal.
WindowgetWindowContainingMouse () const
const SizefgetSurfaceSize () const
const SystemKeysgetSystemKeys () const
void markAsDirty ()
 call to indicate that some redrawing is required.
bool isDirty () const
MouseCursorgetMouseCursor ()
 Retrieves MouseCursor used in this GUIContext.
const MouseCursorgetMouseCursor () const
void setMouseMoveScalingFactor (float factor)
float getMouseMoveScalingFactor () const
void setMouseButtonClickTimeout (float seconds)
float getMouseButtonClickTimeout () const
void setMouseButtonMultiClickTimeout (float seconds)
float getMouseButtonMultiClickTimeout () const
void setMouseButtonMultiClickTolerance (const Sizef &sz)
const SizefgetMouseButtonMultiClickTolerance () const
void setMouseClickEventGenerationEnabled (const bool enable)
 Set whether automatic mouse button click and multi-click (i.e. double-click and treble-click) event generation will occur.
bool isMouseClickEventGenerationEnabled () const
 Return whether automatic mouse button click and multi-click (i.e. double-click and treble-click) event generation is enabled.
void updateWindowContainingMouse ()
 Tell the context to reconsider which window it thinks the mouse is in.
WindowgetInputCaptureWindow () const
void setInputCaptureWindow (Window *window)
void setDefaultTooltipObject (Tooltip *tooltip)
 Set the default Tooltip object for this GUIContext. This value may be 0 to indicate that no default Tooltip object will be available.
void setDefaultTooltipType (const String &tooltip_type)
 Set the default Tooltip to be used by specifying a Window type.
TooltipgetDefaultTooltipObject () const
 Returns a pointer to the context's default tooltip object. May return 0.
void setRenderTarget (RenderTarget &target)
void setDefaultFont (const String &name)
 Set the default font to be used by the GUIContext.
void setDefaultFont (Font *font)
 Set the default font to be used by the GUIContext.
FontgetDefaultFont () const
 Return a pointer to the default Font for the GUIContext.
bool injectMouseMove (float delta_x, float delta_y)
 Function that injects a mouse movement event into the receiver.
bool injectMouseLeaves (void)
 Function that notifies that the mouse has left the host area that the receiver receives input for.
bool injectMouseButtonDown (MouseButton button)
 Function that injects a mouse button down event into the receiver.
bool injectMouseButtonUp (MouseButton button)
 Function that injects a mouse button up event into the receiver.
bool injectKeyDown (Key::Scan scan_code)
 Function that injects a key down event into the receiver.
bool injectKeyUp (Key::Scan scan_code)
 Function that injects a key up event into the receiver.
bool injectChar (String::value_type code_point)
 Function that injects a typed character event into the receiver.
bool injectMouseWheelChange (float delta)
 Function that injects a mouse-wheel / scroll-wheel event into the receiver.
bool injectMousePosition (float x_pos, float y_pos)
 Function that injects a new position for the mouse cursor.
bool injectTimePulse (float timeElapsed)
 Function to inject time pulses into the receiver.
bool injectMouseButtonClick (const MouseButton button)
 Function to directly inject a mouse button click event.
bool injectMouseButtonDoubleClick (const MouseButton button)
 Function to directly inject a mouse button double-click event.
bool injectMouseButtonTripleClick (const MouseButton button)
 Function to directly inject a mouse button triple-click event.
bool injectCopyRequest ()
 Tells the receiver to perform a clipboard copy operation.
bool injectCutRequest ()
 Tells the system to perform a clipboard cut operation.
bool injectPasteRequest ()
 Tells the system to perform a clipboard paste operation.
void draw ()
 Draw the GeometryBuffers for all rendering queues to the RenderTarget that this RenderingSurface is targetting.

Static Public Attributes

static const float DefaultMouseButtonClickTimeout
static const float DefaultMouseButtonMultiClickTimeout
static const Sizef DefaultMouseButtonMultiClickTolerance
static const String EventRootWindowChanged
static const String EventMouseMoveScalingFactorChanged
static const String EventMouseButtonClickTimeoutChanged
static const String EventMouseButtonMultiClickTimeoutChanged
static const String EventMouseButtonMultiClickToleranceChanged
static const String EventRenderTargetChanged
static const String EventDefaultFontChanged

Protected Member Functions

void updateRootWindowAreaRects () const
void drawWindowContentToTarget ()
void renderWindowHierarchyToSurfaces ()
void createDefaultTooltipWindowInstance () const
void destroyDefaultTooltipWindowInstance ()
void notifyDefaultFontChanged (Window *hierarchy_root) const
 notify windows in a hierarchy using default font, when font changes.
bool mouseMoveInjection_impl (MouseEventArgs &ma)
WindowgetTargetWindow (const Vector2f &pt, const bool allow_disabled) const
WindowgetKeyboardTargetWindow () const
WindowgetCommonAncestor (Window *w1, Window *w2) const
void notifyMouseTransition (Window *top, Window *bottom, void(Window::*func)(MouseEventArgs &), MouseEventArgs &args) const
 call some function for a chain of windows: (top, bottom]
bool areaChangedHandler (const EventArgs &args)
bool windowDestroyedHandler (const EventArgs &args)
bool updateWindowContainingMouse_impl () const
 returns whether the window containing the mouse had changed.
void resetWindowContainingMouse ()
virtual void onRootWindowChanged (WindowEventArgs &args)
virtual void onMouseMoveScalingFactorChanged (GUIContextEventArgs &args)
virtual void onMouseButtonClickTimeoutChanged (GUIContextEventArgs &args)
virtual void onMouseButtonMultiClickTimeoutChanged (GUIContextEventArgs &args)
virtual void onMouseButtonMultiClickToleranceChanged (GUIContextEventArgs &args)
virtual void onRenderTargetChanged (GUIContextRenderTargetEventArgs &args)
virtual void onDefaultFontChanged (EventArgs &args)
void drawContent ()

Protected Attributes

Windowd_rootWindow
bool d_isDirty
MouseCursor d_mouseCursor
float d_mouseMovementScalingFactor
 Scaling factor applied to injected mouse move deltas.
bool d_generateMouseClickEvents
 should mouse click/multi-click events be automatically generated.
float d_mouseButtonClickTimeout
 Timeout used to when detecting a single-click.
float d_mouseButtonMultiClickTimeout
 Timeout used when detecting multi-click events.
Sizef d_mouseButtonMultiClickTolerance
 Movement tolerance used when detecting multi-click events.
Tooltipd_defaultTooltipObject
bool d_weCreatedTooltipObject
String d_defaultTooltipType
Fontd_defaultFont
Sizef d_surfaceSize
 a cache of the target surface size, allows returning by ref.
Windowd_windowContainingMouse
bool d_windowContainingMouseIsUpToDate
Windowd_modalWindow
Windowd_captureWindow
SystemKeys d_systemKeys
MouseClickTracker * d_mouseClickTrackers
Event::ScopedConnection d_areaChangedEventConnection
Event::ScopedConnection d_windowDestroyedEventConnection

Member Function Documentation

void CEGUI::GUIContext::draw ( ) [virtual]

Draw the GeometryBuffers for all rendering queues to the RenderTarget that this RenderingSurface is targetting.

The GeometryBuffers remain in the rendering queues after the draw operation is complete. This allows the next draw operation to occur without needing to requeue all the GeometryBuffers (if for instance the sequence of buffers to be drawn remains unchanged).

Reimplemented from CEGUI::RenderingSurface.

void CEGUI::GUIContext::drawContent ( ) [protected, virtual]

draw the surface content. Default impl draws the render queues. NB: Called between RenderTarget activate and deactivate calls.

Reimplemented from CEGUI::RenderingSurface.

Return a pointer to the default Font for the GUIContext.

Returns:
Pointer to a Font object that is the default for this GUIContext.

Retrieves MouseCursor used in this GUIContext.

Note:
Please note that each GUIContext has exactly one MouseCursor. The MouseCursor class holds position, as well as other properties. If you want to modify the MouseCursor (for example change its default image), you can retrieve a reference via this method and call a method on the reference (in our example that's setDefaultImage).
bool CEGUI::GUIContext::injectChar ( String::value_type  code_point) [virtual]

Function that injects a typed character event into the receiver.

Parameters:
code_pointUnicode or ASCII (depends on used String class) code point of the character that was typed.
Returns:
  • true if the input was processed by the receiver.
  • false if the input was not processed by the receiver.

Implements CEGUI::InjectedInputReceiver.

Tells the receiver to perform a clipboard copy operation.

Returns:
  • true if the copy was successful
  • false if the copy was denied

Implements CEGUI::InjectedInputReceiver.

Tells the system to perform a clipboard cut operation.

Returns:
  • true if the cut was successful
  • false if the cut was denied

Implements CEGUI::InjectedInputReceiver.

bool CEGUI::GUIContext::injectKeyDown ( Key::Scan  scan_code) [virtual]

Function that injects a key down event into the receiver.

Parameters:
key_codeuint value indicating which key was pressed.
Returns:
  • true if the input was processed by the receiver.
  • false if the input was not processed by the receiver.

Implements CEGUI::InjectedInputReceiver.

bool CEGUI::GUIContext::injectKeyUp ( Key::Scan  scan_code) [virtual]

Function that injects a key up event into the receiver.

Parameters:
key_codeKey::Scan value indicating which key was released.
Returns:
  • true if the input was processed by the receiver.
  • false if the input was not processed by the receiver.

Implements CEGUI::InjectedInputReceiver.

bool CEGUI::GUIContext::injectMouseButtonClick ( const MouseButton  button) [virtual]

Function to directly inject a mouse button click event.

Here 'click' means a mouse button down event followed by a mouse button up event.

Note:
Under normal, default settings, this event is automatically generated by the system from the regular up and down events you inject. You may use this function directly, though you'll probably want to disable the automatic click event generation first by using the setMouseClickEventGenerationEnabled function - this setting controls the auto-generation of events and also determines the default 'handled' state of the injected click events according to the rules used for mouse up/down events.
Parameters:
buttonOne of the MouseButton enumerated values.
Returns:
  • true if some window or handler reported that it handled the event.
  • false if nobody handled the event.

Implements CEGUI::InjectedInputReceiver.

Function to directly inject a mouse button double-click event.

Here 'double-click' means a single mouse button had the sequence down, up, down within a predefined period of time.

Note:
Under normal, default settings, this event is automatically generated by the system from the regular up and down events you inject. You may use this function directly, though you'll probably want to disable the automatic click event generation first by using the setMouseClickEventGenerationEnabled function - this setting controls the auto-generation of events and also determines the default 'handled' state of the injected click events according to the rules used for mouse up/down events.
Parameters:
buttonOne of the MouseButton enumerated values.
Returns:
  • true if some window or handler reported that it handled the event.
  • false if nobody handled the event.

Implements CEGUI::InjectedInputReceiver.

Function that injects a mouse button down event into the receiver.

Parameters:
buttonOne of the MouseButton values indicating which button was pressed.
Returns:
  • true if the input was processed by the receiver.
  • false if the input was not processed by the receiver.

Implements CEGUI::InjectedInputReceiver.

Referenced by CEGUI::IrrlichtEventPusher::OnMouse().

Function to directly inject a mouse button triple-click event.

Here 'triple-click' means a single mouse button had the sequence down, up, down, up, down within a predefined period of time.

Note:
Under normal, default settings, this event is automatically generated by the system from the regular up and down events you inject. You may use this function directly, though you'll probably want to disable the automatic click event generation first by using the setMouseClickEventGenerationEnabled function - this setting controls the auto-generation of events and also determines the default 'handled' state of the injected click events according to the rules used for mouse up/down events.
Parameters:
buttonOne of the MouseButton enumerated values.
Returns:
  • true if some window or handler reported that it handled the event.
  • false if nobody handled the event.

Implements CEGUI::InjectedInputReceiver.

Function that injects a mouse button up event into the receiver.

Parameters:
buttonOne of the MouseButton values indicating which button was released.
Returns:
  • true if the input was processed by the receiver.
  • false if the input was not processed by the receiver.

Implements CEGUI::InjectedInputReceiver.

Referenced by CEGUI::IrrlichtEventPusher::OnMouse().

bool CEGUI::GUIContext::injectMouseLeaves ( void  ) [virtual]

Function that notifies that the mouse has left the host area that the receiver receives input for.

Returns:
  • true if the event was handled.
  • false if the event was not handled.

Implements CEGUI::InjectedInputReceiver.

bool CEGUI::GUIContext::injectMouseMove ( float  delta_x,
float  delta_y 
) [virtual]

Function that injects a mouse movement event into the receiver.

Parameters:
delta_xamount the mouse moved on the x axis.
delta_yamount the mouse moved on the y axis.
Returns:
  • true if the input was processed by the input receiver.
  • false if the input was not processed by the input receiver.

Implements CEGUI::InjectedInputReceiver.

bool CEGUI::GUIContext::injectMousePosition ( float  x_pos,
float  y_pos 
) [virtual]

Function that injects a new position for the mouse cursor.

Parameters:
x_posNew absolute pixel position of the mouse cursor on the x axis.
y_posNew absolute pixel position of the mouse cursoe in the y axis.
Returns:
  • true if the generated mouse move event was handled.
  • false if the generated mouse move event was not handled.

Implements CEGUI::InjectedInputReceiver.

Referenced by CEGUI::IrrlichtEventPusher::OnMouse().

bool CEGUI::GUIContext::injectMouseWheelChange ( float  delta) [virtual]

Function that injects a mouse-wheel / scroll-wheel event into the receiver.

Parameters:
deltafloat value representing the amount the wheel moved.
Returns:
  • true if the input was processed by the receiver.
  • false if the input was not processed by the receiver.

Implements CEGUI::InjectedInputReceiver.

Referenced by CEGUI::IrrlichtEventPusher::OnMouse().

Tells the system to perform a clipboard paste operation.

Returns:
  • true if the paste was successful
  • false if the paste was denied

Implements CEGUI::InjectedInputReceiver.

bool CEGUI::GUIContext::injectTimePulse ( float  timeElapsed) [virtual]

Function to inject time pulses into the receiver.

Parameters:
timeElapsedfloat value indicating the amount of time passed, in seconds, since the last time this method was called.
Returns:
Currently, this method always returns true.

Implements CEGUI::InjectedInputReceiver.

Return whether automatic mouse button click and multi-click (i.e. double-click and treble-click) event generation is enabled.

Returns:
  • true if mouse button click and multi-click events will be automatically generated by the system from the basic button up and down event injections.
  • false if no automatic generation of events will occur. In this instance the user may wish to use the additional event injectors to manually inform the system of such events.
void CEGUI::GUIContext::setDefaultFont ( const String name)

Set the default font to be used by the GUIContext.

Parameters:
nameString object containing the name of the font to be used as the default for this GUIContext

Set the default font to be used by the GUIContext.

Parameters:
fontPointer to the font to be used as the default for this GUIContext.

Set the default Tooltip object for this GUIContext. This value may be 0 to indicate that no default Tooltip object will be available.

Parameters:
tooltipPointer to a valid Tooltip based object which should be used as the default tooltip for the GUIContext, or 0 to indicate that no default Tooltip is required.
Note:
When passing a pointer to a Tooltip object, ownership of the Tooltip does not pass to the GUIContext.
void CEGUI::GUIContext::setDefaultTooltipType ( const String tooltip_type)

Set the default Tooltip to be used by specifying a Window type.

The GUIContext will internally attempt to create an instance of the specified window type (which must be derived from the base Tooltip class). If the Tooltip creation fails, the error is logged and no default Tooltip will be available on the GUIContext.

Parameters:
tooltipTypeString holding the name of a Tooltip based Window type.

Internal function to directly set the current modal window.

Note:
This function is called internally by Window, and should not be called by client code. Doing so will likely not give the expected results.

Set whether automatic mouse button click and multi-click (i.e. double-click and treble-click) event generation will occur.

Parameters:
enable
  • true to have mouse button click and multi-click events automatically generated by the system from the basic button up and down event injections.
  • false if no automatic generation of events should occur. In this instance the user may wish to use the additional event injectors to manually inform the system of such events.

Member Data Documentation

Event fired when the default font changes. Handlers are passed a const reference to a generic EventArgs struct.

Name of Event fired when the mouse click timeout is changed. Handlers are passed a const reference to a GUIContextEventArgs struct.

Name of Event fired when the mouse multi-click timeout is changed. Handlers are passed a const reference to a GUIContextEventArgs struct.

Name of Event fired when the mouse multi-click movement tolerance area size is changed. Handlers are passed a const reference to a GUIContextEventArgs struct.

Name of Event fired when the mouse movement scaling factor is changed. Handlers are passed a const reference to a GUIContextEventArgs struct.

Name of Event fired when the RenderTarget for the GUIContext is changed. Handlers are passed a const GUIContextRenderTargetEventArgs struct, with the renderTarget member set to the old RenderTarget.

Name of Event fired when the root window is changed to a different Window. Handlers are passed a const WindowEventArgs reference with WindowEventArgs::window set to the old root window (the new one is obtained by calling GUIContext::getRootWindow).

 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends