The DP4 User Interface is implemented using the Terminal manager, which is responsible for providing almost all the functions DP4 programs need that are not database related (and database functions that need a user interface).
The functions used most often are those that relate to providing programs with a user interface. Most of these functions depend on maps. Maps contain information about the text, edit boxes, buttons and images a program needs to display to provide the user interface. For an introduction to the user interface related parts of the terminal manager you may like to consult the User Interface section of the Introduction to the DP4 ADE.
The DP4 user interface does not use the "event driven" model which became popular with the advent of C++ and Windows. Instead it uses a traditional top down approach to programming. A DP4 C program will typically start off by asking the user to select an option from a menu, then invoke one or more dialogs or do some work, and then return to the menu to ask the user what to do next. We think this makes for more maintainable programs, as the program logic usually closely reflects the business logic - rather than being obscured by state tables or a mass of functions to enable and disable parts of the user interface. Perhaps surprisingly it is very easy to make a program written this way behave in a very responsive way. For example you can arrange for clicking on part of the screen to automatically send your program the required input that will cause it to navigate to the required part of the code. The program will only fail to arrive there if there is some error condition that the user must correct first, and typically the program will display the appropriate message more or less automatically.
The following pages introduce some of the main groups of user interface related functions:
The terminal manager also contains a group of file related functions, and numerous low level functions, that a program can use to remain independent of calls to the operating system. Most of these have names beginning with tf_() and trm_(). You will have to consult the alphabetic function reference to find out about these functions.