Painting panels is part of the defining panels step, which is the second step in developing your Dialog System application. The chapter Panels described how to create a panel and define its size. This chapter describes how to use the facilities available from the Panel Painting menu to manipulate the layout and attributes of the panel you have defined. From the Panel Painting Alternate menu, you can define keystroke functions in a panel. The Panel Painting Control menu provides additional facilities for designing the layout of your panels.
This chapter describes:
The Panel Painting menu (see Figure 6-1) is displayed whenever you define a new panel (see the chapter Panels for details on defining panels), or select a panel from the panel list.
Figure 6-1: Panel Painting Menu
Use the cursor keys to position the cursor in the panel, and enter any text that you need. If you position things incorrectly, you can cut and paste blocks, as described in the next section.
If you require your screenset to be portable between DOS and UNIX systems, do not use characters outside the standard ASCII character set (codes 032 through 127). For more information, see the section None/Single/Double Border (F4) later in this chapter.
In Dialog System, you can manipulate blocks to change your panel design. This means that you do not need to get your panel design perfect the first time. You can cut or copy blocks, which are rectangular areas in a panel, and copy or paste them onto the same panel or onto other panels. The Block menu provides the facilities that enable you to manipulate blocks (see Figure 6-2). You can access this menu using F7=cut-to-block, F8=copy-to-block, or F9=restore-block in the Panel Painting menu. If you cut a block, you cannot split data fields or groups.
Figure 6-2: Block Menu
The block manipulation facilities are described together in this section. The menu options to open the Block menu are described in the relevant menu sections later in this chapter.
Before you open the Block menu, you must specify the desired block using the mark/unmark option described later in this chapter. The Block menu offers the following facilities:
Pressing the <down-arrow>, <up-arrow>, <right-arrow>, and <left-arrow> keys from the Block menu moves the block to the desired position so that you can paste, copy or stack that block.
Pressing F2=paste-block from the Block menu relocates the block in a new position and returns to the previous menu.
Pressing F3=copy-from-block from the Block menu copies the block to a new position. Block highlighting remains on, with control inside the Block menu so that you can select another function. You can copy the marked block multiple times to various places on the panel.
The Copy From Block function differs from the Paste function because after you place the new block in the position you specify, Copy From Block returns you to the Block menu, where you can copy the block again, or select another function. However, Paste returns you to the previous Panel Painting menu.
Pressing F4=stack-block from the Block menu places the block into a stack on a first-in-last-out basis and returns to the previous menu. You can restore the block from the stack later by using the Restore Block function. You can stack a maximum of 16 blocks in this way.
Pressing F10=abandon from the Block menu returns a cut block to its original location and cancels the block manipulation function that you selected.
Use the mark/unmark facility to specify the area to use in a panel painting function. Position the cursor at one corner of the area you want, and press F2=mark/unmark from the Panel Painting menu. Use the <down-arrow>, <up-arrow>, <right-arrow>, and <left-arrow> keys to extend the rectangular area from the original marked position. To cancel the mark function, press the F2=mark/unmark toggle again. You need to mark an area before you use several functions in the Panel Painting menu, for example to mark a block before you use the block manipulation facilities described in the previous section.
Pressing F3=field from the Panel Painting menu invokes the Panel Field menu, which enables you to place fields on the panel and to change existing fields. See the chapter Panel Fields for more information.
Pressing F4=group from the Panel Painting menu defines a marked area as a group and then invokes the Panel Group menu. See the chapter Panel Groups for more information.
Pressing F5=paint-attribute from the Panel Painting menu enables you to use an attribute to paint a cursor position, block or field. You must select your attributes first (see the section Attribute Palette (F3) later in this chapter). To paint the cursor position, press F5. To paint a block, define the area you want to be painted by using the F2=mark/unmark toggle, then press F5. To paint a field, place the cursor anywhere on the field, then press F5.
The Paint Attribute function works in the following way:
Pressing F6=attribute-roll from the Panel Painting menu enables you select from the one default and five preset attributes (see the section Attribute Palette (F3) later in this chapter for details about setting these). To roll through the six available attributes, press F6 until the attribute you require is displayed on the status line. This becomes the current active attribute that can be used to paint a character, field, or block.
You can use any combination of attributes on your screenset to achieve your desired effect. To use a color that is not one of the six presets, you can change the values at any time using the Attribute Panel option, described later in this chapter.
Pressing F7=cut-to-block from the Panel Painting menu cuts an area you have marked, using the F2=mark/unmark key, to a block and invokes the Block menu. This menu is described in the section Working with Blocks earlier in this chapter.
If you cut a block that contains a group, there are some restrictions. You must either paste the block, copy from the block or abandon the cut. You cannot store the cut block on the stack until you have first copied it back onto the panel. If you then copy from this cut block, all the group properties are carried with the copied block. However, you will be prompted at the foot of the screen to provide different names for the newly copied groups. Once you have copied the block, you cannot abandon the cut.
Pressing F8=copy-to-block from the Panel Painting menu copies an area that you marked, using the F2=mark/unmark key, and invokes the Block menu. The original area remains in place. The Block menu is described in the section Working with Blocks earlier in this chapter.
If you copy to a block that contains a group, you will be prompted for a new name for the copied group. There is no restriction on copying a block that contains a group, so you can place this copied group, along with all its properties, into the stack.
Pressing F9=restore-block from the Panel Painting menu restores the last block placed in the stack at the cursor position. Block highlighting remains on, and control is inside the Block menu so that you can select another function. For example, you can copy a restored block multiple times to various places on the panel, paste it into another location, or put it back onto the stack.
You can to use the copy and restore block functions between two different screensets. To do this, copy a block in one screenset and place the block on the stack. Then load the second screenset and restore the block. However, if you use this procedure, group and field definitions are not copied.
Pressing F10=panel-maint from the Panel Painting menu invokes the Panel Maintenance menu (see Figure 6-3), which provides facilities to change the selected panel as described in the following section.
Figure 6-3: Panel Maintenance Menu
Pressing F2=move from the Panel Maintenance menu enables you to move the panel around the screen using the <down-arrow>, <up-arrow>, <right-arrow>, and <left-arrow> keys, the <right-arrow>| and |<left-arrow>) keys, and the Home and End keys. Press the Escape key or F2=move again to confirm the new panel location.
Pressing F3=alter-panel-size from the Panel Maintenance menu displays a further menu (see Figure 6-4), enabling you to change the size of a panel.
Figure 6-4: Alter Panel Size Menu
From this menu, press the F2=expand/contract toggle to select the required mode. Use the <left-arrow> and <right-arrow> keys to expand or contract the panel in the direction of the relevant cursor key. You are prevented from contracting the panel in a way that would remove a field or group. When the panel is the required size, press Enter to confirm the change.
Be careful when you contract a panel because any text contained in the part of the panel that is contracted is lost.
Pressing the F4=none/single/double-border toggle from the Panel Maintenance menu enables you to place a border around the current panel. Press F4 to select the desired mode. The default for a new panel is to have a single line border, provided there is space to draw a border (that is, the panel is at least one line high and one character wide).
If you place a border around the panel, ensure that you do not put any text on the edge of the panel, because the border will overwrite the text. To put text on the edge of the panel and have a border around the panel except for the text area, you can define the panel to have no border, then draw the border yourself using the draw function.
If you are transferring your screensets between DOS and UNIX environments, there are some limitations that UNIX imposes on line drawing. See the chapter Character Set Support on UNIX for more information. However, these limitations are on the display only; the data actually stored is not affected, so you can design your screensets to your requirements in either environment.
Pressing F5=top/bottom anchor from the Panel Maintenance menu enables you to specify whether the position of a panel on the screen is treated as relative to the top or bottom of the screen. This feature means that a screenset designed on a display with a certain number of lines can be run on a display with a different number of lines.
Pressing F5 toggles between the following settings:
|Top||The position of the panel on the screen is relative to the top of the screen. For example, if you create a panel that starts three rows from the top of the screen, the panel will always appear three rows from the top of the screen at run time. This is the default.|
|Bottom||The position of the panel on the screen is relative to the bottom of the screen. For example, if you create a panel that starts 15 rows from the bottom of the screen, the panel will always appear 15 rows from the bottom of the screen at run time.|
You can access the Alternate menu, shown in Figure 6-5, from the Panel Painting menu. The Panel Painting Alt menu provides additional facilities for designing the function and appearance of your panel.
Figure 6-5: Panel Painting Alternate Menu
Pressing F2=local-dialog from the Panel Painting Alt menu invokes the Dialog Definition menu, where you define the dialog for functions such as procedures, path control functions (for example, moving between fields and panels), cursor functions, keyboard functions, and group data positioning functions. When you invoke the Dialog Definition menu from the Panel Painting Alt menu, you can define local dialog. (You can also invoke the Dialog Definition menu from the Main menu, which enables you to define global dialog.)
You define local dialog when you want it to be specific to a panel. For example, you could define that F1 displays a Help panel appropriate to the panel you are working with.
You define global dialog when you want it to be active for the entire screenset. For example, you could define that the <right-arrow>| key always skips to the next field in any panel.
Where a key or procedure is defined both in the local and the global dialog, the definition in the local dialog is acted upon first unless you change this precedence using the Global/Local Dialog First function described in the chapter Using Dialog System.
The functions available on the Dialog Definition menu are identical for both local and global dialog. For further information, see the section Dialog Definition Menu in the chapter Dialog.
Pressing F3=attribute-palette from the Panel Painting Alt menu invokes the Attribute Palette menu (see Figure 6-6), where you can paint text or data with attributes. These attributes are color, brightness, and blinking. You can define two sets of attributes from this menu; one set for the static panel colors and the other for the active run-time colors.
Figure 6-6: Attribute Palette Menu - Roll List
You can use this menu to set up the default background attribute and five other attributes that make up the static panel attributes. If you reset the default attribute, any characters already painted with in the current default attribute assume the new attribute. The default attribute requires less storage in the screenset than the other attributes, so you should set it to the attribute that is used most in the panel.
You set the static panel attributes in the same way that you set the colorization details. See the section Colorize (F8) in the chapter Using Dialog System. You can then use these six attributes in the Attribute Roll function during the panel editing process. See the section Attribute Roll (F6) earlier in this chapter.
To set the six active run-time attributes, press F8=run-time-list to display the menu shown in Figure 6-7.
Figure 6-7: Attribute Palette Menu - Run-Time
You can use this Attribute Palette Run-time menu to define the following three types of run-time attributes:
|Auxiliary Field Attributes||Four attributes that you can define for use at run time. Assign the desired attributes to the keys F2 through F5. To use these attributes, you must refer to them explicitly in the dialog.|
|Error Field Attribute||The attribute that the run-time system uses for any input field that fails validation. If you have defined validation, the error attribute is always used when there is an error in a field. If you do not want to use the error attribute, you must select the same attribute that is used for the underlying field attribute. Assign the desired attribute to the F6 key.|
|Field Entry Attribute||The attribute that the run-time system uses for an input field when the cursor is positioned on it. Assign the desired attribute to F7(input)=X, then press the F8=input-attribute off/on toggle to activate it.|
The run-time attributes are not used during panel editing, but are used at run time under the control of the dialog and the error procedures. These six attributes are local to a panel and are saved with that panel when you save the screenset.
Pressing F4=panel-name from the Panel Painting Alt menu enables you to change the name of a panel. Enter the new name for your panel at the prompt and press Enter. The new name is displayed on the status line. Remember that panels must have unique names.
Pressing F6=clear from the Panel Painting Alt menu enables you to clear the current panel together with all its data details, attribute details and dialog details. When you select this function, the following prompt is displayed:
Clear panel? Are you sure? Y/N
Press "Y" to clear the panel or "N" to cancel the operation.
The panel remains the same size and keeps its current name. Use this function with caution, because although the panel itself remains, the function deletes all of the previously defined details.
To actually delete the panel itself, you must use the F8=delete-panel option in the Panel List menu (see the section Panel List (F3) in the chapter Panels).
Pressing F7=protect definition from the Panel Painting Alt menu displays the Protect Definition Screen, shown in Figure 6-8, where you can specify data flag variables. You can associate one or more panel fields with a data flag variable. The data flag variable can take the values zero and one. You use this option to switch a field between input and output at run time.
When you set a data flag variable to one (either from the application program or from dialog), all the fields associated with that variable become protected; that is, these fields cannot accept user input. When you set a data flag variable to zero, all the fields associated with that variable become unprotected; that is, these fields can accept user input. If you use any value other than zero or one, there will be undefined results, which will differ between releases.
Figure 6-8: Protection Definition Screen
To define a data flag variable and its associated fields:
Enter as many field numbers as required, using Tab or cursor control keys to move from field to field. To specify more field numbers than can fit on one line, specify the same flag variable name in the Protect Flag column of the next line, and continue entering field numbers for that flag.
The fields must exist in the first 255 fields in the user data block.
Alternatively, press F10=abandon to abandon the definitions.
You can associate the same field number with more than one flag variable. You can use the same flag variable name for different screens in the screenset.
Pressing Ctrl from the Panel Painting menu invokes a Control menu (see Figure 6-9) that provides further facilities for designing the layout of your panel.
Figure 6-9: Panel Painting Control Menu
Pressing F2=field-order from the Panel Painting Ctrl menu enables you to define the order that input fields are accepted in at run time. By default, fields are accepted from top left to bottom right.
When you select this function, the first caret symbol of each field is replaced with the number 5. To define that a field is accepted first at run time, position the cursor at that field and overtype the number 5 with a number lower than five. Overtyping with a number greater than five has the opposite effect. If some fields have the same number, they are accepted in the default order from top left to bottom right.
The order that fields in a group are accepted is relative to that group, so you cannot define an acceptance order that goes in and out of a group. The characters you can use in the field order definition are 0-9, A-Z, and a-z, in ascending order.
Pressing F3=previous-panel from the Panel Painting Ctrl menu enables you to change control from the current active panel to the previous panel in the screenset so that you can move rapidly between the panels in the screenset.
When you select this function, the panel that you are currently working on is removed from the screen and replaced by the one that you were working on previously.
To see more than one panel at once (so that you can evaluate the relative positioning on the screen), you must return to the Panel Definition menu and select F3=show-panel for the panels you require.
Pressing F4=next-panel from the Panel Painting Ctrl menu enables you to change control from the current active panel to the next panel in the screenset.
When you select this function, the panel that you are currently working on is removed from the screen and replaced by the next panel in the screenset. To see more than one panel at once (so that you can evaluate the relative positioning on the screen), you must return to the Panel Definition menu and select F3=show-panel for the panels you require.
Pressing F6=draw from the Panel Painting Ctrl menu invokes the Draw menu (see Figure 6-10), which enables you to draw lines under the cursor as it moves. The Draw menu functions are described in the following sections.
Figure 6-10: Draw Menu
Pressing the F2=draw/erase/move toggle from the Draw menu enables you to draw a selected line character, erase a previously drawn line character, or move the cursor without drawing or erasing a line character. Select draw mode to leave the selected line character behind as you move the cursor. Select erase mode to erase any line characters previously drawn as you move the cursor. Select move mode to move the cursor without drawing or erasing the line character.
Pressing the F3 toggle from the Draw menu enables you to select single or double line draw character type. However, there are the same line drawing limitations on a display in a UNIX environment that are described in the section None/Single/Double Borders earlier in this chapter.
Pressing F6=attribute-roll from the Draw menu enables you to set the appearance of the draw characters to one of the six preset attributes. You cannot draw lines through any of the fields or virtual text areas on the panel.
Pressing F7=char-palette from the Panel Painting Ctrl menu invokes the Character Palette menu (see Figure 6-11), which enables you to select any of the characters that can be displayed from your machine's character set. The character set on DOS is all 256 characters. The character set on UNIX varies according to your configuration, but is typically the ASCII characters with codes 32 through 127.
Figure 6-11: Character Palette Menu
To select a character, position the cursor when you require the character. Use the F3=char-left and F4=char-right functions to move left and right along the character palette displayed at the bottom of the screen, and highlight the character you want. Press F5=select-char.
The highlighted palette character is placed on the panel at the cursor position. The numbers in parenthesis indicate the highlighted character, its palette number and its hexadecimal value.
If you are working on UNIX, there is a defined set of supported UNIX characters (see the chapter Character Set Support on UNIX).
Pressing F9=delete-field-defn from the Panel Painting Ctrl menu deletes the selected field from the panel. Position the cursor on the desired field and press F9. You cannot delete a field that is part of a panel group unless the group definition is deleted. Also, you cannot delete a field that is referenced in dialog. To remove a field from a group, you must use the Group Occurrence Maintenance menu, described in the section Data Groups in the chapter Panel Groups.
Pressing F10=delete-group-defn from the Panel Painting Ctrl menu removes the group identification previously specified for a number of fields. Position the cursor in the desired group and press F10. You cannot delete a group definition if the group is referenced in dialog. The fields that previously comprised the group are not deleted.
For more information about the effect of this function on different types of groups, see the chapter Panel Groups. To remove a field from a group, you can use the Group Occurrence Maintenance menu, where you can insert, delete or amend fields in a group (see the section Data Groups in the chapter Panel Groups.
This toggle function enables you to remove the Panel Painting menu from the physical screen to give you an unobstructed view while painting your panel. On DOS, press the Ctrl and End keys simultaneously to toggle the menu on and off. On UNIX, enter control mode and then the key sequence for end.
This removes the menu from the screen at any point in Dialog System.
Copyright © 1998 Micro Focus Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.