OpenGUI::Cursor Class Reference

#include <OpenGUI_Cursor.h>

Inheritance diagram for OpenGUI::Cursor:

OpenGUI::Object OpenGUI::GenericCursor List of all members.

Detailed Description

Base class for cursors.

All cursors need to derive from this base class. Cursors are drawn using the same onDraw event logic that Widgets utilize, so creating custom cursors should be a fairly simple task for anyone with experience creating custom widgets. The only major differences between drawing a Widget and drawing a Cursor is that the onDraw event is called each time the Screen is updated and is never cached, and the event arguments are of a different type (DrawCursor_EventArgs). The Brush that is given in the DrawCursor_EventArgs of onDraw() is always in the context of the Screen as a whole, so you need to apply your own Brush::pushPosition() as necessary.

Note:
Take notice that, while the input related events reuse the same EventArgs, cursors cannot consume events. So whether you eat() the event or not makes no difference.

When implementing your own cursors, you should take notice of the Size property that the Cursor base class exposes. This property represents the display size of the cursor for both the X and Y axis in Screen units. If the size is never specified by the application it will be the default size of (20.0x20.0f).

See also:
Cursor Events


Public Member Functions

const StringgetName () const
 return the name of this cursor, as set by the CursorManager at creation
const FVector2getSize () const
 returns the size of this cursor
void setSize (const FVector2 &newSize)
 sets the size of this cursor
virtual ObjectAccessorListgetAccessors ()
 returns this object's ObjectAccessorList head
virtual unsigned int getObjectType () const
 Returns an integer identifying the type of object.
Event Injectors
void eventDraw (float xPos, float yPos, Brush &brush)
 Draw this object's foreground using the given brush.
void eventCursorMove (float xPos, float yPos)
 Called for cursor movement, giving the X,Y position of the cursor.
void eventCursorPress (float xPos, float yPos)
 Called when the cursor button is pressed.
void eventCursorRelease (float xPos, float yPos)
 Called when the cursor button is released.
void eventCursorHidden ()
 Called when the cursor is hidden.
void eventCursorShown (float xPos, float yPos)
 Called when the cursor is shown.

Protected Member Functions

Event Handlers
virtual void onDraw (Object *sender, DrawCursor_EventArgs &evtArgs)
 "Draw" event
virtual void onCursorMove (Object *sender, Cursor_EventArgs &evtArgs)
 "CursorMove" event
virtual void onCursorPress (Object *sender, Cursor_EventArgs &evtArgs)
 "CursorPress" event
virtual void onCursorRelease (Object *sender, Cursor_EventArgs &evtArgs)
 "CursorRelease" event
virtual void onCursorHidden (Object *sender, EventArgs &evtArgs)
 "CursorHidden" event
virtual void onCursorShown (Object *sender, Cursor_EventArgs &evtArgs)
 "CursorShown" event


Member Function Documentation

void OpenGUI::Cursor::eventCursorHidden  ) 
 

Called when the cursor is hidden.

void OpenGUI::Cursor::eventCursorMove float  xPos,
float  yPos
 

Called for cursor movement, giving the X,Y position of the cursor.

void OpenGUI::Cursor::eventCursorPress float  xPos,
float  yPos
 

Called when the cursor button is pressed.

void OpenGUI::Cursor::eventCursorRelease float  xPos,
float  yPos
 

Called when the cursor button is released.

void OpenGUI::Cursor::eventCursorShown float  xPos,
float  yPos
 

Called when the cursor is shown.

void OpenGUI::Cursor::eventDraw float  xPos,
float  yPos,
Brush brush
 

Draw this object's foreground using the given brush.

ObjectAccessorList * OpenGUI::Cursor::getAccessors  )  [virtual]
 

returns this object's ObjectAccessorList head

Reimplemented from OpenGUI::Object.

Reimplemented in OpenGUI::GenericCursor.

const String& OpenGUI::Cursor::getName  )  const [inline]
 

return the name of this cursor, as set by the CursorManager at creation

unsigned int OpenGUI::Cursor::getObjectType  )  const [virtual]
 

Returns an integer identifying the type of object.

See also:
Object_Type

Implements OpenGUI::Object.

const FVector2& OpenGUI::Cursor::getSize  )  const [inline]
 

returns the size of this cursor

void OpenGUI::Cursor::onCursorHidden Object sender,
EventArgs evtArgs
[protected, virtual]
 

"CursorHidden" event

Default is to do nothing

void OpenGUI::Cursor::onCursorMove Object sender,
Cursor_EventArgs evtArgs
[protected, virtual]
 

"CursorMove" event

Default is to do nothing

void OpenGUI::Cursor::onCursorPress Object sender,
Cursor_EventArgs evtArgs
[protected, virtual]
 

"CursorPress" event

Default is to do nothing

void OpenGUI::Cursor::onCursorRelease Object sender,
Cursor_EventArgs evtArgs
[protected, virtual]
 

"CursorRelease" event

Default is to do nothing

void OpenGUI::Cursor::onCursorShown Object sender,
Cursor_EventArgs evtArgs
[protected, virtual]
 

"CursorShown" event

Default is to do nothing

void OpenGUI::Cursor::onDraw Object sender,
DrawCursor_EventArgs evtArgs
[protected, virtual]
 

"Draw" event

Default is to do nothing

Reimplemented in OpenGUI::GenericCursor.

void OpenGUI::Cursor::setSize const FVector2 newSize  )  [inline]
 

sets the size of this cursor


The documentation for this class was generated from the following files:
Copyright © 2006 OpenGUI | OpenGUI.SF.net
Generated: Sun Sep 9 02:00:21 2007