Progress
Language Tutorial
for Windows
Combo Box Programming Example
This example creates a simple combo box to represent a variable that lists U.S. time zones. Follow these steps to view the combo box:
- Open
lt-07-09.p
and run it. The display shown below appears:
![]()
This application calculates the correct local arrival time of a U.S. domestic flight.
- Choose the button for the Departure Time Zone combo box. The drop-down list appears. You select a value as you do with a selection list.
- Select a value for the Arrival Time Zone combo box.
- Enter a value for Departure Time and Flight Time.
- Choose the Calculate button. The application displays the local arrival time.
- Choose Exit, then press SPACEBAR to return to the Procedure Editor.
This is the code that created the display:
These notes help to explain the code:
- This DEFINE VARIABLE statement sets up the first combo box with the VIEW-AS phrase.
- This DEFINE VARIABLE statement uses the LIKE option to inherit the characteristics of the first combo box. The other options override specific inherited characteristics.
- This expression uses departure time and flight time to calculate arrival time. It also uses the LOOKUP method of the combo box to determine the index values of the selected time zones. The expression uses these values to adjust the arrival time to the arrival time zone. Finally, the MOD operator keeps the result in 24 hour format.
NOTE: Keep in mind that tooltip information can be added to a combo box widget. Refer to the code examples in either the Toggle Box Programming Example or the Radio Set Programming Example earlier in this chapter that show how to define the TOOLTIP option.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |