tbx  0.7.3
Public Member Functions | List of all members
tbx::PointerInfo Class Reference

Class to store and fetch information about the WIMP mouse pointer. More...

#include <pointerinfo.h>

Public Member Functions

 PointerInfo (bool update_now=true, bool get_objects=true)
 Constructor to optionally get the current pointer position. More...
 
 PointerInfo (WindowHandle window_handle, IconHandle icon_handle, int dest_x, int dest_y, int buttons)
 Construct by giving it the pointer position and state. More...
 
void Update (bool get_objects=true)
 Update to current location of mouse. More...
 
int mouse_x () const
 Get the x mouse coordinate. More...
 
int mouse_y () const
 Get the y mouse coordinate. More...
 
int button_state () const
 Get the button state. More...
 
bool adjust_down () const
 Check if the adjust button is pressed. More...
 
bool menu_down () const
 Check if then menu button is pressed. More...
 
bool select_down () const
 Check if the select button is pressed. More...
 
bool on_object () const
 Check if pointer is returning object information. More...
 
Object object () const
 Return object the pointer is over. More...
 
Gadget gadget () const
 Return gadget the pointer is over. More...
 
WindowHandle window_handle () const
 Get the WIMP window handle the pointer was over. More...
 
IconHandle icon_handle () const
 Get the WIMP icon handle the pointer was over. More...
 
bool user_window () const
 Check if the window returned is a user window. More...
 
bool on_background () const
 Check if the window returned is the desktop background. More...
 
bool on_iconbar () const
 Check if the window returned is the iconbar. More...
 
bool system_icon () const
 Check if this is a system icon. More...
 

Detailed Description

Class to store and fetch information about the WIMP mouse pointer.

Constructor & Destructor Documentation

tbx::PointerInfo::PointerInfo ( bool  update_now = true,
bool  get_objects = true 
)

Constructor to optionally get the current pointer position.

Parameters
update_nowtrue (the default) to get the current pointer position
get_objectstrue (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_handleWIMP window handle pointer is over
icon_handleWIMP icon handle pointer is over or -1 if none.
dest_xx position of pointer on screen in OS units
dest_yy position of pointer on screen in OS units
buttonsthe 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

Member Function Documentation

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_objectstrue (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
WindowHandle tbx::PointerInfo::window_handle ( ) const
inline

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: