Progress
Programming
Handbook
Scrolling Frames
Scrolling frames are specialized down or one-down frames that allow the user to move a highlight bar through multiple iterations of data. Most often, scrolling frames are down frames. You use the SCROLL Frame phrase option together with the CHOOSE statement to create this type of frame.
NOTE: This feature is supported for backward compatibility. You can usually use either a browse widget or selection list instead of CHOOSE and SCROLL. For more information on browse widgets, see Database Access." For information on selection lists, see Representing Data."The SCROLL statement opens a row and moves data in a frame with multiple rows. You can use the SCROLL statement to scroll data up or down to display another line in a frame. The following procedure shows how you might use this statement:
This procedure produces the following output:
![]()
Use the arrow keys to move the highlighted bar to the fifth customer. Type C for create.
![]()
At this point, you can add a new customer to the database by typing the customer information on the open line. The
p-scroll.p
procedure uses SCROLL and CHOOSE to allow the user to browse through information, then perform actions with the information.The
p-scroll.p
procedure creates a scrolling frame of five fields. The frame displays the cust–num, name, address, city, and postal–code for each customer. The status default message displays “Enter C to create, D to delete” as long as the procedure runs. You use arrow keys to move the highlighted cursor bar through lines of the scrolling frame, and you can add or delete customers from the database. The CHOOSE statement allows you to move the highlight bar.The SCROLL statement controls the scrolling action in the frame when you create and delete customers. You add a customer to the database by typing C. Create opens a line in the frame and the SCROLL statement moves data below the line down. Then you type the new customer information into the frame. You type D to delete a customer from the database. When you delete a customer, SCROLL moves the rows below the deleted customer row up into the empty line.
The
p-scroll.p
procedure works as follows:
- The SCROLL option on the Frame phrase creates a scrolling frame for the customer information.
- The CHOOSE statement allows the user to scroll through the list of customer numbers with a highlighted bar, and it also allows the user to select a location to insert or delete an item from the list.
- When the user types C for create, the SCROLL FROM–CURRENT DOWN statement opens a space for another customer above the highlighted customer.
- When the user types D for delete, the SCROLL FROM–CURRENT statement closes the space left by the deleted customer. However, when you use a SCROLL FROM–CURRENT statement, Progress opens a line at the bottom of the scrolling frame. The remaining statements in this block fill in the opened frame line with record information.
The
p-scroll.p
procedure uses UP and DOWN statements to control the current cursor position. These statements behave differently with scrolling frames than with regular down frames. If the cursor is on the top line of a frame, the UP statement opens a line at the top of the screen and moves the remaining frames lines down one line. This is also what happens if you use the SCROLL DOWN statement. Similarly, if the cursor is on the bottom line of a frame, the DOWN statement opens a line at the bottom of the screen and moves the remaining frame lines down one line.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |