The library ConsoleLib also includes system variables of type PresentationAttributes. The system variables control visual aspects of displayed output. To change aspects of your display, you can change those variables by setting the PresentationAttributes fields color, highlight, and intensity. For details on those fields, see PresentationAttributes fields in EGL consoleUI.
A window is a rectangular area in which you can place other visual entities that are represented as variables.
When you display a window and no other windows are in effect, the new window is inside the screen window, which is a rectangle that has the basic characteristics of any window in the operating system. This is not the case in UNIX® when the Curses library is in use; there the display of a consoleUI window puts the existing terminal window into windowing mode.
Any additional window that you display appears in the content portion of the screen window, usually on top of the window that you already opened. A side-by-side presentation of windows is also possible.
When you declare a window, you can set various properties. Position, for example, is the location relative to the upper left corner of the display; and size is the window's height and width in number of characters. You may use variables as well as literal values to specify both size and position.
myWindow WINDOW {name="myWindow", position = [2,2], size = [18,75], color = red, hasborder=yes};
You display a window by using an EGL function whose name begins with ConsoleLib.openWindow. If you have not displayed a window when presenting other data, EGL provides a window for you.
myPrompt Prompt { message = "Type your ID: "};
You display a prompt by including the variable in an openUI statement, which binds the prompt to a variable of type String, but only for input. You can configure the prompt to accept a single character or a string.
myField ConsoleField ( name="myFieldName", position=[1,31], fieldLen=20, binding = "myVariable" );
* ConsoleField { position=[2,5], value="Title: " };
It is highly recommended that when you declare a named consoleField, you use the same name for the consoleField and for the value of the name attribute within the consoleField. However, different names are valid for those two uses. You would reference the consoleField name (like myField) when access to the consoleField is resolved at generation time. You would reference the name-attribute value (like myFieldName) when access is resolved at run time, as when the consoleField is used to define an event in the openUI statement.
The consoleForm is a record of subtype ConsoleForm and can include not only consoleFields, but any of the fields that are valid in any EGL record.
To allow for user interaction with only a subset of consoleFields in the consoleForm, you can list the consoleFields in the openUI statement, either in explicitly or by referencing a dictionary. Like the arrayDictionary, the dictionary is declared in the consoleForm and references consoleFields that are also declared in the consoleForm.
EGL does not display any primitive variable that you declare in the consoleForm. You can use such a variable to bind a consoleField, as you can use a variable declared outside of the consoleForm.
Any binding specified in the openUI statement overrides the default binding in total; none of the consoleForm-declaration bindings remain.
For details on the property isConstruct, see OpenUI statement.
Tab order is the order in which the user tabs from one consoleField to another. By default, the tab order is the order of the consoleFields in the consoleForm declaration. If you provide a list of consoleFields in an openUI statement, the tab order is the order of consoleFields in that statement; similarly, if you provide a dictionary or arrayDictionary in an openUI statement, the tab order is the order of consoleFields in the declaration of the dictionary or arrayDictionary.
By default, the user exits a consoleForm-related openUI statement by pressing the Esc key.
A menu is a set of labels displayed horizontally. One label is for the menu as a whole and one for each menuItem in the menu. To ensure that a response occurs when the user selects a particular menuItem, you reference the menu as a whole in the openUI statement and reference the menuItem in an OnEvent clause of that statement.
A menuItem displays a label and is used as described in the previous section.
Related concepts
ArrayDictionary
Console user interface
Dictionary
Related reference
ConsoleField properties and fields
ConsoleForm properties in EGL consoleUI
EGL library ConsoleLib
ConsoleUI screen options for UNIX
Menu fields in EGL consoleUI
MenuItem fields in EGL consoleUI
openUI
PresentationAttributes fields in EGL consoleUI
Prompt fields in EGL consoleUI
Window fields in EGL consoleUI
Related tasks
Creating an interface with ConsoleUI