Progress
Programming
Handbook
Rectangles
Rectangles serve as decoration and can be displayed in a frame or in a frame background. Rectangles are display-only, and you cannot tab to a rectangle. Rectangles can receive user input only if they are movable or resizable. See "Direct Manipulation," for more information on moving and resizing widgets. Also, as previously mentioned, you can define ToolTip values for rectangles.
In a rectangle, the foreground color (FGCOLOR) is used for the edge and the background color (BGCOLOR) is used to fill the interior. In a character interface, the display color (DCOLOR) is used to fill the interior. The default values for unspecified colors are the owning frame’s foreground and background colors. You can use the EDGE–PIXELS or EDGE–CHARS attributes to set the thickness of the rectangle’s edge. The default edge is 1 pixel in graphical interfaces and 1 character in character interfaces. Use the NO–FILL option to create a hollow, transparent rectangle.
NOTE: The minimum size for a rectangle is character mode is 1 character high and 1 character wide. If you specify the size in pixels, Progress rounds down to a lower character. If the result is a dimension of less than 1 character, Progress does not display the rectangle.If you specify an edge width of 0 and you do not specify a background color, you will not see the rectangle because it inherits the background color from its frame. To see the rectangle, you must either set the background color or specify an edge width that is greater than 0.
Table 18–1 shows the various effects that you can achieve by using different combinations of the FGCOLOR, BGCOLOR, and NO–FILL options in a graphical interface. The table assumes that the application’s color table contains red in the first location and blue in the second.
For example, the following code fragment defines a hollow rectangle with a border that is either one pixel (in graphical interfaces) or one character (in character interfaces) thick. The border is drawn in the frame’s foreground color. If you want a solid fill rectangle without a border, specify 0 for the EDGE–PIXELS or EDGE–CHARS attribute.
NOTE: In a character interface, a rectangle’s proportions are determined by the proportions of the character set. For example, if a character set’s height is two times the width, specify a SIZE option of 2 BY 1 if you want a square.Some character interfaces support line graphics characters. If you want Progress to use these characters when drawing a rectangle, specify the GRAPHIC–EDGE option in the DEFINE RECTANGLE statement or set the GRAPHIC–EDGE attribute to TRUE. The GRAPHIC–EDGE attribute is ignored for a minimum-sized character rectangle (1 character by 1 character). In a graphical interface, Progress ignores the GRAPHIC–EDGE option and attribute setting.
At run time, an application can query or set the rectangle’s fill or edge width using the FILLED and EDGE–PIXELS or EDGE–CHARS attributes.
Usually, you should put any rectangles into the frame background. If you put a rectangle in the foreground in character mode, you should display the rectangle before displaying anything else in the frame. This prevents the rectangle from overlaying other widgets.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |