PreviousPanel Fields DialogNext"

Chapter 8: Panel Groups

Defining groups in panels is part of the positioning panel fields step, which is the third step in developing your Dialog System application.

A group defines a rectangular area on the panel where you can move up or down, or vertically scroll data or text. You can use groups to create a selection menu, or to display data lines in a visible area that is smaller than the number of lines available.

This chapter explains:

8.1 Group Types

There are three types of groups: data groups, text groups, and attribute groups.

Data groups contain at least one data field defined as a group during data definition (see the chapter Data Definition). These groups might contain repeated data fields, all of which must be from the same underlying Data Block group. These group repetitions equate to the COBOL OCCURS clause. You can define a data group to scroll at run time and assign a selection bar to it. You would typically use a data group where you require a table for data, for example on an order entry form.

Text groups contain text rather than data fields. You can also assign selection bars to text groups. You can define fixed text groups or virtual text groups. Virtual text groups can contain more text than is visible on the group area, so the user can scroll through the data at run time. It can be useful to think of text groups as data groups that are used only for output. Fixed text groups are often used for menus, while virtual text groups are often used for extended help screens or pick and point lists.

Attribute groups contain a selection of attributes that you can use to modify text by moving them over a line on your panel. Attribute groups are only one line high, so you cannot assign a selection bar to them. Attribute groups are often used for highlighting selected areas, for example the scroll and caps indicators on the Dialog System status line.

To invoke the Group menus from the Panel Painting menu, either move the cursor to a previously defined group and select F4=group, or mark an area for a new group and select F4=group. Groups cannot overlap each other or intersect fields and groups cannot be nested. Depending on the size of the marked area, you can invoke menus to define data groups, text groups, or attributes, as described in the following sections of this chapter.

8.2 Working with Groups

When you define groups, some functions are common to the different types of groups. These common functions are described in this section, but you can access them from several different group menus.

8.2.1 Selection Bar (F5)

Pressing F5=select-bar enables you to assign a selection bar to the group. You can use this option from the Data Group menu or the Text Group menu. When you select this option, the cursor is positioned on the top line of the selected group. If you have previously defined a selection bar for a group, pressing F5 enables you to inspect the current selection bar attributes (see Figure 8-1).



Figure 8-1: Selection Bar Menu

The facilities provided by the Selection Bar menu are described in the following sections.

8.2.1.1 Delete Selection Bar (F4)

Pressing F4=delete-select-bar from the Selection Bar menu deletes a previously saved selection bar.

8.2.1.2 Paint Attribute (F5)

Pressing F5=paint-attribute from the Selection Bar menu paints the current attribute on the cursor position. To paint the entire selection bar with this attribute, press F5 the number of times required to reach the defined length , then press Enter.

8.2.1.3 Attribute Roll (F6)

Pressing F6=attribute-roll from the Selection Bar menu enables you to select from the one default and five preset attributes you previously defined (see the chapter Panels for details). To select one of the six available attributes, press F6 until the required attribute is displayed on the status line. This becomes the current active attribute that you use with the Paint Attribute function described previously.

8.2.1.4 Escape (Esc)

Pressing Escape from the Selection Bar menu cancels the selection bar definition and returns to the previous menu without saving any of the changes made. For example, if you change the attribute you previously defined for a selection bar then press Escape, the new definition is canceled, and the selection bar is restored to its original form.

8.2.2 Group Name (F8)

Pressing F8=group-name from the Data Group, Text Group or Attribute Group menu invokes the Group Name menu, shown in Figure 8-2, which enables you to change the group name. Each group must have a name that is unique in the current screen.



Figure 8-2: Group Name Menu

To change the group name, type a new name for the group at the prompt and press Enter.

8.2.2.1 Group Namelist (F2)

Pressing F2=group-namelist from the Group Name menu displays a list of current group names to which you can refer when you choose a new name for your group.

8.2.2.2 Escape (Esc)

Pressing Escape from the Group Name menu cancels the renaming operation and returns you to the relevant Group menu.

8.2.3 Virtual Text/Attribute (F2)

Pressing F2=define-virtual-text from the Text Group menu invokes the Virtual Text Group Definition menu shown in Figure 8-3.



Figure 8-3: Virtual Text Group Definition Menu

Pressing F2=define-virtual-attribute from the Attribute Group menu invokes the Virtual Attribute Group Definition menu shown in Figure 8-4.



Figure 8-4: Virtual Attribute Group Definition

The facilities in both of these group menus are nearly identical, and are described together in the following sections. The Virtual Attribute Group Definition menu contains the same function as the Virtual Text Group Definition menu, plus the Attribute Roll and Paint Attribute functions described earlier in this chapter.

These two menus enable you to define or change virtual text or virtual attribute groups, as appropriate. You can enter text as required, using the <up-arrow> and <down-arrow> keys to scroll the virtual text. To add a line at the end of the text, press Enter on the last entry.

A virtual text group can be up to 255 lines, or up to 4000 characters (that is, the number of lines multiplied by the width of the virtual text panel), whichever limit is reached first. Therefore, if a virtual text panel is 25 characters wide, the group can be up to 160 lines long (4000 divided by 25).

8.2.3.1 Insert Line (F3)

Pressing F3=insert-line from the Virtual Text/Attribute Group Definition menu inserts a new line at the current position and increases the total size of the group by one. You can insert lines into a group until you reach the maximum number of lines or characters, as described in the preceding section.

8.2.3.2 Delete Line (F4)

Pressing F4=delete-line from the Virtual Text/Attribute Group Definition menu deletes the current line and reduces the total size of the group by one. The deleted line is saved, so you can subsequently restore it if required. You can store up to 16 deleted lines.

8.2.3.3 Restore Line (F7)

Pressing F7=restore-line from the Virtual Text/Attribute Group Definition menu restores the last deleted line, inserting it at the current position. You can restore up to 16 deleted entries.

8.2.3.4 Duplicate Line (F8)

Pressing F8=duplicate-line from the Virtual Text/Attribute Group Definition menu duplicates the current line onto the next line if it is empty. The total size of the group is incremented by one.

8.2.3.5 Delete Virtual Text/Attribute (F9)

Pressing F9=delete-virtual-text from the Virtual Text Group Definition menu deletes the hidden entries and redefines the group as a fixed text group. The visible occurrences at the top of the virtual text are retained in the fixed text group. If you define virtual text and there is no hidden text, the virtual text group automatically reverts to a fixed text group.

Pressing F9=delete-virtual-attribute from the Virtual Attribute Group Definition menu deletes the virtual attributes previously defined, retaining on screen the visible occurrences at the top of the group.

8.2.3.6 Abandon (F10)

Pressing F10=abandon from the Virtual Text Group Definition menu cancels the virtual text definition and exits to the Fixed Text Group menu.

Pressing F10=abandon from the Virtual Attribute Group Definition menu restores the group to its original form and exits to the Virtual Attribute Group menu.

8.2.3.7 Escape (Esc)

Pressing Escape from the Virtual Text Group Definition menu saves the virtual text definition and returns to the Virtual Text Group menu. The first occurrences in the virtual text group are shown in the visible screen group area.

Pressing Escape from the Virtual Attribute Group Definition menu saves the virtual attribute definition and returns to the Virtual Attribute Group menu.

8.2.4 Group Size Maintenance (F9)

Pressing F9=group-size-maintenance from the Text Group or Attribute Group menu invokes the Group Size Maintenance menu, as shown in Figure 8-5. This menu enables you to expand or contract a virtual text or virtual attribute group horizontally in either direction. You can also expand or contract virtual text groups vertically from the bottom.



Figure 8-5: Group Size Maintenance Menu

8.2.4.1 Expand/Contract (F2)

