Singleton for overriding the application's cursor.
More...
#include <mitkApplicationCursor.h>
Singleton for overriding the application's cursor.
Provides a stack-based mechanism to override the application cursor with context-dependent cursors. Accepts cursors in XPM format. Push a cursor on top of the stack and later pop it to restore the previous state. This mimics Qt's QApplication::setOverrideCursor() behavior.
A toolkit-specific ApplicationCursorImplementation must be registered before any cursor operations are used.
- See also
- ApplicationCursorImplementation
Definition at line 82 of file mitkApplicationCursor.h.
◆ ApplicationCursor()
| mitk::ApplicationCursor::ApplicationCursor |
( |
| ) |
|
|
protected |
Hidden constructor (singleton pattern).
◆ GetCursorPosition()
| const Point2I mitk::ApplicationCursor::GetCursorPosition |
( |
| ) |
|
Get the absolute mouse position on screen.
- Returns
- The cursor position, or (-1, -1) if querying is not possible.
◆ GetInstance()
◆ PopCursor()
| void mitk::ApplicationCursor::PopCursor |
( |
| ) |
|
Pop the most recent cursor from the stack, restoring the previous one.
◆ PushCursor() [1/2]
| void mitk::ApplicationCursor::PushCursor |
( |
const char * |
XPM[], |
|
|
int |
hotspotX = -1, |
|
|
int |
hotspotY = -1 |
|
) |
| |
Push a new cursor onto the stack (XPM format).
- Parameters
-
| [in] | XPM | The cursor image in XPM format. |
| [in] | hotspotX | The x-coordinate of the cursor hotspot (-1 for default). |
| [in] | hotspotY | The y-coordinate of the cursor hotspot (-1 for default). |
◆ PushCursor() [2/2]
| void mitk::ApplicationCursor::PushCursor |
( |
std::istream & |
cursorStream, |
|
|
int |
hotspotX = -1, |
|
|
int |
hotspotY = -1 |
|
) |
| |
Push a new cursor onto the stack (stream format).
- Parameters
-
| [in,out] | cursorStream | Input stream containing cursor data. |
| [in] | hotspotX | The x-coordinate of the cursor hotspot (-1 for default). |
| [in] | hotspotY | The y-coordinate of the cursor hotspot (-1 for default). |
◆ RegisterImplementation()
Register a toolkit-specific cursor implementation.
- Parameters
-
| [in] | implementation | The implementation to use for cursor operations. |
◆ SetCursorPosition()
| void mitk::ApplicationCursor::SetCursorPosition |
( |
const Point2I & |
position | ) |
|
Set the absolute mouse position on screen.
- Parameters
-
| [in] | position | The desired cursor position in screen coordinates. |
The documentation for this class was generated from the following file: