Progress
Language Tutorial
for Character
Designing an Interface for Viewing Report Data
In contrast to the Progress-controlled interface you saw in the last example, here’s what you need to create a user-controlled report viewing interface:
- A dialog box to contain the output. Therefore, you won’t need to leave room on your main display for the report data.
- An OK button in the dialog box to let the user dismiss the report.
- A temporary file to contain the report data. Having the control block output to a temporary file eliminates the pausing behavior.
- An editor widget with scrollbars to read the file into. The scrollbars let the user navigate the report in two directions.
The next example creates a dialog box interface for the same report you saw in the last example. The notes that follow the exercise explain the new code techniques you need to make this interface work.
- Open
lt-10-02.p
and run it. The following screen displays:
![]()
- Choose Report. The report dialog box appears as shown on the next page:
![]()
The report data appears in an editor that you can scroll through.
- Choose OK to dismiss the dialog box.
- Choose Exit and then press SPACEBAR to return to the Procedure Editor.
Here is the code for this example:
These notes explain the new code techniques used in this example:
- This editor is for the report data.
- The OUTPUT TO statement is your tool for directing output. This example directs output to the named file. This chapter covers directing output more fully in a later section.
- This FOR EACH uses the default down frame, and the STREAM-IO option reduces all widgets to textual data without decorations. Using the STREAM-IO option is a requirement when outputting to any destination other than the screen.
- Once you direct output to a destination, you need to close the output stream to return output to the default destination, which is the screen.
- This ASSIGN statement manipulates three editor attributes and one method to set up the dialog box. The READ-ONLY attribute prevents changes to the report content. The SENSITIVE attribute enables the editor, making the scrolling functions available. The TITLE attribute contains the dialog box title text. The READ-FILE method takes a valid filename and returns YES or NO to indicate if Progress successfully read the file contents into the editor.
- You only want to bring up the dialog box if the logical variable stat equals YES, which means that Progress successfully read the file into the editor.
- If you use a WAIT-FOR statement in a dialog box, you must use the HIDE statement to dismiss the dialog box.
- On all platforms that Progress supports, the output font designated by 3 is always a monospaced font, which are frequently used in printed reports. Assigning this font makes the editor contents mimic a printed report.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |