Syntax
[C/C++:]
void gSetCursorAction(int action, int lverts, GPOINT *points);
[F90:]
subroutine gSetCursorAction(action, lverts, points)
integer, intent(in) :: action, lverts
type (GPOINT), intent(in) :: points(*)
Arguments
action
Cursor action type
= GDEFAULT,
= GRUBBERBAND,
= GRUBBERBOX,
= GRUBBERSQUARE,
= GRUBBERELLIPSE,
= GRUBBERCIRCLE,
= GPOLYLINE,
lverts
Number of vertices if polyline cursor
points
Coordinates of polyline cursor
Description
The routine gSetCursorAction() sets the action of the cursor or pointer when gAddEventType() or gGetCursorEvent() is used.
When
action = GDEFAULT, the normal action of the cursor or pointer is set such that it marks the current pointer position.
With all the other action types the rubber shape is drawn in XOR mode using the colour
bakcol set by gSetCursorType() on most devices. Each shape has a static position which is the previous cursor position when gGetCursorEvent() or gSetCursorPos() was called and has a variable position which follows the cursor.
When
action = GRUBBERBAND, or GRUBBERBOX a rubber line or box is displayed between the two points. When
action = GRUBBERSQUARE, a rubber square is displayed, the dimension of each side being the minimum distance between the previous cursor position and the cursor. When
action = GRUBBERELLIPSE, a rubber ellipse is displayed within the bounding rectangle whose centre is the previous cursor position and corner is the cursor position. When
action = GRUBBERCIRCLE, a rubber circle is displayed in the same way as the ellipse except the bounding box is kept to a square centred at the previous cursor position.
When
action = GPOLYLINE, the user can define a polyline which will be displayed at the same time as the cursor and will follow the current pointer position. The number of vertices is set in
lverts and the coordinates are placed in the array
points. The coordinates are defined in absolute picture coordinates. When gGetCursorEvent() or gWaitForEvent() is called the coordinate (0.0,0.0) will follow the pointer position. A maximum of 200 vertices can be sent to the device. If more that 200 vertices are requested, a warning message is output and only the first 200 are used. The polyline is not subject to any GINO windowing or masking.
If
action is outside the above range an error message is output and no change is made to the action type.
This routine only affects the shape of the cursor when
action=GPOLYLINE, The routine gSetCursorType() should be used to set other shapes.
The availability of cursor action types is hardware dependent and users should refer to the relevant Appendix B document for the current device being used.
See Also
gSetCursorAction UsageDevice DriversgAddEventTypegGetCursorEventgSetCursorPosgSetCursorTypegWaitForEvent