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, ABL 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 greater than the specified browse width, the browse displays a horizontal scrollbar to access the columns that do not display initially and you avoid the compilation error.

In character interfaces, there is no horizontal scrollbar for a wide browse but the user can scroll the browse one column at a time, using CURSOR-LEFT and CURSOR-RIGHT.

In Windows, the user can use the mouse wheel to scroll both horizontally and vertically. For vertical scrolling, the number of rows the browse scrolls per click of the mouse wheel is based on the scrolling lines property set in the Mouse Properties dialog box (which the user accesses via the Windows Control Panel). For horizontal scrolling, when the user rotates the mouse wheel down while pressing CTRL, the browse scrolls right. When the user rotates the mouse wheel up while pressing CTRL, the browse scrolls left.

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 at run time.

You can also use the SIZE phrase to set an absolute outer size of the browse in pixel or character units, and the AVM determines how many rows and columns to display. The AppBuilder always uses the SIZE phrase to specify the size of a browse that you lay out visually.

The browse also supports a WIDTH attribute for each column. Use this attribute to set the width of individual columns. When a column WIDTH sets the width of an updateable column smaller than the size specified by the FORMAT string, the browse cell scrolls to accommodate extra input up to the size specified by the FORMAT. You can take advantage of this behavior to allow the display of longer character fields. For example, you can use it where the WIDTH limits the display space the column takes up, but the user can scroll left and right through the entire text of the string up to the size of the FORMAT, using the left and right arrow keys.

The width of each column label is also a determining factor in the width of the displayed column. If the column label is wider than the data for that column, then the column is made wide enough to accommodate the label. To reduce this width, you can specify a shorter label in the browse definition (as you did in the OrderLine browse, for example). As you saw, you can also create stacked labels by inserting an exclamation mark (!) when the label should be divided between two lines. For more details, see Use stacked labels.