MOUSE Mnemonic - Create Mouse Hotspot
Syntax
'MOUSE'(col,row,cols,rows{,single_resp{,double_resp}})
Description
The 'MOUSE' mnemonic activates a region (hot spot) on the screen for mouse (pointing device) activity.
Parameter |
Description |
---|---|
col |
Number of the column that defines the left boundary of the mouse hotspot. |
row |
Number of the row that defines the upper boundary of the mouse hotspot. |
cols |
Width of the mouse hotspot, in columns. |
rows |
Height of the mouse hotspot, in rows. |
single_resp |
Text to be transmitted whenever a pointing device button is single-clicked in the region. Using the empty string ("") while including the double_resp causes single clicks to be ignored. |
double_resp |
Text to be transmitted whenever a pointing device button is double-clicked in this region. May only be specified if single_resp is also defined. |
If a mouse button is held down and the pointer is dragged across one
of these regions, the area is highlighted making it possible to browse
the available options. Clicking or double-clicking on an activated region
returns a response string to the program.
One instance of the 'MOUSE' mnemonic placed in a loop that generates an
on-screen menu can permit operation of the menu with the pointing device
as well as the keyboard. In this way, character-based software can be
moved to GUI.
Either response string can be made to convey information about which pointing
device button was clicked and the status of the Ctrl and Shift
keys at the time. To do this, it is necessary to add special case-sensitive
sequences to the response string:
Sequence |
Replaced With |
---|---|
%% |
A single percent sign. |
%b |
"0", "1", or "2", depending on which pointing device button was clicked. |
%c |
"0" or "1" ($30$ or $31$), depending on the Ctrl key status. |
%s |
"0" or "1" ($30$ or $31$), depending on the Shift key status. |
If no response strings are provided, any activated regions whose rectangles
intersect with the specified rectangle are deactivated. 'MOUSE'(0,0,0,0)
is a shortcut to deactivate all hot spots associated with this PRO/5 screen.
Hot spots are not associated with the Visual PRO/5 terminal window but
rather with the Visual PRO/5 window or screen to which the 'MOUSE' mnemonic
is written. A text screen may contain one or more virtual screens or windows.
It is this type of window, or movable subset of the text screen, that
may contain mouse hot spots.
When Visual PRO/5 starts, a window already exists and a distinction is
unnecessary unless character-based windowing features are used. The distinction
becomes important when multiple windows are displayed, or when windows
are moved about the screen. Moving a window ('MOVE'
mnemonic) preserves the locations of the hot spots, relative to the contents
of that window. The destruction of a window ('POP'
mnemonic) destroys all the hot spots associated with that window. The
'PUSH' mnemonic duplicates any hot
spots. At any given time, only the currently active window's hot spots
are operational.
It is possible to create a new text window, draw a menu in it, activate
the menu items, read a response (from keyboard or pointing device), and
then remove the text window. The activated regions are automatically dissolved.
Clear, insert, and delete operations will dissolve any hot spots whose
regions are affected.