Progress
Portability Guide
Field-level Widget Portability
Field-level widgets are any widgets that you can place in a frame or dialog box.
Button Size
Buttons are action widgets that allow the user to direct the operation of your application.
The size of buttons on Windows and character displays is different. Character displays create buttons that are one character unit high. Windows creates buttons that are about 1.2 times the size of a character unit. Since the size of a button differs on each platform, buttons might overlap in one environment, but position correctly in another. You can correct this difference by explicitly defining the size of the buttons and then laying them out. Buttons defined with the SIZE phrase are portable across all supported graphical environments.
Default Button Size
Table 3–6 lists the size of default buttons in each user interface.
Table 3–6: Size of Default Buttons Windows Character 1.2 times the size of a character unit One character unit high
A default button has an extra border on Windows. When defining a button, you can specify the DEFAULT option to change to the default style.
To comply with user-interface design standards, on Windows, place default buttons on the bottom or right side of the display.
Progress supplies prepackaged images for the up, down, left, and right arrows. The images are named BTN-UP-ARROW, BTN-DOWN-ARROW, BTN-LEFT-ARROW, and BTN-RIGHT-ARROW, respectively. These images are called system images and are portable across all graphical environments (but not usable in character-mode).
On Windows, you use the Windows Control Panel to assign colors to buttons and window titles. Therefore, any color assignments that you make from within a Progress application are ignored.
In environments without a mouse (for example, most character environments) buttons are sometimes awkward to use. Consider defining key sequences as equivalents to buttons for these environments. See the "Events" section for more information on key mappings. Also consider using pull-down menus with accelerator keys that have the same functions as the buttons. Then, for character layouts, you can hide the buttons and use the pull-down menus instead.
Using Buttons
You use buttons differently from the keyboard depending on your display environment. For example, on Windows, to choose a button you position to it and press RETURN or SPACEBAR. In character displays, choose a button, you position to it and press SPACEBAR.
On Windows, if you define a default button in a frame (using the DEFAULT-BUTTON option of the Frame phrase), then position to any button in that frame, you press RETURN to choose the current button. When you position to anything other than a button, pressing RETURN chooses the default button.
If you do not define a default button in a frame, you cannot press RETURN to choose a button unless the focus is on the button.
Rectangles and Images
Rectangles and images are graphic widgets that decorate your interface. Use rectangles to create different kinds of borders. An image widget is a container where you display an image from a bitmap file. Images allow you to include high-resolution graphics in your interface.
Character interfaces do not support images, since you cannot put bitmapped pictures on a terminal. Windows lets you create bitmaps (
.BMP
), icons (.ICO
), and cursors (.CUR
) for your applications. Bitmap files define monochrome or color bitmaps. Icon and cursor files define a family of images. For the best portability, omit file extensions when referencing an image file to allow Progress to search for a file with the appropriate file extension:
Progress first searches the current working directory and then searches the PROPATH for matching filenames and extensions that a platform supports. Windows first searches for
.BMP
,.ICO
, then.CUR
. Omitting file extensions makes your application more flexible, although the additional searching might make your application run slower.Images are generally not portable across different display types. For example, a Windows icon is 32 x 32 pixels. When compiled at 800 x 600 resolution (with small fonts), Progress converts this dimension to approximately 1.5 x 1.2 character units and stores it in the r-code. If you move that r-code to a system with 1024 x 768 resolution (with large fonts), the character units (1.5 x 1.2) are interpreted as 45 x 40 pixels. Since the icon remains the same size, you might have empty screen space. To avoid this, do not use explicit size information; instead let Progress adjust the images correctly or specify the absolute size in pixels for consistency on all resolutions.
If you are using an image on a button, assign both an image and a label to the button to make your code portable between graphical and character interfaces. In graphical interfaces, Progress uses an image; in character interfaces, Progress uses a label.
Editor and Selection List Widgets
There are two ways you can specify size for an editor widget or a selection list widget. You can use the standard SIZE phrase or the WIDTH and HEIGHT attributes to specify the outside dimensions of the widget. You can also specify inner dimensions for these two widgets using the INNER-CHARS and INNER-LINES options, or attributes of the same name.
Using SIZE to specify outer dimensions in character units ensures that the object is the same relative size on all platforms. However, on some systems with some fonts, the widget might end up with partial characters inside the bounding rectangle. The right-most visible character in the widget might get clipped by the right edge of the widget, or the bottom line of characters might be partially clipped by the bottom edge of the widget.
Using INNER-CHARS and INNER-LINES ensures that an integral number of characters are visible in a widget on all platforms, so there are no partial characters. These phrases tell the 4GL exactly what you want to appear inside of the widget; however, the outer dimensions of the widget vary somewhat between systems. The widget might overlap another widget or leave too much gap between widgets on another system.
On Windows, when a selection list has input focus, you can press an alphabetic character on the keyboard to select the next entry in the list that begins with that character. The search begins from the current selection and moves forward through the list.
For information on using the editor and selection list widgets, see Programming Considerations."
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |