Adding Background Items to the Form

You can add background text, lines, and boxes to a data form. Background text can be used to provide explanations of the data fields, to create a title for a data form, or to give general instructions. Lines and boxes can be used to visually categorize or group data fields.

When the data form is displayed, each background item that was defined for the form is drawn in the form window. For this reason, all background items should be defined before the data form is displayed. However, you can add a background item to a form after the form is displayed, by defining the background item and then calling the form update background function, fm_updbg(). This function can be used with menu forms as well as data forms. It is discussed in detail in Chapter 35, "Controlling Form Processing at Lower Levels."

When a background item is defined, it is added to the linked list of background items associated with the form. When the form is displayed, background items are drawn or placed on the screen in the following order: (1) scrollable region background color (specified when you define the scrollable region), (2) lines, (3) boxes, and (4) text. If the form is defined in code, items within each category are displayed in the order that they were defined. If the form is a Designer form, items within each category are sorted, and are placed from the top to bottom in a left to right fashion.

Code: Field prompts are also text background items. For convenience, they are defined in the fld_def() call. fld_def() adds the text for the prompt into the list of background items for the form.


Home Contents Previous Next