Pressing the F2=expand-contract toggle from the Group Size Maintenance menu enables you to expand or contract the group. Press F2 to set the desired mode, then use the <left-arrow>, <right-arrow> or <down-arrow> keys to adjust the width as required. The new width is applied to all group occurrences.

Be careful when you contract a group horizontally, because virtual text groups will be adjusted to fit into the revised space, and you might unintentionally lose some text.

8.3 Data Groups

A data group is a group that contains at least one data field defined as a group during data definition (see the chapter Data Definition). It can be useful to think of a data group as a single line of data fields (one occurrence) that you can repeat as required.

You can expand a data group vertically, up to the limits of the panel, or the number of repeats specified for the field during data definition, as long as the group does not overlap any other groups or data fields. However, all the fields in the data group must be on the same line of the panel. Also, all the fields in the group must belong to the same underlying Data Block group. You can assign a selection bar to this group. The data group can contain more lines than can fit in the visible panel area, because the hidden lines can be scrolled into the visible area at run time.

To access the Data Group menu shown in Figure 8-6, use the F2=mark/unmark function from the Panel Painting menu to mark an area that contains at least one data field defined as a group and press F4=group. The Group Name menu and prompt are displayed. Type a name for the group, which must be unique in the current panel. You can use the F2=group-namelist function from the Group Name menu to view a list of the group names already in use on the current panel. Press Enter. This invokes the Data Group menu.



Figure 8-6: Data Group Menu

8.3.1 Group Accept Exit Bar/End (F2)

Pressing the F2=group-accept-exit bar/end function enables you to set the behavior of the selection bar in a data group at run time. You can specify where the selection bar moves when it reaches the last field on a line with multiple fields. When a data group contains multiple fields in each group line, you must define the skip to next field (SKNF) function in the dialog (see the chapter Dialog for details of defining dialog) so that the selection bar can move between these fields.

You use the F2 toggle to specify the selection bar behavior at the end of the group line. If you select the group-accept-exit bar mode, the data in the group is accepted and the selection bar skips to the next field outside the group. If you select the group-accept-exit end mode, the data in the group is accepted and the selection bar skips to the next field inside the group.

Default:

Group-accept-exit bar.

8.3.2 Selection Bar (F5)

Pressing F5=select-bar from the Data Group menu invokes the Selection Bar menu described earlier in this chapter.

8.3.3 Group Name (F8)

Pressing F8=group-name from the Data Group menu invokes the Group Name menu described earlier in this chapter.

8.3.4 Group Occurrence Maintenance (F9)

Pressing F9=group-occurrence-maintenance from the Data Group menu enables you to amend fields contained in the group or to expand or contract the group's size. When you select the F9 function, the group is visibly reduced to its one occurrence on the panel, and the menu shown in Figure 8-7 is displayed.



Figure 8-7: Group Occurrence Maintenance Menu

8.3.4.1 Field (F3)

Pressing F3=field from the Group Occurrence Maintenance menu invokes the Panel Field menu and popup list, which enables you to add, change or delete fields in the group (see the chapter Panel Fields for more information about this menu). You can alter only the fields in the current group, so these are the only fields displayed in the popup list.

If you use the Panel Field menu option to cut all the fields from a group, you will exit from the group maintenance function. A warning message is displayed and you can either paste in a field to remain in the group maintenance function, or continue to exit. If you exit, the group is no longer treated as a data group, but as an empty text field.

8.3.4.2 Group Size Maintenance (F9)

Pressing F9=group-size-maintenance from the Group Occurrence Maintenance menu invokes the Group Size Maintenance menu described earlier in this chapter.

8.3.5 Add Occurrence (<down-arrow>)

Pressing the <down-arrow> key from the Data Group menu expands the group vertically downward by one occurrence at a time, up to the limits of the panel, or the number of repeats specified for the field during data definition.

8.3.6 Remove Occurrence (<up-arrow>)

