Progress
Language Tutorial
for Windows
Working with Text Widgets
The text widget is very similar to the fill-in field. You use a text widget when you want to display values as text strings, but do not want the user to change the data. In other words, text widgets are display-only fields.Figure 7–3 shows the parts of a text widget.
Figure 7–3: Parts of a Text Widget
![]()
The text widget has these advantages:
- Text widgets take up less screen space on many platforms and print more compactly, making them valuable for printed reports.
- You can easily switch between fill-in fields and text widgets. The new widget inherits many of the attributes of the old widget, such as format and label options.
- You can use text widgets to display static text in your interface display without creating a variable to hold the data.
This is the syntax for specifying a text widget.
Converting Fill-in Fields with the USE-TEXT Option
When you design a frame for data entry, but then decide to use the same frame for display only, you have to place a VIEW-AS TEXT phrase on every fill-in field in the frame to make the fields static (display only). Progress includes the USE-TEXT frame phrase option to make this conversion easy. Specifying USE-TEXT in a frame phrase converts the fill-in fields in the frame to text widgets.
The following code example shows this technique:
The USE-TEXT option on the screen I/O statement converts the fill-in fields in the frame to text widgets. The USE-TEXT option does not affect any other type of widget.
Static Text without Variables
To include text as part of a frame without first storing the text in a variable, simply place the text between quotes in a DEFINE FRAME or screen I/O statement. Progress creates a text widget to contain the string. You can then apply the options of the format phrase to the constant as this code example shows:
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |