Release 10.1A: OpenEdge Development:
Progress 4GL Handbook

> ## Changing the test window for the OrderLine browse

> You can try out some of the browse options using the browse you defined for a temp-table based on the OrderLine table in Chapter 11, " Defining and Using Temp-tables."

> | To change the test window:

> 1. Open the `CustBrowseWin4.w` procedure and save it as `CustBrowseWin5.w`.

> 2. Remove the Save Position and Restore Position buttons, and the New State and Number of Matches fill-ins.

> 3. Remove these lines from the Main Block:

>     ASSIGN cState = Customer.State
>            iMatches = NUM-RESULTS("CustQuery").
>       DISPLAY cState iMatches WITH FRAME CustQuery.

> The default position for the OrderLine browse was to the right of the Order browse.

> 4. To keep the window from being so wide, change its position to be explicitly below the OrderBrowse in the `VALUE-CHANGED` trigger block for the OrderBrowse:

>     DO:
>       RUN h-fetchOlines.p (INPUT Order.OrderNum, OUTPUT TABLE ttOline).
>       OPEN QUERY OlineQuery FOR EACH ttOline.
>       DISPLAY OlineBrowse AT ROW 14 COLUMN 5 WITH FRAME CustQuery.
>       ENABLE OlineBrowse WITH FRAME CustQuery.
>     END.

> 5. Resize the window so that it is somewhat narrower but taller than it was before. Experiment with it so that it is large enough to display the OrderLine browse when you run it:

> 6. Now that you better understand the complete syntax for defining a browse, take another look at the browse definition you created for Order Lines in the Definitions section of your window procedure:

>     DEFINE BROWSE OlineBrowse
>       QUERY OlineQuery NO-LOCK DISPLAY
>           ttOline.Ordernum
>           ttOline.LineNum LABEL "Line"
>           ttOline.ItemNum LABEL "Item" FORMAT "ZZZ9"
>           ttOline.ItemName FORMAT "x(20)"
>           ttOline.TotalWeight
>           ttOline.Price FORMAT "ZZ,ZZ9.99"
>           ttOline.Qty
>           ttOline.Discount
>           ttOline.ExtendedPrice LABEL "Ext.Price" FORMAT "ZZZ,ZZ9.99"
>         WITH NO-ROW-MARKERS SEPARATORS 7 DOWN ROW-HEIGHT-CHARS .57.

> The definition has the necessary browse name and query name, and the optional `NO-LOCK` keyword, which could have been left off because it’s the default. This is followed by the list of temp-table fields to display as browse columns. A browse column definition has a long list of available display options, including the `LABEL` and `FORMAT` that you specified for some of them. Because there is no `ENABLE` phrase, the browse is read-only.

> The browse options phrase specifies:

> - `NO-ROW-MARKERS` — Provides the default when there are no enabled columns.
> - `SEPARATORS` — Provides the lines between columns and rows.
> - `7 DOWN` — Provides the height of the browse in terms of rows displayed (because there is no `WIDTH` phrase all columns are displayed in full).
> - `ROW-HEIGHT-CHARS` — Specifies the precise height of each row. The value 57 is the same value Progress would provide for the default font if you left this option out.

> You can experiment with changing some of these options to see how they affect the appearance of the browse.

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