Lesson 6 - Exploring the Browse Procedure

Top  Previous  Next

This topic:

 Tells you how to use the List box Formatter to format your LIST and COMBO controls.

 Tells you how to format list box controls, including how to create multi-column list boxes, and hierarchical lists.

 

Creating List Boxes

The heart of ALL Browse procedures centers on scrolling (or browsing) through selected table information using a LIST control.

The LIST control is most useful for presenting a great number of choices to the user. It can display a large amount of data in a small area, which has led to its use as an all-purpose data control. Using Clarion you can create list boxes which look like spreadsheets, perform drag and drop tasks, and more.

Further, you may use Control templates (BrowseBox, FileDrop, etc.) to generate code that declares the LIST and manages it too (loads it, scrolls it, locates items, selects items for processing, etc.).

As you read this section, please be aware that all the information that applies to LIST controls also applies to COMBO controls.

When you create a list box (whether a control template or a simple control), you define its data source, its format, and its functionality. The development environment divides these property definitions among three dialogs:

The List Box control’s Properties Pad specifies the queue that supplies the list data, the general scrolling capability, and whether the list is a drop-down list or a regular list. In other words, the List Properties dialog specifies all the properties of the list box that are not column-specific.

The List Box control’s Properties options are discussed in more detail in the List Control Properties core help topic.

 

List Box Formatter

The List Box Formatter dialog lets you add, delete, reorder, and resize the specific columns that are displayed in the list box. In other words, the List Box Formatter dialog specifies all the column-specific properties of the list box.

The List Box Formatter is a visual design tool—a subset of the Window Designer—that generates Clarion Language statements to format your application’s LISTs. The List box Formatter provides a wide degree of flexibility to create and modify your list boxes, drop-down list boxes, and combo boxes. You may invoke the List Box Formatter from the Window Designer or from the Report Designer.

Once you specify a QUEUE to provide the data for the list (done automatically when specifying a BrowseBox template), the List box Formatter lets you customize your list in the following ways:

·

You can set the number, content, and formatting of columns, with or without resizable borders.

·

You can specify that a row from the QUEUE occupy more than one list box row.

·

You can add horizontal scrollbars for each column or group of columns in the listbox.

·

You can specify the focus on rows or individual "cells," spreadsheet fashion.

·

You can specify headers for the list box columns.

·

You can add a locator control that allows users to quickly find the item they need.

·

You can enable selection of multiple rows in the list.

·

You can enable colorization of items in the list.

·

You can enable iconization of items in the list.

·

You can enable nesting (indenting) of items in the list.

·

You can create column tool tips.

 

List Overview

LIST controls come in a variety of forms, the most common of which are list boxes, drop-down list boxes, and combo boxes.

A list box, by convention, is a read-only display of data in a tabular format (rows and columns). It is scrollable and may display many rows and columns. It efficiently displays large amounts of data.

A drop-down list box, by convention, is a read-only display of mutually exclusive selections or choices. It is often scrollable and is called a drop-down list because it initially appears as a single row, but "drops down" to display multiple rows, like a menu. It forces valid user selections, provides a visual cue reminding the user that a selection is required, offers a default selection, and doesn’t take up much screen space.

A combo box is a drop-down list box with the ability to accept user input.

When creating a list box control, you define its data source, its functionality, and its format. Clarion’s development environment divides these property definitions among several dialogs:

·

The List Box Properties Pad specifies a drop-down list versus a regular list, specifies the queue that supplies the list data, and specifies the general scrolling capability, that is, all the properties of the list box that are not column-specific.

·

The List box Formatter dialog lets you add, delete, reorder, and resize the specific columns displayed in the list box. And it defines the appearance and behavior of individual list box columns as well as groups of columns. For example, define individual column headers, widths, and scrolling, or spread a header across several columns. This dialog is discussed here.

After you’ve started defining your list box with the Formatter and Properties Pad, these are the general steps for completing your list box.

 

Understanding the List Box Formatter

 

Add columns, one by one, and format them

From the Window Designer, RIGHT-CLICK on the LIST or COMBO control, then choose List Box Format... from the popup menu to open the List box Formatter dialog.

The Sample List Box

The List Box Formatter displays a representation of the list box—the sample list box. Each field appears as a column in the list box. If any field contains a header, a header row appears over the list. You format the columns one by one, which updates the sample list box.

The List Box Formatter does not display a vertical scroll bar, even if you checked the Vertical box in the List Properties dialog. However, the vertical scroll bar does appear at run time, if the queue contains more items than will fit in the list box.

 

 

1. Press the Add Field button to add a new field (column).

When working from within the Application Generator, choose a column from the Select Column dialog. The List Box Formatter adds the selected column.

2. In the List Box Properties Pad, set the column-specific heading width and text, data format, scrolling, and other attributes.

3. Use the Color and Style and Flags property categories to set the column-specific icons, colors, fonts, and nesting.

 

For each setting you make, the List box Formatter creates the appropriate FORMAT attribute for the LIST statement that defines your list box.

 

At run-time, the PROP:Format property always contains the current format of the listbox, including any user changes. To save the user’s column sizes, use GETINI and PUTINI to save and restore the PROP:Format values:

PUTINI('Settings','UserList',?List{PROP:Format},'MYAPP.INI')

 

·

To remove a column from the listbox, press the button.

·

To cancel the formatting changes, press the Cancel button.

·

To accept the formatting changes and close the List box Formatter, press the OK button.

·

To move the selected column to the left, click the button, or press CTRL+UP arrow.

 

If the selected column is leftmost in a group, the button moves the field out of the group, but the order of the columns is unaffected. Conversely, the button moves the selected column into a group at its immediate left, and the order of the columns is unaffected.

·

To move the selected column to the right, click the button, or press CTRL+DOWN arrow.

 

If the selected column is rightmost in a group, the button moves the column out of the group, but the order of the columns is unaffected. Conversely, the button moves the selected column into a group at its immediate right, and the order of the columns is unaffected.

·

You can also just use the keyboard. Hold the CTRL key and press the up or down arrow key. To unselect all items just release the Ctrl key and press the up or down arrow key. or release the CTRL key and mouse click on any column.

The List Box Formatter property options are discussed in more detail in the List Box Formatter Dialog core help topic.

 

Next: Lesson 7 - Exploring the Form (Update) Procedure