Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitk::ApplicationCursor Class Reference

Allows to override the application's cursor. More...

#include <mitkApplicationCursor.h>

Public Member Functions

void PushCursor (const char *XPM[], int hotspotX=-1, int hotspotY=-1)
 Change the current application cursor. More...
 
void PushCursor (std::istream &, int hotspotX=-1, int hotspotY=-1)
 Change the current application cursor. More...
 
void PopCursor ()
 Restore the previous cursor. More...
 
const Point2I GetCursorPosition ()
 
void SetCursorPosition (const Point2I &)
 Set absolute mouse position on screen. More...
 

Static Public Member Functions

static ApplicationCursorGetInstance ()
 This class is a singleton. More...
 
static void RegisterImplementation (ApplicationCursorImplementation *implementation)
 To be called by a toolkit specific ApplicationCursorImplementation. More...
 

Protected Member Functions

 ApplicationCursor ()
 Purposely hidden - singleton. More...
 

Detailed Description

Allows to override the application's cursor.

Base class for classes that allow to override the applications cursor with context dependent cursors. Accepts cursors in the XPM format.

The behaviour is stack-like. You can push your cursor on top of the stack and later pop it to reset the cursor to its former state. This is mimicking Qt's Application::setOverrideCuror() behaviour, but should be ok for most cases where you want to switch a cursor.

Definition at line 61 of file mitkApplicationCursor.h.

Constructor & Destructor Documentation

◆ ApplicationCursor()

mitk::ApplicationCursor::ApplicationCursor ( )
protected

Purposely hidden - singleton.

Definition at line 22 of file mitkApplicationCursor.cpp.

Referenced by GetInstance().

Member Function Documentation

◆ GetCursorPosition()

const Point2I mitk::ApplicationCursor::GetCursorPosition ( )

Get absolute mouse position on screen

Returns
(-1, -1) if querying mouse position is not possible

Definition at line 78 of file mitkApplicationCursor.cpp.

References mitk::ApplicationCursorImplementation::GetCursorPosition(), and MITK_ERROR.

◆ GetInstance()

◆ PopCursor()

◆ PushCursor() [1/2]

void mitk::ApplicationCursor::PushCursor ( const char *  XPM[],
int  hotspotX = -1,
int  hotspotY = -1 
)

◆ PushCursor() [2/2]

void mitk::ApplicationCursor::PushCursor ( std::istream &  cursor,
int  hotspotX = -1,
int  hotspotY = -1 
)

Change the current application cursor.

Definition at line 39 of file mitkApplicationCursor.cpp.

References MITK_ERROR, and mitk::ApplicationCursorImplementation::PushCursor().

◆ RegisterImplementation()

void mitk::ApplicationCursor::RegisterImplementation ( ApplicationCursorImplementation implementation)
static

To be called by a toolkit specific ApplicationCursorImplementation.

Definition at line 34 of file mitkApplicationCursor.cpp.

Referenced by QmitkApplicationCursor::QmitkApplicationCursor().

◆ SetCursorPosition()

void mitk::ApplicationCursor::SetCursorPosition ( const Point2I p)

Set absolute mouse position on screen.

Definition at line 91 of file mitkApplicationCursor.cpp.

References MITK_ERROR, and mitk::ApplicationCursorImplementation::SetCursorPosition().


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