Panels | Windowing Support for Text-based Systems |
The COBOL System Library contains sets of routines that you can call to paint characters and attributes to a character screen, read keys pressed on the keyboard, and to communicate with a mouse.
This chapter lists the routines available and describes them in detail.
CBL_CLEAR_SCR | Clear screen |
CBL_GET_CSR_POS | Get cursor position |
CBL_GET_SCR_SIZE | Get screen size |
CBL_READ_SCR_ATTRS | Read attribute string |
CBL_READ_SCR_CHARS | Read character string |
CBL_READ_SCR_CHATTRS | Read character and attribute strings |
CBL_SET_CSR_POS | Set cursor position |
CBL_SWAP_SCR_CHATTRS | Swap character and attribute |
CBL_WRITE_SCR_ATTRS | Write attribute string |
CBL_WRITE_SCR_CHARS | Write character string |
CBL_WRITE_SCR_CHARS_ATTR | Write character string with attribute |
CBL_WRITE_SCR_CHATTRS | Write character and attribute strings |
CBL_WRITE_SCR_TTY | Write characters TTY-style |
CBL_WRITE_SCR_N_ATTR | Repeat write attribute |
CBL_WRITE_SCR_N_CHAR | Repeat write character |
CBL_WRITE_SCR_N_CHATTR | Repeat write character and attributes |
X"A7" function 17 | Set Cursor Type |
X"A7" function 18 | Redirectable Console I/O |
X"A7" function 25 | Get Screen Type |
X"AF" function 1 | Configure Adis |
X"AF" function 18 | Display Character |
X"AF" function 22 | Sound Alarm |
X"AF" function 26 | Get Character |
X"E5" | Sound Bell |
A number of the screen routines specify the screen-position parameter. In this COBOL system, the top left corner of the screen is row 0, column 0. For example, if you want to change attributes beginning in row 5, column 8, you specify row-number as 4 and column-number as 7.
The CBL_GET_SCR routines enable you to make use of generic line drawing to produce the best possible representation of graphics characters available in any supported environment without having to modify your source programs.
Before using any of the X"A7" routines for screen handling, use the CBL_CLR_SCR routine.
CBL_GET_KBD_STATUS | Test for character at keyboard |
CBL_READ_KBD_CHAR | Read character from keyboard (no echo) |
X"B0" function 0 | Create Function-key Table |
X"B0" function 2 | Test Shift-key Status |
X"B0" function 4 | Disable Keyboard Interrupts |
CBL_GET_MOUSE_MASK | Get mouse event mask |
CBL_GET_MOUSE_POSITION | Get mouse screen coordinates |
CBL_GET_MOUSE_STATUS | Get number of events in queue |
CBL_HIDE_MOUSE | Hide mouse pointer |
CBL_INIT_MOUSE | Initialize mouse support |
CBL_READ_MOUSE_EVENT | Read mouse event queue |
CBL_SET_MOUSE_MASK | Set mouse event mask |
CBL_SET_MOUSE_POSITION | Set mouse screen coordinates |
CBL_SHOW_MOUSE | Draw mouse pointer |
CBL_TERM_MOUSE | Terminate mouse support |
PC_GET_MOUSE_SHAPE | Get mouse pointer shape |
PC_SET_MOUSE_HIDE_AREA | Set mouse hide area |
PC_SET_MOUSE_SHAPE | Set mouse pointer shape |
These routines do not work under UNIX.
UNIX:
In UNIX environments, CBL_INIT_MOUSE returns a nonzero RETURN-CODE
indicating that no mouse is present. The other CBL_ calls listed above
exist only as stubs and have no effect.
The mouse is useful for applications that require users to select from a list of options or move objects around on the screen.
To use these routines, you must ensure that your system knows that you have a mouse attached.
You must hide the mouse during the execution of any ANSI ACCEPT or DISPLAY statement that operates on the area of the screen where the mouse pointer is located.
The attributes referred to in the descriptions of routines are screen attributes, not user attributes. The top left-hand corner of the screen is row 0, column 0.
Whenever the mouse is moved or a button on the mouse is pressed or released, the mouse hardware causes an interrupt. The mouse device driver takes control and, depending on a mask you have set, either saves it in a queue or ignores it. This prevents events being lost if a subsequent interrupt occurs before the application has read the event. With the mouse routines, you can read the event queue and determine how many events are in the queue.
When an event is generated, a description of it is stored in a data structure called the event-data. If the mask allows (see below), this is added to the queue. The layout of event-data is:
event-type pic x(2) comp-x. event-time pic x(4) comp-x. event-row pic x(2) comp-x. event-col pic x(2) comp-x.
where the parameters are:
event-type |
The action (that is, change of state) that took place:
A button release is indicated by the bit for that button changing from 1 to 0. For example, if the mouse moves and button 1 is pressed at the same time, event-type contains 3. |
||||||||||
event-time |
The time elapsed between when the event took place and some arbitrary but fixed starting time. | ||||||||||
event-row,
|
The position of the mouse when the event took place. |
The event mask, which you supply, tells the system which kinds of event should be queued and which ignored. It has the same structure as event-type. An event is queued only if it happens while the corresponding mask bit is on, or while another state is on whose mask bit is on. When an event-data is queued, the bit for each state is set correctly; that is, the mask does not mask them out.
For example, the operator moving the mouse generates an event if either the mask bit for "mouse moved" is on or the operator is holding down a button and the mask bit for that button is on.
Descriptions for all of the call-by-name routines appear alphabetically. Each description contains the routine name and function, and the following entries, as appropriate:
Shows the CALL statement you could use to call the routine.
The optional RETURNING clause is also shown. Every routine returns a
value showing the result of the operation. Unless otherwise indicated,
zero indicates success, nonzero indicates failure. This value is left in
the data item specified in the RETURNING clause, in this reference,
status-code
. If this clause is omitted, the value is left in
the special register RETURN-CODE. (If call-convention bit two is set,
RETURN-CODE is not changed.)
status-code
must be a numeric data item capable of holding
positive values from 0 to 65535; for example, PIC X(2) COMP-5.
The name of the routine must be coded in upper case.
Describes any parameters shown in the RETURNING and USING clause. A parameter enclosed in brackets, for example [parameter1], is optional and might not be needed for all forms of the routine.
Indicates which of the parameters shown are passed on entry.
Indicates which of the parameters shown are returned on exit.
Where bits of one or more bytes are referenced, bit 0 is the least significant (rightmost) bit.
Provides any additional information necessary for the successful use of the routine.
Lists related sections.
Clears the whole screen to a specified character and attribute.
call "CBL_CLEAR_SCR" using character attribute returning status-code
character
pic
x.
attribute
pic
x.
status-code
See
the section Key
character |
The character to write. |
attribute |
The attribute to write. |
None
Returns the cursor position.
call "CBL_GET_CSR_POS" using screen-position returning status-code
screen-position
Group
item defined as:
row-number
pic
x comp-x.
column-number
pic
x comp-x.
status-code
See
the section Key
None
screen-position |
The screen position of the cursor. The top left corner is row 0, column 0. If the cursor is invisible, row-number and column-number are both set to 255. See the section Introduction to Screen Routines. |
Checks whether there is a character waiting to be read from the keyboard.
call "CBL_GET_KBD_STATUS" using key-status returning status-code
key-status
pic
x comp-x.
status-code
See
the section Key
None
key-status |
The status of the keyboard:
|
Some UNIX implementations do not allow you to poll the keyboard in this way. See the documentation supplied with your UNIX system to determine if this is the case in your implementation.
Returns the mouse event mask.
call "CBL_GET_MOUSE_MASK" using mouse-handle event-mask returning status-code
mouse-handle
pic
x(4) comp-x.
event-mask
pic
x(2) comp-x.
status-code
See
the section Key
mouse-handle |
Mouse identifier, obtained by earlier call to CBL_INIT_MOUSE. |
event-mask |
See the section Introduction to Mouse Routines |
This routine has no effect in UNIX environments.
Introduction to Mouse Routines
Returns the screen position of the mouse pointer.
call "CBL_GET_MOUSE_POSITION" using mouse-handle mouse-position returning status-code
mouse-handle
pic
x(4) comp-x.
mouse-position
Group
item defined as:
mouse-row
pic
x(2) comp-x.
mouse-col
pic
x(2) comp-x.
status-code
See
the section Key
mouse-handle |
Mouse identifier, obtained by earlier call to CBL_INIT_MOUSE. |
mouse-position |
The screen position of the mouse pointer. |
This routine has no effect in UNIX environments.
Introduction to Mouse Routines
Finds out the number of events in the queue.
call "CBL_GET_MOUSE_STATUS" using mouse-handle queued-events returning status-code
mouse-handle
pic
x(4) comp-x.
queued-events
pic
x(2) comp-x.
status-code
See
the section Key
mouse-handle |
Mouse identifier, obtained by earlier call to CBL_INIT_MOUSE. |
queued-events |
The number of events in the queue. |
This routine has no effect in UNIX environments.
Introduction to Mouse Routines
Returns information about the size of the screen.
call "CBL_GET_SCR_SIZE" using depth width returning status-code
depth
pic
x comp-x.
width
pic
x comp-x.
status-code
See
the section Key
None
depth |
Number of lines. |
width |
Number of columns. |
Makes the mouse pointer invisible.
call "CBL_HIDE_MOUSE" using mouse-handle returning status-code
mouse-handle
pic
x(4) comp-x
status-code
See
the section Key
mouse-handle |
Mouse identifier, obtained by earlier call to CBL_INIT_MOUSE. |
None
This routine has no effect in UNIX environments.
After this routine has been called, mouse events still take place, but the mouse pointer is not displayed.
Introduction to Mouse Routines
Initializes mouse support. This routine must be called before other mouse routines can be called.
call "CBL_INIT_MOUSE" using mouse-handle mouse-buttons returning status-code
mouse-handle
pic
x(4) comp-x
mouse-buttons
pic
x(2) comp-x
status-code
See
the section Key
None
mouse-handle |
Mouse identifier. You pass this to any mouse routines you call subsequently. |
mouse-buttons |
The number of buttons on the mouse. |
If status-code (or RETURN-CODE) contains a nonzero status on return from this routine, mouse handling is not available and calls to any of the mouse routines should not be made.
In UNIX environments this routine always returns a nonzero status-code.
Introduction to Mouse Routines
Waits until a character is typed and then reads it with no echo.
call "CBL_READ_KBD_CHAR" using char returning status-code
char
pic
x.
status-code
See
the section Key
None
char |
The character that was typed, in ASCII. |
Reads the mouse event queue and returns information about an event.
call "CBL_READ_MOUSE_EVENT" using mouse-handle event-data read-type returning status-code
mouse-handle
pic
x(4) comp-x.
event-data
See
the section Introduction to Mouse Routines
read-type
pic
x comp-x.
status-code
See
the section Key
mouse-handle |
Mouse identifier, obtained by earlier call to CBL_INIT_MOUSE. | ||||
read-type |
Indicates what to do if there are no events in the
queue:
|
event-data |
See the section Introduction to Mouse Routines |
This routine has no effect in UNIX environments.
If there are no events in the event queue, the return from this routine depends on the value of read-type. If read-type is zero, the routine returns immediately with all zero values in event-data. If read-type has a value of one, return is delayed until an event has been queued.
Introduction to Mouse Routines
Reads a string of attributes from the screen.
call "CBL_READ_SCR_ATTRS" using screen-position attribute-buffer string-length returning status-code
screen-position
Group
item defined as:
row-number
pic
x comp-x.
column-number
pic
x comp-x.
attribute-buffer
pic x(n).
string-length
pic
x(2) comp-x.
status-code
See
the section Key
screen-position |
The screen position to start reading at. The top left corner is row 0, column 0. See the section Introduction to Screen Routines. |
string-length |
The length of the string to read. |
attribute-buffer |
The attributes read from the screen. This data item must be at least as long as specified by string-length; positions in it beyond that length are unchanged. |
string-length |
If the end of the screen is reached the length read is returned in here. |
Reads a string of characters from the screen.
call "CBL_READ_SCR_CHARS" using screen-position character-buffer string-length returning status-code
screen-position
Group
item defined as:
row-number
pic
x comp-x.
column-number
pic
x comp-x.
character-buffer
pic x(n).
string-length
pic
x(2) comp-x.
status-code
See
the section Key
screen-position |
The screen position to start reading at. The top left corner is row 0, column 0. See the section Introduction to Screen Routines. |
string-length |
The length of the string to read. |
character-buffer |
The characters read from the screen. This data item must be at least as long as specified by string-length; positions in it beyond that length are unchanged. |
string-length |
If the end of the screen is reached, the length read is returned in here. |
Reads a string of characters and their attributes from the screen.
call "CBL_READ_SCR_CHATTRS" using screen-position character-buffer attribute-buffer string-length returning status-code
screen-position
Group
item defined as:
row-number
pic
x comp-x.
column-number
pic
x comp-x.
character-buffer
pic x(n).
attribute-buffer
pic x(n).
string-length
pic
x(2) comp-x.
status-code
See
the section Key
screen-position |
The screen position to start reading at. The top left corner is row 0, column 0. See the section Introduction to Screen Routines. |
string-length |
The length of the string to read. |
character-buffer |
The characters read from the screen. This data item must be at least as long as specified by string-length; positions in it beyond that length are unchanged. |
attribute-buffer |
The attributes read from the screen. This data item must be at least as long as specified by string-length; positions in it beyond that length are unchanged. |
string-length |
If the end of the screen is reached, the length read (in cells, that is, character-attribute pairs) is returned in here. |
Moves the cursor.
call "CBL_SET_CSR_POS" using screen-position returning status-code
screen-position
Group
item defined as:
row-number
pic
x comp-x.
column-number
pic
x comp-x.
status-code
See
the section Key
screen-position |
The screen position at which to put the cursor. The top left corner is row 0, column 0. See the section Introduction to Screen Routines |
None
To make the cursor invisible, set row-number and column-number to 255.
Sets the mouse event mask.
call "CBL_SET_MOUSE_MASK" using mouse-handle event-mask returning status-code
mouse-handle
pic
x(4) comp-x.
event-mask
pic
x(2) comp-x.
status-code
See
the section Key
mouse-handle |
Mouse identifier, obtained by earlier call to CBL_INIT_MOUSE. |
event-mask |
See the section Introduction to Mouse Routines |
None
This routine has no effect in UNIX environments.
CBL_GET_MOUSE_MASK should be called first to find out which events are enabled.
Introduction to Mouse Routines
Moves the mouse pointer.
call "CBL_SET_MOUSE_POSITION" using mouse-handle mouse-position returning status-code
mouse-handle
pic
x(4) comp-x.
mouse-position
Group
item defined as:
mouse-row
pic
x(2) comp-x.
mouse-col
pic
x(2) comp-x.
status-code
See
the section Key
mouse-handle |
Mouse identifier, obtained by earlier call to CBL_INIT_MOUSE. |
mouse-position |
The screen position to move the mouse pointer to. |
None
This routine has no effect in UNIX environments.
Introduction to Mouse Routines
Makes the mouse pointer visible.
call "CBL_SHOW_MOUSE" using mouse-handle returning status-code
mouse-handle
pic
x(4) comp-x
status-code
See
the section Key
mouse-handle |
Mouse identifier, obtained by earlier call to CBL_INIT_MOUSE. |
None
This routine has no effect in UNIX environments.
When the mouse support has been initialized by the CBL_INIT_MOUSE call, the pointer is not displayed until this routine is called. After this call the system displays the mouse pointer until a routine to hide the mouse or terminate mouse support is called. This routine cancels any collision area defined earlier by PC_SET_MOUSE_HIDE_AREA.
Introduction to Mouse Routines
Swaps a string of characters and their attributes with a string from the screen.
call "CBL_SWAP_SCR_CHATTRS" using screen-position character-buffer attribute-buffer string-length returning status-code
screen-position
Group
item defined as:
row-number
pic
x comp-x.
column-number
pic
x comp-x.
character-buffer
pic x(n).
attribute-buffer
pic x(n).
string-length
pic
x(2) comp-x.
status-code
See
the section Key
screen-position |
The screen position at which to start writing. The top left corner is row 0, column 0. See the section Introduction to Screen Routines |
character-buffer |
The characters to write. |
attribute-buffer |
The attributes to write. |
string-length |
The length of the string to write. If this would go off the end of the screen, the write finishes at the end of the screen. |
character-buffer |
The characters read from the screen. This data item must be at least as long as specified by string-length; positions in it beyond that length are unchanged. |
attribute-buffer |
The attributes read from the screen. This data item must be at least as long as specified by string-length; positions in it beyond that length are unchanged. |
string-length |
If the end of the screen is reached the length swapped (in cells, that is, character-attribute pairs) is returned in here. |
Introduction to Screen Routines
Terminates mouse support, releasing internal resources.
call "CBL_TERM_MOUSE" using mouse-handle returning status-code
mouse-handle
pic
x(4) comp-x
status-code
See
the section Key
mouse-handle |
Mouse identifier, obtained by earlier call to CBL_INIT_MOUSE. |
None
This routine has no effect in UNIX environments.
The routine releases internal resources allocated by CBL_INIT_MOUSE. After this routine, mouse-handle is no longer valid and calling any mouse routine other than CBL_INIT_MOUSE results in an error.
Introduction to Mouse Routines
Writes a string of attributes to the screen.
call "CBL_WRITE_SCR_ATTRS" using screen-position attribute-buffer string-length returning status-code
screen-position
Group
item defined as:
row-number
pic
x comp-x.
column-number
pic
x comp-x.
attribute-buffer
pic x(n).
string-length
pic
x(2) comp-x.
status-code
See
the section Key
None
The blink attribute is not supported on this COBOL system. Specifying that a character is to blink results in the character being displayed with a bright background color.
Introduction to Screen Routines
Writes a string of characters to the screen.
call "CBL_WRITE_SCR_CHARS" using screen-position character-buffer string-length returning status-code
screen-position
Group
item defined as:
row-number
pic
x comp-x.
column-number
pic
x comp-x.
character-buffer
pic x(n).
string-length
pic
x(2) comp-x.
status-code
See
the section Key
screen-position |
The screen position at which to start writing. The top left corner is row 0, column 0. See the section Introduction to Screen Routines |
character-buffer |
The characters to write. |
string-length |
The length of the string to write. If this would go off the end of the screen, the write finishes at the end of the screen. |
None
Introduction to Screen Routines
Writes a string of characters to the screen, giving them all the same attribute.
call "CBL_WRITE_SCR_CHARS_ATTR" using screen-position character-buffer string-length attribute returning status-code
screen-position
Group
item defined as:
row-number
pic
x comp-x.
column-number
pic
x comp-x.
character-buffer
pic x(n).
string-length
pic
x(2) comp-x.
attribute
pic
x.
status-code
See
the section Key
screen-position |
The screen position at which to start writing. The top left corner is row 0, column 0. See the section Introduction to Screen Routines |
character-buffer |
The characters to write. |
attribute |
The attribute to write. |
string-length |
The length of the string to write. If this would go off the end of the screen, the write finishes at the end of the screen. |
None
The blink attribute is not supported on this COBOL system. Specifying that a character is to blink results in the character being displayed with a bright background color.
Introduction to Screen Routines
Writes a string of characters and their attributes to the screen.
call "CBL_WRITE_SCR_CHATTRS" using screen-position character-buffer attribute-buffer string-length returning status-code
screen-position
Group
item defined as:
row-number
pic
x comp-x.
column-number
pic
x comp-x.
character-buffer
pic x(n).
attribute-buffer
pic x(n).
string-length
pic
x(2) comp-x.
status-code
See
the section Key
screen-position |
The screen position at which to start writing. The top left corner is row 0, column 0. See the section Introduction to Screen Routines |
character-buffer |
The characters to write. |
attribute-buffer |
The attributes to write. |
string-length |
The length of the string to write. If this would go off the end of the screen, the write finishes at the end of the screen. |
None
The blink attribute is not supported on this COBOL system. Specifying that a character is to blink results in the character being displayed with a bright background color.
Introduction to Screen Routines
Writes a specified attribute to a string of positions on the screen.
call "CBL_WRITE_SCR_N_ATTR" using screen-position attribute fill-length returning status-code
screen-position
Group
item defined as:
row-number
pic
x comp-x.
column-number
pic
x comp-x.
attribute
pic
x.
fill-length
pic
x(2) comp-x.
status-code
See
the section Key
screen-position |
The screen position at which to start writing. The top left corner is row 0, column 0. See the section Introduction to Screen Routines |
attribute |
The attribute to write. |
string-length |
The number of screen positions to write the attribute to. If this would go off the end of the screen, the write finishes at the end of the screen. |
None
The blink attribute is not supported on this COBOL system. Specifying that a character is to blink results in the character being displayed with a bright background color.
Introduction to Screen Routines
Writes a specified character to a string of positions on the screen.
call "CBL_WRITE_SCR_N_CHAR" using screen-position character fill-length returning status-code
screen-position
Group
item defined as:
row-number
pic
x comp-x.
column-number
pic
x comp-x.
character
pic
x.
fill-length
pic
x(2) comp-x.
status-code
See
the section Key
screen-position |
The screen position at which to start writing. The top left corner is row 0, column 0. See the section Introduction to Screen Routines |
attribute-buffer |
The attributes to write. |
string-length |
The number of screen positions to write the character to. If this would go off the end of the screen, the write finishes at the end of the screen. |
None
Introduction to Screen Routines
Writes a specified character and attribute to a string of positions on the screen.
call "CBL_WRITE_SCR_N_CHATTR" using screen-position character attribute fill-length returning status-code
screen-position
Group
item defined as:
row-number
pic
x comp-x.
column-number
pic
x comp-x.
character
pic
x.
attribute
pic
x.
fill-length
pic
x(2) comp-x.
status-code
See
the section Key
screen-position |
The screen position at which to start writing. The top left corner is row 0, column 0. See the section Introduction to Screen Routines |
character |
The character to write. |
attribute |
The attribute to write. |
string-length |
The number of screen positions to write the character-attribute pair to. If this would go off the end of the screen, the write finishes at the end of the screen. |
None
The blink attribute is not supported on this COBOL system. Specifying that a character is to blink results in the character being displayed with a bright background color.
Introduction to Screen Routines
Writes a string of characters to the screen starting at the current position and scrolling.
call "CBL_WRITE_SCR_TTY" using character-buffer string-length returning status-code
character-buffer
pic x(n).
string-length
pic
x(2) comp-x.
status-code
See
the section Key
character-buffer |
The characters to write. |
string-length |
The length of the string to write. If this would go off the edge of the screen, the screen is scrolled up a line and the write continues on the bottom line. |
None
Returns information about the shape of the mouse pointer.
call "PC_GET_MOUSE_SHAPE" using mouse-handle reserved-item mouse-ptr-shape returning status-code
mouse-handle
pic
x(4) comp-x.
reserved-item
pic
x(10).
mouse-ptr-shape
Group
item defined as:
char_AND_mask
pic
x comp-x.
attr_AND_mask
pic
x comp-x.
char_XOR_mask
pic
x comp-x.
attr_XOR_mask
pic
x comp-x.
status-code
See
the section Key
mouse-handle |
Mouse identifier, obtained by earlier call to CBL_INIT_MOUSE. |
reserved-item |
Reserved for future use. |
mouse-ptr-shape |
The bitmaps that would create the pointer's current shape. |
This routine is available only in DOS, Windows and OS/2 environments.
The masks in mouse-ptr-shape are bitmaps that, applied to a screen position, would superimpose the mouse shape upon it. The pointer shape is formed by PC_SET_MOUSE_SHAPE by ANDing the screen character at the mouse position with char_AND_mask, XORing the result with char_XOR_mask, and then displaying the result on the screen. The attribute is formed similarly.
Introduction to Mouse Routines
Defines an area ("collision area") where the mouse is to be invisible.
call "PC_SET_MOUSE_HIDE_AREA" using mouse-handle collision-area returning status-code
mouse-handle
pic
x(4) comp-x.
collision-area
Group
item defined as:
top-row
pic
x(2) comp-x.
left-col
pic
x(2) comp-x.
bottom-row
pic
x(2) comp-x.
right-col
pic
x(2) comp-x.
status-code
See
the section Key
mouse-handle |
Mouse identifier, obtained by earlier call to CBL_INIT_MOUSE. |
collision-area |
Defines the collision area. Whenever the pointer is in this area, it is hidden. A value of zeros in this item makes the whole screen a collision area. There can be only one collision area at any one time. |
None
This routine is available only in DOS, Windows V3.1 and 16-bit OS/2.
Sets the shape of the mouse pointer.
call "PC_SET_MOUSE_SHAPE" using mouse-handle reserved-item mouse-ptr-shape returning status-code
mouse-handle
pic
x(4) comp-x.
reserved-item
pic
x(10).
mouse-ptr-shape
Group
item defined as:
char_AND_mask
pic
x comp-x.
attr_AND_mask
pic
x comp-x.
char_XOR_mask
pic
x comp-x.
attr_XOR_mask
pic
x comp-x.
status-code
See
the section Key
mouse-handle |
Mouse identifier, obtained by earlier call to CBL_INIT_MOUSE. |
reserved-item |
Reserved for future use. |
mouse-ptr-shape |
The bitmaps to create the pointer's desired shape. |
None
This routine is available only in DOS, Windows and OS/2 environments.
The masks in mouse-ptr-shape are bitmaps that, applied to a screen position, would superimpose the mouse shape upon it. The pointer shape is formed by PC_SET_MOUSE_SHAPE by ANDing the screen character at the mouse position with char_AND_mask, XORing the result with char_XOR_mask, and then displaying the result on the screen. The attribute is formed similarly.
To call this routine you must have previously called PC_GET_MOUSE_SHAPE with the same mouse-handle. The data item reserved-item must be as preserved from that call.
Introduction to Mouse Routines
Sets the cursor type.
call X"A7" using function-code cursor-type
function-code
pic
x comp-x.
cursor-type
Group
item defined as:
cursor-end
pic
x comp-x.
cursor-start
pic
x comp-x.
function-code |
Value 17. |
cursor-end |
Scan line cursor ends on. |
cursor-start |
Scan line cursor starts on. |
None
This routine is available only in DOS, Windows and OS/2 environments.
Details of cursor start and end lines can be found in your IBM BIOS Technical Reference manual.
Before using this routine, use the CBL_CLEAR_SCR routine, to prevent possible errors.
Makes console I/O redirectable.
call X"A7" using function-code parameter
function-code
pic
x comp-x.
parameter
pic
x comp-x.
function-code |
Value 18. | ||||
parameter |
Action to perform:
|
None
This routine is available only in DOS, Windows and OS/2 environments.
Normally the RTE uses the BIOS to read the keyboard, and writes direct to the video map for all displays. This routine makes the RTE use operating system functions instead. This means the operator can use the operating system facilities for re-directing keyboard input and screen output.
Before using this routine, use the CBL_CLEAR_SCR routine, to prevent possible errors.
Returns the current screen type as recognized by the RTS.
call x"A7" using function-code parameter
function-code
pic
x comp-x.
parameter
pic
x comp-x.
function-code |
Value 25 |
parameter |
Bit settings indicating the type of screen as follows:
|
Before using this routine, use the CBL_CLEAR_SCR routine, to prevent possible errors.
Sets various configurable features of Adis, including enabling or disabling individual user function, Adis or data keys, or a series of consecutive keys at run time.
call x"AF" using function-code parameter-block
function-code
pic
x comp-x
parameter-block
Group
item defined as:
key-setting
pic
x comp-x
sub-fn-code
pic
x comp-x
first-key-id
pic
x comp-x
number-of-keys
pic
x comp-x
function-code |
Value 1 | ||||||||||
sub-fn-code |
One of:
|
Features are enabled or disabled until explicitly changed by another call to x"AF" or until the application terminates. The initial state of user function keys depends on the run-time operating system (see the chapter Enhanced ACCEPT/DISPLAY Syntaxfor details). Calls to enable or disable functions keys are additive. For example, if you call x"AF" to enable function key F1 and then make another call to enable F10, both keys are enabled.
The chapter Enhanced ACCEPT/DISPLAY Syntaxdescribes the features and parameter in detail.
Before using this routine, use the CBL_CLEAR_SCR routine, to prevent possible errors.
X"AF" Routines
Displays a character to the screen at the current cursor position.
call x"AF" using function-code char
function-code
pic
x comp-x
char
pic
x
function-code |
Value 18 |
char |
The character to be displayed. |
None
Before using this routine, use the CBL_CLEAR_SCR routine, to prevent possible errors.
X"AF" Routines
Sounds the terminal alarm.
call x"AF" using function-code parameter
function-code
pic
x comp-x
parameter
pic
x
function-code |
Value 22. |
parameter |
Reserved |
None
X"AF" Routines
Gets a character from the keyboard.
call x"AF" using function-code key-status
function-code
pic
x comp-x
key-status
Group
item defined as:
key-type
pic
x.
key-code-1
pic
x comp-x.
key-code-2
pic
x comp-x.
function-code |
Value 26 |
key-type |
The type of key read, as follows:
|
||||||||
key-code-1 |
When key-type is 1 or 2, contains the number
of the key; 0-127 for user-defined and 0-39 for Adis. See the chapter
Enhanced ACCEPT/DISPLAY Syntax for more details on function
keys.
When key-type is 3, contains the ASCII code of the key pressed When key-type is 9, contains an error code:
|
Before using this routine, use the CBL_CLEAR_SCR routine, to prevent possible errors.
X"AF" Routines
Creates a function-key table.
call X"B0" using function-code key-table
function-code
pic
x comp-x.
key-table
Group
item defined as:
key-pressed
pic
x comp-x
key-entry-list
Group
item defined as one iteration of the
following for each key to be detected:
key-entry-len
pic
x comp-x
key-entry
pic
x(n)
key-list-end
pic
x comp-x
function-code |
Contains 0. |
key-entry-len |
The length of key-entry in bytes (1 or 2). |
key-entry |
The code sequence produced by the required key. |
key-list-end |
Contains 0. |
key-pressed |
The table entry matching the key used, or zero if no match is made. |
This routine is avilable only on DOS, Windows and OS/2. It is specific to IBM PC compatible environments. If you intend to use your application in a non-IBM environment, use call x"AF".
Any keys defined by this call take precedence over those defined with AdisCF.
The function key table set up by AdisCF and used by call x"AF" is separate from the function key table used by call x"B0". Both can be enabled at the same time with all key sequences in the x"B0" table causing the carriage return x"0D" character to be returned to Adis.
Tests the status of the Shift, Alt, Ctrl and Lock keys.
call X"B0" using function-code status-block
function-code
pic
x comp-x
status-block
Group
item defined as:
status-inds
pic
x
status-id
pic
x comp-x
status-res
pic
x(6)
function-code |
Value 2. |
status-id |
Must be set to 2. It is overwritten by the call, so must be reset to 2 before each call. |
status-res |
Reserved. |
status-inds |
Contains bit settings indicating the status of the
keys (1=key pressed, 0=key not pressed) in the following order:
|
This routine is avilable only on DOS, Windows and OS/2.
For the Alt, Ctrl and Shift keys, the routine returns a 1 only if the key is actually pressed when the routine is called; for the other, the relevant bit is alternately set and unset each time the key is pressed.
Effective use of function 2 requires that the call is repeated at very frequent intervals.
Disables keyboard interrupts (Ctrl+Break on DOS, Windows and OS/2).
call X"B0" using function-code parameter
function-code
pic
x comp-x.
parameter
pic
x comp-x.
function-code |
Value 4. |
parameter |
Value 1. |
None
This routine disables keyboard interrupts for the rest of the application. It should be called before any subprograms are called.
This function has the same effect as the -i run-time switch.
Sounds the bell
call x"E5"
None
The duration and pitch of the bell depends on the environment.
Copyright © 2000 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names
used herein are protected by international law.
Panels | Windowing Support for Text-based Systems |