Parasol Framework
  • Gallery
  • API
  • Wiki
  • GitHub
    • Audio
    • Core
    • Display
    • Fluid
    • Font
    • Network
    • Vector
    • Audio
    • Sound
    • File
    • MetaClass
    • Module
    • StorageDevice
    • Task
    • Thread
    • Time
    • Compression
    • Config
    • Script
    • XML
    • Controller
    • BlurFX
    • ColourFX
    • CompositeFX
    • ConvolveFX
    • DisplacementFX
    • FilterEffect
    • FloodFX
    • ImageFX
    • LightingFX
    • MergeFX
    • MorphologyFX
    • OffsetFX
    • RemapFX
    • SourceFX
    • TurbulenceFX
    • WaveFunctionFX
    • Scintilla
    • ScintillaSearch
    • Bitmap
    • Clipboard
    • Display
    • Document
    • Font
    • Picture
    • Pointer
    • Surface
    • SVG
    • ClientSocket
    • HTTP
    • NetSocket
    • Proxy
    • Vector
    • VectorClip
    • VectorColour
    • VectorEllipse
    • VectorFilter
    • VectorGradient
    • VectorGroup
    • VectorImage
    • VectorPath
    • VectorPattern
    • VectorPolygon
    • VectorRectangle
    • VectorScene
    • VectorShape
    • VectorSpiral
    • VectorText
    • VectorTransition
    • VectorViewport
    • VectorWave

Pointer Class

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.

Structure

The Pointer class consists of the following fields:

Access
NameTypeComment
  AccelerationDOUBLEThe 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.

  AnchorOBJECTIDCan 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*BitmapRefers to bitmap in which custom cursor images can be drawn.

The pointer graphic can be changed to a custom image if the PTC::CUSTOM CursorID type is defined and an image is drawn to the Bitmap object referenced by this field.

  ButtonOrderSTRINGDefines 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 123456789AB. The left, right and middle mouse buttons are defined as 1, 2 and 3 respectively. The rest of the buttons are assigned by the device, preferably starting from the left of the device and moving clockwise.

It is legal for buttons to be referenced more than once, for instance a setting of 111 will force the middle and right mouse buttons to translate to the left mouse button.

Changes to this field will have an immediate impact on the pointing device's behaviour.

  ButtonStateINTIndicates 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 1 indicates that the user is holding the button down. The bit order is LMB, RMB, MMB, with the LMB starting at bit position zero. Additional buttons are supported but their exact order will depend on the device that is in use, and the configuration of their order may be further customised by the user.

  ClickSlopINTA 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).

  CursorIDPTCSets the user's cursor image, selected from the pre-defined graphics bank.
NameDescription
PTC::CROSSHAIRThe cross hair is used for targeting specific pixel points (common in paint programs).
PTC::CUSTOMWorks in conjunction with the SetCustomCursor() function to represent a program defined bitmap.
PTC::DEFAULTThe default cursor (usually an arrow pointing to the upper left).
PTC::DRAGGABLEUsed to indicate that a surface or object can be dragged by the user.
PTC::END
PTC::HANDThe hand cursor is often used for indicating click-able content (hyper-links, icons etc).
PTC::HAND_LEFTSimilar to the standard hand cursor, but points to the left.
PTC::HAND_RIGHTSimilar to the standard hand cursor, but points to the right.
PTC::INVISIBLEThe cursor graphic is invisible (but will continue to operate as normal in all other respects).
PTC::MAGNIFIERRepresents a magnifying glass.
PTC::NO_CHANGE
PTC::PAINTBRUSHThe paintbrush cursor is typically employed by paint programs.
PTC::SIZE_BOTTOMSizing cursor - for resizing the bottom edge of any rectangular area.
PTC::SIZE_BOTTOM_LEFTSizing cursor - for resizing the bottom left corner of any rectangular area.
PTC::SIZE_BOTTOM_RIGHTSizing cursor - for resizing the bottom right corner of any rectangular area.
PTC::SIZE_LEFTSizing cursor - for resizing the left edge of any rectangular area.
PTC::SIZE_RIGHTSizing cursor - for resizing the right edge of any rectangular area.
PTC::SIZE_TOPSizing cursor - for resizing the top edge of any rectangular area.
PTC::SIZE_TOP_LEFTSizing cursor - for resizing the top left corner of any rectangular area.
PTC::SIZE_TOP_RIGHTSizing cursor - for resizing the top right corner of any rectangular area.
PTC::SIZINGMulti-directional sizing cursor - for resizing in any direction.
PTC::SLEEPThe sleep cursor is used to inform the user that the computer is busy.
PTC::SPLIT_HORIZONTALThe horizontal split cursor is typically used for splitting rectangles in half, or dragging a horizontal split within a large rectangular space.
PTC::SPLIT_VERTICALThe vertical split cursor is typically used for splitting rectangles in half, or dragging a vertical split within a large rectangular space.
PTC::STOPThe 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::TEXTThe text cursor is popular for the precise positioning of text cursors.
  CursorOwnerOBJECTIDThe 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.

  DoubleClickDOUBLEThe 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.

  DragItemINTThe 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.

  DragSourceOBJECTIDThe 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.

  FlagsPFOptional flags.
NameDescription
PF::ANCHORAllow the pointer to be anchored.
PF::UNUSED
PF::VISIBLEIndicates that the pointer is currently visible. Read-only.
  InputOBJECTIDDeclares 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.

  MaxSpeedINTRestricts 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.

  OverObjectOBJECTIDReadable 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. NULL can be returned if there is no surface object under the pointer.

  OverXDOUBLEThe 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.

  OverYDOUBLEThe 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.

  OverZDOUBLEThe 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.

  RestrictOBJECTIDRefers 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.

  SpeedDOUBLESpeed 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.

  SurfaceOBJECTIDThe 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.

  WheelSpeedDOUBLEDefines 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.

  XDOUBLEThe horizontal position of the pointer within its parent display.
  YDOUBLEThe vertical position of the pointer within its parent display.
Pointer class documentation © Paul Manias 2003-2025

PF Type

Flags for the Pointer class.

NameDescription
PF::ANCHORAllow the pointer to be anchored.
PF::UNUSED
PF::VISIBLEIndicates that the pointer is currently visible. Read-only.
Pointer module documentation © Paul Manias 2003-2025

PTC Type

Predefined cursor styles

NameDescription
PTC::CROSSHAIRThe cross hair is used for targeting specific pixel points (common in paint programs).
PTC::CUSTOMWorks in conjunction with the SetCustomCursor() function to represent a program defined bitmap.
PTC::DEFAULTThe default cursor (usually an arrow pointing to the upper left).
PTC::DRAGGABLEUsed to indicate that a surface or object can be dragged by the user.
PTC::END
PTC::HANDThe hand cursor is often used for indicating click-able content (hyper-links, icons etc).
PTC::HAND_LEFTSimilar to the standard hand cursor, but points to the left.
PTC::HAND_RIGHTSimilar to the standard hand cursor, but points to the right.
PTC::INVISIBLEThe cursor graphic is invisible (but will continue to operate as normal in all other respects).
PTC::MAGNIFIERRepresents a magnifying glass.
PTC::NO_CHANGE
PTC::PAINTBRUSHThe paintbrush cursor is typically employed by paint programs.
PTC::SIZE_BOTTOMSizing cursor - for resizing the bottom edge of any rectangular area.
PTC::SIZE_BOTTOM_LEFTSizing cursor - for resizing the bottom left corner of any rectangular area.
PTC::SIZE_BOTTOM_RIGHTSizing cursor - for resizing the bottom right corner of any rectangular area.
PTC::SIZE_LEFTSizing cursor - for resizing the left edge of any rectangular area.
PTC::SIZE_RIGHTSizing cursor - for resizing the right edge of any rectangular area.
PTC::SIZE_TOPSizing cursor - for resizing the top edge of any rectangular area.
PTC::SIZE_TOP_LEFTSizing cursor - for resizing the top left corner of any rectangular area.
PTC::SIZE_TOP_RIGHTSizing cursor - for resizing the top right corner of any rectangular area.
PTC::SIZINGMulti-directional sizing cursor - for resizing in any direction.
PTC::SLEEPThe sleep cursor is used to inform the user that the computer is busy.
PTC::SPLIT_HORIZONTALThe horizontal split cursor is typically used for splitting rectangles in half, or dragging a horizontal split within a large rectangular space.
PTC::SPLIT_VERTICALThe vertical split cursor is typically used for splitting rectangles in half, or dragging a vertical split within a large rectangular space.
PTC::STOPThe 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::TEXTThe text cursor is popular for the precise positioning of text cursors.
Pointer module documentation © Paul Manias 2003-2025