GUI Toolkit for TI nSpire  0.55 beta (dated 2021-03-21)
A GUI toolkit for Ndless-TI NSpire using SDL and Ndless libraries.
CursorTask Class Reference

#include <CursorTask.h>

Public Types

enum  cursortype { triangle = 0, roundclock = 1 }
 

Public Member Functions

 CursorTask ()
 
virtual ~CursorTask ()
 
virtual void logic ()
 
virtual void render (SDL_Surface *screen)
 
virtual void showmouse ()
 
virtual void hidemouse ()
 
virtual bool ismousevisible ()
 
virtual bool ismouseevent ()
 
virtual bool ismousemoveevent ()
 
virtual bool ismouseclickevent ()
 
virtual bool ismousereleaseevent ()
 
virtual void setcursortype (cursortype type)
 

Public Attributes

int x = 0
 
int y = 0
 
bool state = false
 

Detailed Description

CursorTask class.

The class to be used for accessing the touchpad (mouse) and click information.

Examples of usage:

CursorTask* myMouse = new CursorTask(); // Simple constructor, will need specific properties assignement later
CursorTask* myMouse = myApp->getmousehandler();
Note
WidgetApplication creates a KeyboardTask object at initialisation. It is then better to ask for a direct access to its CursorTask by using the WidgetApplication::getmousehandler() method.
See also
WidgetApplication::getmousehandler()

Member Enumeration Documentation

◆ cursortype

Enumerator for mouse cursor style.

Gives the style of mouse cursor. triangle style represents simple triangular arrow cursor. rounclock style represents the simple clock cursor (not animated)

Constructor & Destructor Documentation

◆ CursorTask()

CursorTask::CursorTask ( )
inline

Simple constructor

Simple constructor, will need specific properties assignement later.

Parameters
None
Returns
Nothing

◆ ~CursorTask()

virtual CursorTask::~CursorTask ( )
inlinevirtual

Object destructor.

Object destructor, remove all trace of the object and free allocated memory.

Parameters
None
Returns
Nothing

Member Function Documentation

◆ hidemouse()

virtual void CursorTask::hidemouse ( )
inlinevirtual

The CursorTask hidemouse method

Method to be launched to hide (and hence not draw) the mouse cursor on the screen.

Parameters
None.
Returns
Nothing.
Note
By default, at initialisation, the cursor is shown

◆ ismouseclickevent()

virtual bool CursorTask::ismouseclickevent ( )
inlinevirtual

The CursorTask ismouseclickevent method

Method to be launched to know if a mouse click event happened with the CursorTask since last call of the CursorTasklogic(). Tracked events are pad clicks only.

Parameters
None.
Returns
Boolean : true if something happened and false otherwise.
See also
CursorTask::ismouseevent() CursorTask::ismousemoveevent() CursorTask::ismousereleaseevent()

◆ ismouseevent()

virtual bool CursorTask::ismouseevent ( )
inlinevirtual

The CursorTask ismouseevent method

Method to be launched to know if something happened with the CursorTask since last call of the CursorTasklogic(). Tracked events are cursor motion (touchpad has been touched), the pad has been clicked or has been released

Parameters
None.
Returns
Boolean : true if something happened and false otherwise.
Note
Each individual event can be tracked individually by CursorTask::ismousemovement() CursorTask::ismouseclickevent() CursorTask::ismousereleaseevent() respectively.
See also
CursorTask::ismousemovement() CursorTask::ismouseclickevent() CursorTask::ismousereleaseevent()

◆ ismousemoveevent()

virtual bool CursorTask::ismousemoveevent ( )
inlinevirtual

The CursorTask ismousemoveevent method

Method to be launched to know if a cursor move event happened with the CursorTask since last call of the CursorTasklogic(). Tracked events are cursor motion (touchpad has been touched) only.

Parameters
None.
Returns
Boolean : true if something happened and false otherwise.
See also
CursorTask::ismouseevent() CursorTask::ismouseclickevent() CursorTask::ismousereleaseevent()

◆ ismousereleaseevent()

virtual bool CursorTask::ismousereleaseevent ( )
inlinevirtual

The CursorTask ismousereleaseevent method

Method to be launched to know if a mouse click release event happened with the CursorTask since last call of the CursorTasklogic(). Tracked events are pad release clicks only.

Parameters
None.
Returns
Boolean : true if something happened and false otherwise.
See also
CursorTask::ismouseevent() CursorTask::ismousemoveevent() CursorTask::ismouseclickevent()

◆ ismousevisible()

virtual bool CursorTask::ismousevisible ( )
inlinevirtual

The CursorTask ismousevisible method

Method to be launched to know if the mosue cursor is hiden or visible.

Parameters
None.
Returns
Boolean : true if the cursor is visible and false otherwise.
Note
By default, at initialisation, the cursor is shown.

◆ logic()

void CursorTask::logic ( )
virtual

The CursorTask logic mechanism

All the properties of the Touchpad will be updated and member of the current object will be updated accordingly.

Parameters
None
Returns
Nothing, internal members will be updated.

◆ render()

void CursorTask::render ( SDL_Surface *  screen)
virtual

The CursorTask render method

Method to be launched to draw the mouse cursor on the screen.

Parameters
screen: pointer to a SDL_Surface object where we would like to draw the widget.
Returns
Nothing.

◆ setcursortype()

void CursorTask::setcursortype ( cursortype  type)
virtual

Cursor style setter.

Gives the style of mouse cursor

Parameters
typerefers to one of the styles given by the cursortype enumerator
Returns
Nothing
See also
cursortype

◆ showmouse()

virtual void CursorTask::showmouse ( )
inlinevirtual

The CursorTask showmouse method

Method to be launched to actually show (and hence draw) the mouse cursor on the screen.

Parameters
None.
Returns
Nothing.
Note
By default, at initialisation, the cursor is shown

Member Data Documentation

◆ state

bool CursorTask::state = false

Cursor click status

Gives direct access to the button status of the touchpad

Note
value is equal to true if clicked and fals otherwise.
See also
CursorTask::x CursorTask::y

◆ x

int CursorTask::x = 0

Cursor Y coordinate in the screen

Gives direct access to the X coordinate of the cursor on the screen

Note
value should be between 0 and 320
See also
CursorTask::y CursorTask::state

◆ y

int CursorTask::y = 0

Cursor Y coordinate in the screen

Gives direct access to the Y coordinate of the cursor on the screen

Note
value should be between 0 and 240
See also
CursorTask::x CursorTask::state

The documentation for this class was generated from the following files:
CursorTask::CursorTask
CursorTask()
Definition: CursorTask.h:32
WidgetApplication
Definition: WidgetApplication.h:32
CursorTask
Definition: CursorTask.h:23