Pressing the <up-arrow> key from the Data Group menu contracts the group vertically upward by one occurrence at a time. Remember that a data group must contain at least one data field.

8.4 Text Groups

A text group is a group that contains no data fields. You can expand this group vertically up to the limit of the panel size, as long as it does not overlap any other groups or data fields. You can assign a selection bar to this group.

You can make a text group into a virtual text group, that is, a group that contains more text than can fit in the visible area. At run time, these hidden lines of text can be scrolled in and out of the visible area. A text group that is not defined as a virtual group is referred to as a fixed text group.

To access the Text Group menu shown in Figure 8-9, use the F2=mark/unmark function from the Panel Painting menu to mark an area that contains no fields and press F4=group. If the area marked covers more than one line, it is assumed to be a text group, and the Group Name menu is displayed immediately. If the marked area is only one line high, the Group Selection menu shown in Figure 8-8 is displayed, where you must select F3=text-group before the Group Name menu is displayed.



Figure 8-8: Group Selection Menu

At the prompt on the Group Name menu, type a name for this group, which must be unique within the current panel. You can use the F2=group-namelist function on the Group Name menu to view a list of the group names already in use on the current panel. Press Enter to invoke the Text Group menu.



Figure 8-9: Text Group Menu

8.4.1 Define Virtual Text (F2)

Pressing F2= define-virtual-text from the Text Group menu invokes the Virtual Text Group Definition menu described earlier in this chapter. This menu enables you to redefine a fixed text group as a virtual text group. The status line in the Virtual Text Definition menu shows two values: one is the number of the current line in the virtual text and the other is the current total number of lines of virtual text. The default value for the total is one greater than the number of visible lines in the marked area.

8.4.2 Selection Bar (F5)

Pressing F5=select-bar from the Text Group menu invokes the Selection Bar menu described earlier in this chapter.

8.4.3 Group Name (F8)

Pressing F8=group-name from the Text Group menu invokes the Group Name menu described earlier in this chapter.

8.4.4 Group Size Maintenance (F9)

Pressing F9=group-size-maintenance from the Text Group menu invokes the Group Size Maintenance menu described earlier in this chapter.

8.4.5 Escape (Esc)

Pressing Escape from the Text Group menu exits the Text Group menu and returns to the Panel Painting menu.

8.5 Attribute Groups

An attribute group contains a single line of attributes that can be used to modify text by moving them over a line on your panel. These groups, which can be only one line high, are always virtual groups. You cannot assign a selection bar to an attribute group.

To access the Attribute Group menu shown in Figure 8-10, use the F2=mark/unmark function from the Panel Painting menu to mark an area that is one line high and contains no fields and press F4=group. The Group Selection menu is displayed. Select F2=attribute-group, and the Group Name menu and prompt is displayed. Type a name for this group, which must be unique in the current panel. You can use the F2=group-namelist function on the Group Name menu to view a list of the group names already in use on the current panel. Press Enter to invoke the Attribute Group menu.



Figure 8-10: Attribute Group Menu

8.5.1 Define Virtual Attributes (F2)

Pressing F2=define-virtual-attributes from the Attribute Group menu invokes the Virtual Attribute Group Definition menu described earlier in this chapter. This menu enables you to specify a set of attributes that can be moved over a line on your panel to modify the line attribute.

8.5.2 Group Name (F8)

Pressing F8=group-name from the Attribute Group menu invokes the Group Name menu described earlier in this chapter.

8.5.3 Group Size Maintenance (F9)

Pressing F9=group-size-maintenance from the Attribute Group menu invokes the Group Size Maintenance menu described earlier in this chapter. Remember that attribute groups can only be expanded left or right; they cannot be expanded down.

8.5.4 Escape (Esc)

Pressing Escape from the Attribute Group menu exits the Attribute Group menu and returns to the Panel Painting menu.


Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

PreviousPanel Fields DialogNext"