Screens for the Enhanced Training Application [ HP ALLBASE/4GL Developer Self-Paced Training Guide ] MPE/iX 5.0 Documentation
HP ALLBASE/4GL Developer Self-Paced Training Guide
Screens for the Enhanced Training Application
This application requires three new windows, and alterations to the
product_scrn data screen.
From the main menu, the user selects one of four possible file update
actions. These actions are functions that set the appropriate update
mode. All four functions then call the same process. The process
displays the product_scrn data screen.
The product_scrn data screen contains only fields that are relevant to
the product records. A function on the first field of this screen
displays a window with headings for a scroll area as well as some line
drawing characters which draw a box on the product screen.
When the user presses the Option function key, an option window is
displayed. This window contains the same scroll area headings as the
data screen. It also contains the fields relevant to the option record
as well as its own arrangement of line drawing characters to complete the
box on the product screen as well as providing a box around its own
fields.
The exact line and column positioning of the items you create is not
critical. Although you do have some freedom as far as the position of
the items is concerned, you must keep the fields in the same order as
shown on the example screens.
Task 1 - Altering the Product Data Screen
The product_scrn data screen already contains all of the fields necessary
to maintain product records. Now it needs an area for the option window,
and an area for scrolling details for the options for an existing
product.
First alter the screen header.
1. Enter the following values, and accept the defaults for the other
fields.
Name product_scrn
Scroll: Top Line 18
Scroll: Bottom Line 22
Scroll: Direction D
Window Starting Line 9
This header specifies a scroll area from line 18 to 22. Whenever
a new line of data is displayed in the area with a SCROLL command,
the lines already displayed move down as the new line is displayed
at the top of the area.
The header also specifies the starting line for a window.
Whenever a window is displayed on this screen, the current
contents of the screen from line 9 downwards are cleared and the
window contents are displayed from line 9 to the bottom of the
screen.
2. When you have redefined the screen header, press the Commit Data
function key.
Now you are ready to paint the screen.
3. Call up the screen painter and repaint the product_scrn data
screen as described below.
The two lines at the top of the screen are similar to those you painted
earlier for this screen, except for the V-Mode entry in the center of the
first line.
Note the entry V-Mode, just before the literal Product/Option on the
above screen. This is a system item referring to the variable mode.
Since the same screen is used for adding, modifying, deleting, and
reviewing data, this screen item displays the current update mode next to
the screen title text.
To paint the screen:
1. Change the first line of the screen to contain the new title.
The maximum length of the mode variable is 6 characters, so make
sure you leave a space between it and the literal text
Product/Option.
2. The next task is to create the frame of line drawing characters
that surround the items on this screen.
Position the cursor at line 3 column 2, display the Main Keys
function key set, and use the following steps to create the box on
the screen.
Action Explanation
Press Special This displays the special text function keys.
Text An asterisk appears in the function key label
corresponding to the enhancement modes that
are currently on. The default is line drawing
mode only.
Press Return The painter enters text input mode.
Press Q The first character in the first column of the
figure below is echoed to the screen. (Refer
to your terminal reference manual for a full
mapping of line drawing characters to the
keyboard characters.)
Press ; 76 times This extends the line drawing characters to
the right giving a line above the prompts and
data fields.
Press W The first character in the second colunm of
the figure below is echoed to the screen.
Press Return This finishes the special text item creation.
Here are the line drawing characters you will use in this lesson
and their equivalent keyboard characters.
Line Drawing Characters
3. Create the vertical lines on each side of the box, down to, and
including, line 8. Each line is made from single character items.
You can use the copy facility to speed up the process of creating
the lines.
4. Now move the input fields and literal text as shown on the screen
earlier. You can use block mode to move the items more
efficiently.
The product number literal text should begin at line 4, column 5.
The description text should begin at line 4, column 31, and the
supplier and lead time text headings should be on lines 6 and 8,
respectively, column 31.
5. When you have finished painting the screen, exit from the screen
painter to save the screen.
To alter screen field details:
The next step is to alter the attributes of the product_no field on the
product_scrn screen, using the screen field details screen.
1. Alter the Prior/After/Both field to B. This means that the
product_key_read function will be called prior to, and after,
entry into the field.
2. This screen is now complete. Commit the screen field details,
generate the screen, and return to the screen header screen to
create the option window.
Task 2 - Creating the Option Window
The option window screen contains all the fields necessary to maintain
records for the options associated with particular products. It is
overlaid on the product data screen when the user presses the Option
function key.
1. First, define the screen header. These are the values you must
enter. Accept the defaults for the other values.
Screen option
Screen Type W
Function Keys option_keys
When HP ALLBASE/4GL displays a window on a data screen, the
function keys defined for the window are also displayed. If you
have not defined a set of function keys for the window, the
function keys from the original screen are not changed.
2. When you have created the screen header, commit the details and
then use the screen painter to create the option window.
Option Window
To paint the screen:
Notice that the option window is painted at the very top of the painter
screen. When it is displayed, the window is overlaid starting from the
window start line of the underlying data screen. This means that the
line at the top of this screen is aligned with the bottom of the open box
on the underlying data screen.
To simplify the task of aligning the fields on the window, there is a
screen painter facility that you haven't used yet. This is the Overlay
Screen capability.
1. With just the blank screen painter screen displayed, follow these
steps.
Action Explanation
Press More Keys This displays a further set of function keys.
Press Overlay A prompt for the overlay screen name appears.
Screen
This is the overlay prompt from the screen painter screen.
Overlay Prompt
2. Using the overlay prompt, complete these steps:
Action Explanation
Enter product_scrn HP ALLBASE/4GL prompts you to move the cursor
to the starting position of the overlay.
Press cursor home, This moves the cursor to the top left hand
then Return corner of the screen. This where you want the
overlaid screen to be inserted.
Press Return The product_scrn data screen is overlaid onto
this screen.
You can now paint the window with the new items in correct alignment with
the existing items on the product screen, as described below.
To paint the window:
1. First delete the unwanted header fields from the top of the
product screen and use the block move facility to move the rest of
the window fields up two lines so that they begin at the top of
the screen. The last fields should be on line 6.
2. Copy the horizontal special text item at line 1 to line 7. Then
highlight the text item on line 1. With the cursor located first
at the left end of the item at line, press 1.
3. Then move to the right end of the item, and press 2. The correct
characters are displayed.
4. To correct the line drawing characters at the ends of the item at
line 7, use the keys A and S.
5. Delete the current prompts and input fields and complete the
screen with all of the prompts and input items for the option
file.
The text literals are shown on the screen image above. The input
items are the field specifications in the option file. The last
line of text on the window is a heading for the scroll area. This
text should be on line 9 of the screen.
6. When you have completed the screen, leave the screen painter so
you can define the screen field details for this screen, which are
detailed below.
To define screen field details:
1. Define the attributes for each of the screen fields listed below.
Only those values requiring a specific entry are shown here.
2. Accept the defaults for the other fields.
a. Field 1
Field Spec.Name option_no
Primary Data Movement F-option_no.option
Function option_key_read
Prior/After/Both A
b. Field 2
Field Spec.Name description
Primary Data Movement F-description.option
c. Field 3
Field Spec. Name cost
Primary Data Movement F-cost.option
d. Field 4
Field Spec. Name quantity
Primary Data Movement F-quantity.option
Required Field N
e. Field 5
Field Spec. Name unit_measure
Primary Data Movement F-unit_measure.option
3. When you have completed the option window, remember to generate
it. You can then go on to create the new_option window.
Task 3 - Adding a new Option Window
This application requires a further window to allow the user to add
option number 000 for a new product. This window is almost identical to
the option window, except for the option_no field. On the new_option
window, the option_no field is a display only field.
To add the new window:
1. Use the utilities menu copying screen to create a copy of the
option window called new_option.
2. Use the screen field details screen to modify the details for
field number 1 on the new_option window to read as shown below.
Field 1
Default Data Movement N-zero
Input/Display D
Function Name option_no
Prior/After/Both P
3. Generate the screen when you have made these changes. You can now
return to the screen header to create the prod_wnd window.
Task 4 - Creating the The prod_wnd Window
The last screen you need to create is the product window. This window is
displayed when the option window is not required. In effect it clears
the option window from the screen.
To create the prod_wnd window:
1. Define the screen header with the following details.
Name prod_wnd
Screen Type W
Function Keys product_keys
prod-wnd Window
2. Next, paint the window.
This window has no data fields on it. The easiest way to create
it is to overlay the option window that you have just created, and
then delete all the fields relating to any unwanted option
details. Then you can modify the existing line drawing characters
to end up with the desired screen image.
3. When you have completed this screen, exit from the screen painter
and generate the prod_wnd window. Now that you have created all
of the screens required by the application, you can define the
function key sets used by the screens.
MPE/iX 5.0 Documentation