Try OpenEdge Now
skip to main content
Programming Interfaces
Input/Output Processes : Colors and Fonts : Making colors and fonts available to an application
 

Making colors and fonts available to an application

OpenEdge® applications typically access a subset of the system's colors and fonts. This subset is specified in the following places:
*On Windows, in the registry or in an initialization file
*On UNIX, in the PROTERMCAP file
These environment settings establish a one-to-one mapping between a range of integers and the system's colors and fonts. These integers, in turn, correspond to entries in internal color and font tables. For example, on Windows, OpenEdge, as installed, maps the color red to the integer 4. To assign red to a widget, an application assigns the value 4 to the appropriate widget attribute. Thus, the widget is assigned the fourth color from the internal color table.
For graphical interfaces, you can specify up to 256 colors and 256 fonts. However, it is also possible to define an arbitrary color, expanding beyond the 256 colors defined in the color table, using the RGB–VALUE function. The font for an ActiveX control is set through standard font properties and has no programmatic relationship to the font table. For information about using colors and fonts for ActiveX controls, see the chapter that discusses Active X controls in ActiveXControl Support.
For character interfaces, you can specify up to 128 colors. When OpenEdge starts up, it loads the color and font definitions from the specified environment into internal color and font tables. The numbers for both your color and font definitions must increase by 1, starting from 0. OpenEdge stops loading its color or font table at the first skipped value.
For example, if colors 0, 1, 2, and 4 are defined, OpenEdge loads only colors 0 through 2 because color 3 is missing. If colors 1, 2, and 3 are defined, OpenEdge loads no colors because the definitions start after 0. The order of color and font definition does not matter; it is only important that a complete sequence of color and font numbers is defined.
For more information on specifying and editing environments for graphical and character interfaces, see OpenEdge Deployment: Managing ABL Applications.
* OpenEdge default colors
* OpenEdge default fonts