The Window Control Tools are the third major component of ACCENT R's window development language. Window Control Tools allow screen-oriented applications to be implemented without concern for the type of video terminal being used. In other words, there is no need to be concerned with the low-level character sequences required for manipulating the terminal screen. When this set of tools is used, the current screen display is always remembered by ACCENT R.
ACCENT R does not duplicate what has already been displayed on the screen and eliminates unnecessary terminal output. This also means that any input/output interfering with the input /output performed by the Window Control Tools can be eliminated from the screen.
The Window Control Tools are a basic and comprehensive package. The Menu Design Tool and the Form Design Tool are implemented using the Window Control Tools.
Menus and forms are examples of windows. Thus, text messages, lines, or rectangles in menus or forms may be dynamically updated using the Window Control Tools.
The basic window operations can be separated into four categories:
Creating a window
Input through windows
Output through windows
Manipulating windows
Each of these window operations is described in the following pages. Each one of the system functions and statements/commands mentioned are described later in this section.
Before any of the Window Control Tools are used, a window must be created. The system function, @CREATE_WINDOW, is used to create a window. This system function allows the characteristics of the window being created to be specified . After the window is successfully created, a unique non-zero window ID is returned by this system function. This window ID must be used by all subsequent Window Control Tools which operate on this window. The number of windows which can be created is limited only by the available virtual address space.
The @CREATE_WINDOW system function allows the specification of the following window characteristics:
- Dimensions of the window.
- Default rendition applied to the window output.
- Window attributes.
Window attributes are the characteristics that specify whether or not the window:
- Is surrounded by a border (which may be labeled).
- Echoes control characters like form-feed, vertical tab, etc.
- Shows an icon (usually diamond-shaped) when text wraps past the right edge of the window.
After the window is created, it stays with ACCENT R until deleted. Therefore, if the window ID is globally stored (such as in a Global Storage), it can be shared by various Process Modules and Command Modules. Any operation may be performed on a window at command level.
The Window Control Tools offer a complete set of output operations performed through the window. Any output written to the window must be performed by using the Window Control Tools. The output operations are:
- Controlling cursor position
- Editing the output
- Scrolling the output
- Drawing horizontal or vertical lines or rectangles
Text cannot be written outside the boundary of the window. Any output to a window is not seen on the screen unless the window is pasted to the part of the drawing board that is visible on the screen. If the window is not pasted, or the window is pasted in a position that is invisible, such output is only reflected behind the scene.
There is one cursor associated with each window. All cursor positions specified during the window output operation are relative to the origin of that window. When a window is first created, the cursor for that window is positioned at row 1 and column 1 of the window. Various output operations to the window move the cursor.
The current cursor position can be determined within a window by using two separate system functions, @GET_COLUMN and @GET_ROW. The former returns the current column position of the cursor. The latter returns the current row position.
The cursor can also be set to an arbitrary position in the window. The Window Control Tools offer the following cursor positioning statements/commands.
- SCREEN HOME_CURSOR sets the cursor to one of the four corners of the window.
- SCREEN SET_CURSOR_ABS sets the cursor to a specified row and column position.
- SCREEN SET_CURSOR_REL sets the cursor to a specified row and column position relative to the current cursor position.
This section describes the text writing and editing offered by the Window Control Tools. In the text writing operations, there can be character-oriented output or line-oriented output to the window. Erasure, deletion, insertion, and changing rendition operations are also part of the text editing.
In character-oriented output operations, the cursor needs to be set to a specific position in the window and display the text. The character-oriented text output statements/commands are:
- SCREEN PUT_CHARS writes normal size characters to a window.
- SCREEN PUT_WIDE_CHARS writes double wide characters to a window.
- SCREEN PUT_BIG_CHARS writes double wide, double high characters.
Note that these different types of characters cannot be mixed on the same line in a window.
The line-oriented output operation allows the output of one line of text after another. The line-oriented text output statements/commands are:
- SCREEN PUT_LINE writes one line of text to a window beginning at the current line.
- SCREEN PUT_WITH_SCROLL writes text to a window beginning at the current line. Once text reaches the bottom or top line of the window, (depending on the scrolling direction) the subsequent execution of this statement/command causes the window to scroll.
The erasure operation erases a portion of the window by filling it with blanks. No other part of the window is affected. The Window Control Tools offer the following erasure operations:
- SCREEN ERASE_CHARS erases a specified number of characters within a given line.
- SCREEN ERASE_LINE erases characters in a line from the specified starting position to the end of the line.
- SCREEN ERASE_WINDOW erases all or part of a window.
The deletion operation deletes a part of a window. The statements/commands to perform such operations are:
- SCREEN DELETE_CHARS deletes a specified number of characters from a single line. The characters to the right of the deleted characters on the same line are moved one character position to the left, for each character that is deleted. If no character follows the deleted characters on the same line, the remainder of the line is filled with the blanks.
- SCREEN DELETE_LINE deletes a specified number of lines from the window. Lines beneath the deleted line are moved up to fill the deleted line. New lines introduced at the bottom of the window are blank.
The insertion operation allows text to be inserted into a window. The insertion statements/commands are:
- SCREEN INSERT_CHARS inserts characters in the specified position. Existing characters in these positions are shifted to the right. Characters shifted beyond the rightmost column of the window are discarded.
- SCREEN INSERT_LINE inserts a line of text in the specified position. Existing lines in the window can be scrolled up or down to make room for the new line. Lines scrolling off the top or the bottom of the window are discarded.
The rendition can also be changed for all or part of a window by using the SCREEN CHANGE_RENDITION statement/command. The rendition can be one or any combination of the following attributes:
- Blinking characters
- Characters in higher than normal intensity
- Characters in reverse video
- Underlined characters
The statements/commands that allow the window to scroll are:
- SCREEN SET_WINDOW_SCROLL_REGION creates a scrolling region in a window. All or part of the window may be specified to be a scrolling region.
- SCREEN SCROLL_WINDOW_AREA scrolls a region of a window.
Besides the text output, the Window Control Tools allow the output of lines or rectangles in a window. Both horizontal and vertical lines are allowed. The draw statements/commands are:
- SCREEN DRAW_LINE draws either a horizontal or a vertical line.
- SCREEN DRAW_RECTANGLE draws a rectangle in a window.
The Window Control Tools provide statements/commands for accepting input from a terminal. Data may be obtained from the keyboard in two ways.
One keystroke may be read at a time without echoing the character.
If echoing the character through the window, it must be used in conjunction with the output tools described in the previous section. Different types of data may also be read from the keyboard and display it in edited form on the window with a picture format.
The Window Control Tools can read five different types of data provided by ACCENT R. They are CHAR, INT, FLOAT 5, FULLDATE and DATE.
There is an option of assigning the default value for the input operation if no data is entered through the keyboard.
The picture format can be any of the valid formats provided by ACCENT R.
The system functions that obtain the data from the keyboard are listed below.
- @READ_KEYSTROKE reads one keystroke from the keyboard without echoing the character. The time out factor may be specified in this function.
- @READ_CHAR reads alphanumeric data from the keyboard.
- @READ_INT reads integer data from the keyboard.
- @READ_NUM reads numeric data from the keyboard.
- @READ_DATE reads date data from the keyboard.
Note that the above system functions obtain data from the keyboard through a window. Therefore, the window specified by the system function must have already been pasted on the drawing board.
The statement/command SCREEN SET_KEYPAD_MODE sets the numeric keypad of the terminal to either numeric or application mode.
This section describes the tools used to manipulate windows on the drawing board. The following statements/commands perform these operations:
- SCREEN PASTE_WINDOW pastes a window on the drawing board. It is visible only if the window is pasted within the scope of the terminal screen.
- SCREEN UNPASTE_WINDOW removes a window from the drawing board.
- SCREEN DELETE_WINDOW deletes an existing window.
- SCREEN REPAINT_SCREEN refreshes the entire terminal screen. This statement/command erases all noise characters and any terminal output not performed by the Screen Management Facility (SMF). Only output performed by SMF remains on the screen.
- SCREEN FLUSH_BUFFER flushes every character in the window buffer to the terminal screen.
- SCREEN LEAVE_SCREEN allocates all or part of the screen for output operations to be performed outside of SMF.
- SCREEN KILL_SCREEN deletes all existing windows and clears the terminal screen.
Rendition (video attributes) |
@NORMAL
@BLINK @BOLD @REVERSE @UNDERLINE |
Position (cursor) |
@UPPER_LEFT
@LOWER_LEFT @UPPER_RIGHT @UPPER_RIGHT |
Direction (scroll) |
@UP
@DOWN |
wrap_flag (text) |
@WRAP
@NO_WRAP |
border_side |
@BOR_TOP
@BOR_BOTTOM @BOR_RIGHT @BOR_LEFT |
erase_flag |
@ERASE
@NOERASE |
new_mode (keypad) |
@APPL,
@KP_APPL @KP_NUM |
window_attributes |
@BORDER
@TRUNC_ICON @WINDOW_CTRL |