Class to store and fetch information about the WIMP mouse pointer.
More...
#include <pointerinfo.h>
Class to store and fetch information about the WIMP mouse pointer.
tbx::PointerInfo::PointerInfo |
( |
bool |
update_now = true , |
|
|
bool |
get_objects = true |
|
) |
| |
Constructor to optionally get the current pointer position.
- Parameters
-
update_now | true (the default) to get the current pointer position |
get_objects | true (the default) to get toolbox objects instead of WIMP handles. get_objects is only used if update_now is true. |
tbx::PointerInfo::PointerInfo |
( |
WindowHandle |
window_handle, |
|
|
IconHandle |
icon_handle, |
|
|
int |
dest_x, |
|
|
int |
dest_y, |
|
|
int |
buttons |
|
) |
| |
Construct by giving it the pointer position and state.
- Parameters
-
window_handle | WIMP window handle pointer is over |
icon_handle | WIMP icon handle pointer is over or -1 if none. |
dest_x | x position of pointer on screen in OS units |
dest_y | y position of pointer on screen in OS units |
buttons | the current state of the pointer buttons The bits of the button state are: 0 adjust button pressed 1 menu button pressed 2 select button pressed |
bool tbx::PointerInfo::adjust_down |
( |
| ) |
const |
|
inline |
Check if the adjust button is pressed.
- Returns
- true if adjust is pressed
int tbx::PointerInfo::button_state |
( |
| ) |
const |
|
inline |
Get the button state.
- Returns
- the state of the buttons when this was updated The bits of the button state are: 0 adjust button pressed 1 menu button pressed 2 select button pressed
Gadget tbx::PointerInfo::gadget |
( |
| ) |
const |
Return gadget the pointer is over.
This only applies if get_objects was set to true in the constructor or update call.
- Returns
- Gadget (will be null gadget if get_objects was false or it's not over an object)
IconHandle tbx::PointerInfo::icon_handle |
( |
| ) |
const |
|
inline |
Get the WIMP icon handle the pointer was over.
This is only valid if get_objects was false when this was constructed or last updated
- Returns
- WIMP icon handle
bool tbx::PointerInfo::menu_down |
( |
| ) |
const |
|
inline |
Check if then menu button is pressed.
- Returns
- true if menu is pressed
int tbx::PointerInfo::mouse_x |
( |
| ) |
const |
|
inline |
Get the x mouse coordinate.
- Returns
- x mouse position on screen in OS units
int tbx::PointerInfo::mouse_y |
( |
| ) |
const |
|
inline |
Get the y mouse coordinate.
- Returns
- y mouse position on screen in OS units
Object tbx::PointerInfo::object |
( |
| ) |
const |
Return object the pointer is over.
This only applies if get_objects was set to true in the constructor or update call.
- Returns
- Object (will be null object if get_objects was false or it's not over an object)
bool tbx::PointerInfo::on_background |
( |
| ) |
const |
|
inline |
Check if the window returned is the desktop background.
This is only valid if get_objects was false when this was constructed or last updated
- Returns
- true if the window return represents the background
bool tbx::PointerInfo::on_iconbar |
( |
| ) |
const |
|
inline |
Check if the window returned is the iconbar.
This is only valid if get_objects was false when this was constructed or last updated
- Returns
- true if the window return represents the iconbar
bool tbx::PointerInfo::on_object |
( |
| ) |
const |
|
inline |
Check if pointer is returning object information.
- Returns
- true if pointer is return object information
bool tbx::PointerInfo::select_down |
( |
| ) |
const |
|
inline |
Check if the select button is pressed.
- Returns
- true if select is pressed
bool tbx::PointerInfo::system_icon |
( |
| ) |
const |
|
inline |
Check if this is a system icon.
This is only valid if get_objects was false when this was constructed or last updated
- Returns
- true if the icon handle represents a system icon
void tbx::PointerInfo::Update |
( |
bool |
get_objects = true | ) |
|
Update to current location of mouse.
- Parameters
-
get_objects | true (the default) to get toolbox objects instead of WIMP handles. |
bool tbx::PointerInfo::user_window |
( |
| ) |
const |
|
inline |
Check if the window returned is a user window.
This is only valid if get_objects was false when this was constructed or last updated
- Returns
- true if the window is a user window
Get the WIMP window handle the pointer was over.
This is only valid if get_objects was false when this was constructed or last updated
- Returns
- WIMP window handle can also be: -1 for desktop background -2 for icon bar
The documentation for this class was generated from the following files: