Progress
Programming
Handbook


Sizing a Browse and Browse Columns

Normally, the browse calculates its size based on the column width of each field and the number of display rows requested with the DOWN option. If the resultant browse is too big for the frame, Progress displays an error message at compile time.

Use the DOWN option to specify the number of rows to display and the WIDTH option to specify the width of the browse. If the total column width is wider than the specified browse width, the browse displays a horizontal scrollbar to access the columns that don’t display initially, and you avoid the compilation error.

NOTE: In character interfaces, there is no horizontal scrollbar for a wide browse, but you can scroll the browse one column at a time, using CURSORLEFT and CURSORRIGHT.

The horizontal scrollbar can work in two different ways. By default, the browse scrolls whole columns in and out of the viewport. To change this behavior to pixel scrolling, specify the NO–COLUMN–SCROLLING option of the DEFINE BROWSE statement or set the COLUMN–SCROLLING attribute to NO.

You can also use the SIZE phrase to set an absolute outer size of the browse in pixel or character units and Progress will determine how many rows and columns can be displayed. (Note that the User Interface Builder uses the SIZE phrase.)

The browse also supports a column WIDTH option. Use this option to set the width of individual columns. When a column WIDTH option sets the width of an updatable column smaller than the size specified by the FORMAT string, the browse cell will scroll to accommodate extra input up to the size specified by FORMAT.

The example below uses the WIDTH option on each column to set the desired column width and the WIDTH option with the DOWN option to size the browse as a whole:

p-br05.p
DEFINE VARIABLE credit-left AS DECIMAL LABEL "Credit Left". 
DEFINE QUERY q1 FOR customer SCROLLING. 
DEFINE BROWSE b1 QUERY q1 DISPLAY cust-num WIDTH 10 name WIDTH 23  
    credit-limit WIDTH 15 balance WIDTH 15  
    (credit-limit - balance) @ credit-left WIDTH 15  
    ENABLE credit-limit WITH 10 DOWN WIDTH 70 SEPARATORS  
    TITLE "Update Credit Limits". 
DEFINE FRAME f1 
    b1 
        WITH SIDE-LABELS ROW 2 CENTERED NO-BOX. 
OPEN QUERY q1 FOR EACH customer NO-LOCK. 
ENABLE ALL WITH FRAME f1. 
WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW. 

When you run this example, the following browse appears:


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095