Progress
Programming
Handbook
Graphical Environment
A graphical application can create and use multiple windows, including the default static window. Unlike character-based environments, where the window size is identical to the terminal screen, applications in graphical environments can create windows with any dimensions smaller, equal to, or larger than the terminal screen (with scroll bars, if necessary). Also, whereas characters in character-based windows typically have a fixed size and font (which is sometimes selectable), a graphical window can support many character sizes and styles, depending on the application and user interface. Graphical windows can also support a wide variety of frame sizes both smaller and larger than the window dimensions (with scroll bars, if necessary).
Character Units and Pixels
In a graphical environment, window layouts are generally measured in pixels, not characters. However, Progress lets you plan your window layout either in pixels or in character units. A character unit is equal in height to a fill-in widget using the default system font; it is equal in width to the average width of the characters in the default system font. Since the default system font determines the size of a character unit, you must consider what system font will be used when your application is running.
If you want your application to be portable across different platforms (or across different display resolutions within a single platform), use character units to lay out your screen displays. This way, you do not have to calculate your application layout in pixels, adjusting your calculations for different screen resolutions or different platforms.
Character Unit and Pixel Conversion
Note that character units are decimal values and pixels are integer values in Progress. If you set a pixel attribute to a decimal value, it is rounded to the nearest whole integer. This also means that if you set a character unit attribute (such as HEIGHT–CHARS) and then read it back, Progress can return a different value than the one you set based on the actual corresponding pixel value. This is a necessary rounding error because all graphic dimensions are ultimately stored as pixels, and the nearest whole pixel dimension might not exactly match the character units you specify.
For example, depending on the resolution and default system font of your interface, if you set the HEIGHT–CHARS attribute to 2.5, Progress might store and return its value as 2.51. This is because 2.51 most closely matches the number of pixels corresponding to 2.5 character units.
Thus, if your application uses character units to track widget size and location, be sure to reset your initial values to the values that Progress actually stores and returns.
Window Size
The window attributes in Table 25–1 let you query the interior size of a maximized window. When a window is maximized, it fills the entire terminal screen. The values returned by these attributes are the same whether or not the window is maximized.
The values returned by these attributes exclude the title bar, menu bar, message area, and status area. The interior of a window cannot exceed the area returned by these attributes. For more information on using graphical windows, Windows."
Frame Borders
The frame attributes in Table 25–2 let you query the border widths of your frames.
The values returned by these attributes change depending on whether the frame is selectable or movable. The BORDER–TOP and BORDER–TOP–CHARS attributes also change if the frame has a title.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |