Interface for mouse cursor support.
The Pointer class provides the user with a means of interacting with the graphical interface. On a host system such as Windows, the pointer functionality will hook into the host's capabilities. If the display is native then the pointer service will manage its own cursor exclusively.
Internally, a system-wide pointer object is automatically created with a name of SystemPointer
. This should be used for all interactions with this service.
The Pointer class consists of the following fields:
Access | Name | Type | Comment | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Acceleration | DOUBLE | The rate of acceleration for relative pointer movement. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
This field affects the rate of acceleration as the pointer is moved across the display. It is recommended that this field is never set manually, as the user will need to determine the best acceleration level through trial and error in the user preferences program. This field is not relevant in a hosted environment. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Anchor | OBJECTID | Can refer to a surface that the pointer has been anchored to. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
If the pointer is anchored to a surface through SetCursor(), this field will refer to the surface that holds the anchor. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Bitmap | *Bitmap | Refers to bitmap in which custom cursor images can be drawn. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
ButtonOrder | STRING | Defines the order in which mouse buttons are interpreted. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
This field defines the order of interpretation of the mouse buttons when they are pressed. This allows a right handed device to have its buttons remapped to mimic a left-handed device for instance. The default button order is defined as It is legal for buttons to be referenced more than once, for instance a setting of Changes to this field will have an immediate impact on the pointing device's behaviour. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ButtonState | INT | Indicates the current button-press state. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
This field returns the state of mouse input buttons as bit-flags, sorted by order of their importance. A bit flag of | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ClickSlop | INT | A leniency value that assists in determining if the user intended to click or drag. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
The ClickSlop value defines the allowable pixel distance between two clicks for them to be considered a double-click (or a drag operation if they exceed the distance). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CursorID | PTC | Sets the user's cursor image, selected from the pre-defined graphics bank. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CursorOwner | OBJECTID | The current owner of the cursor, as defined by SetCursor(). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
If the pointer is currently owned by an object, this field will refer to that object ID. Pointer ownership is managed by the SetCursor() function. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DoubleClick | DOUBLE | The maximum interval between two clicks for a double click to be recognised. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
A double-click is recognised when two separate clicks occur within a pre-determined time frame. The length of that time frame is determined in the DoubleClick field and is measured in seconds. The recommended interval is 0.3 seconds, although the user can store his own preference in the pointer configuration file. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DragItem | INT | The currently dragged item, as defined by StartCursorDrag(). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
When the pointer is in drag-mode, the custom item number that was defined in the initial call to StartCursorDrag() will be defined here. At all other times this field will be set to zero. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DragSource | OBJECTID | The object managing the current drag operation, as defined by StartCursorDrag(). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
When the pointer is in drag-mode, the object that is managing the source data will be referenced in this field. At all other times this field will be set to zero. Item dragging is managed by the StartCursorDrag() function. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Flags | PF | Optional flags. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Input | OBJECTID | Declares the I/O object to read movement from. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
By default a pointer will read its input directly from the mouse port. However it may be convenient for the pointer to receive its information from elsewhere, in which case you can set this field to point to a different input object. The object that you use must be able to send joyport information over data channels. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MaxSpeed | INT | Restricts the maximum speed of a pointer's movement. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
The maximum speed at which the pointer can move per frame is specified in this field. This field is provided to help the user for times where the pointer may be moving to fast (for example if the hardware driver is interpreting the mouse movement at larger offsets than what is normal). You can also set the value to 1 if a digital simulation is required. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
OverObject | OBJECTID | Readable field that gives the ID of the object under the pointer. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
This field returns a reference to the object directly under the pointer's hot-spot. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
OverX | DOUBLE | The horizontal position of the pointer with respect to the object underneath the hot-spot. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
The OverX field provides other classes with a means of finding out exactly where the pointer is positioned over their display area. For example, if a user click occurs on an Image and it is necessary to find out what coordinates where affected, the OverX and OverY fields can be polled to determine the exact position of the user click. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
OverY | DOUBLE | The vertical position of the pointer with respect to the object underneath the hot-spot. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
The OverY field provides other classes with a means of finding out exactly where the pointer is positioned over their display area. For example, if a user click occurs on an Image and it is necessary to find out what coordinates where affected, the OverX and OverY fields can be polled to determine the exact position of the user click. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
OverZ | DOUBLE | The position of the Pointer within an object. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
This special field applies to 3D interfaces only. It reflects the position of the pointer within 3-Dimensional displays, by returning its coordinate along the Z axis. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Restrict | OBJECTID | Refers to a surface when the pointer is restricted. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
If the pointer has been restricted to a surface through SetCursor(), this field refers to the ID of that surface. If the pointer is not restricted, this field is set to zero. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Speed | DOUBLE | Speed multiplier for pointer movement. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
The speed at which the pointer moves can be adjusted with this field. To lower the speed, use a value between 0 and 100%. To increase the speed, use a value between 100 and 1000%. The speed of the pointer is complemented by the MaxSpeed field, which restricts the maximum amount of pixels that a pointer can move each time the input device is polled. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Surface | OBJECTID | The top-most surface that is under the pointer's hot spot. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
The surface that is directly under the pointer's hot spot is referenced by this field. It is automatically updated whenever the position of the pointer changes or a new surface appears under the pointer. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WheelSpeed | DOUBLE | Defines a multiplier to be applied to the mouse wheel. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
This field defines a multiplier that is applied to values coming from the mouse wheel. A setting of 1.0 leaves the wheel speed unaltered, while a setting of 2.0 would double the regular speed. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
X | DOUBLE | The horizontal position of the pointer within its parent display. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Y | DOUBLE | The vertical position of the pointer within its parent display. |
Flags for the Pointer class.
Name | Description |
---|---|
PF::ANCHOR | Allow the pointer to be anchored. |
PF::UNUSED | |
PF::VISIBLE | Indicates that the pointer is currently visible. Read-only. |
Predefined cursor styles
Name | Description |
---|---|
PTC::CROSSHAIR | The cross hair is used for targeting specific pixel points (common in paint programs). |
PTC::CUSTOM | Works in conjunction with the SetCustomCursor() function to represent a program defined bitmap. |
PTC::DEFAULT | The default cursor (usually an arrow pointing to the upper left). |
PTC::DRAGGABLE | Used to indicate that a surface or object can be dragged by the user. |
PTC::END | |
PTC::HAND | The hand cursor is often used for indicating click-able content (hyper-links, icons etc). |
PTC::HAND_LEFT | Similar to the standard hand cursor, but points to the left. |
PTC::HAND_RIGHT | Similar to the standard hand cursor, but points to the right. |
PTC::INVISIBLE | The cursor graphic is invisible (but will continue to operate as normal in all other respects). |
PTC::MAGNIFIER | Represents a magnifying glass. |
PTC::NO_CHANGE | |
PTC::PAINTBRUSH | The paintbrush cursor is typically employed by paint programs. |
PTC::SIZE_BOTTOM | Sizing cursor - for resizing the bottom edge of any rectangular area. |
PTC::SIZE_BOTTOM_LEFT | Sizing cursor - for resizing the bottom left corner of any rectangular area. |
PTC::SIZE_BOTTOM_RIGHT | Sizing cursor - for resizing the bottom right corner of any rectangular area. |
PTC::SIZE_LEFT | Sizing cursor - for resizing the left edge of any rectangular area. |
PTC::SIZE_RIGHT | Sizing cursor - for resizing the right edge of any rectangular area. |
PTC::SIZE_TOP | Sizing cursor - for resizing the top edge of any rectangular area. |
PTC::SIZE_TOP_LEFT | Sizing cursor - for resizing the top left corner of any rectangular area. |
PTC::SIZE_TOP_RIGHT | Sizing cursor - for resizing the top right corner of any rectangular area. |
PTC::SIZING | Multi-directional sizing cursor - for resizing in any direction. |
PTC::SLEEP | The sleep cursor is used to inform the user that the computer is busy. |
PTC::SPLIT_HORIZONTAL | The horizontal split cursor is typically used for splitting rectangles in half, or dragging a horizontal split within a large rectangular space. |
PTC::SPLIT_VERTICAL | The vertical split cursor is typically used for splitting rectangles in half, or dragging a vertical split within a large rectangular space. |
PTC::STOP | The stop cursor is used to inform the user that an operation is not possible (e.g. drag and drop to an unsupported object area). |
PTC::TEXT | The text cursor is popular for the precise positioning of text cursors. |
Class Info | |
---|---|
ID | ID_POINTER |
Category | Graphics |
Include | modules/pointer.h |
Version | 1 |