Using the FOCUS Screen Painter

In this section:

The FOCUS Screen Painter allows you to design a FIDEL full-screen layout by placing literal text and areas for fields on the screen in any position that you desire. You then assign these field areas of the screen to a data source or computed fields, and FOCUS automatically codes the CRTFORM. You can also color, highlight, and/or assign screen attributes to sections of the screen (text, fields, background or any combination).

The FOCUS Screen Painter also allows you to generate CRTFORMs automatically without specifying field names (see Generating Automatic CRTFORMs).

The Screen Painter operates within TED, the FOCUS editor (see the Overview and Operating Environments manual for more details on TED), and can be used to create both MODIFY CRTFORMs and Dialogue Manager -CRTFORMs. It is easy to use and makes the creating of forms simple and visual.


Top of page

x
Entering Screen Painter

In this section:

To create a CRTFORM using the Screen Painter, you first enter the PAINT command from within TED. You can set up the PAINT screen as follows:

  1. Enter TED by typing TED followed by the name of the file:
    TED FOCEXEC(CRTEMP

    This opens the FOCEXEC called CRTEMP. The FOCEXEC may or may not already exist.

  2. Place a CRTFORM or -CRTFORM statement in the FOCEXEC if it is not already there. For example:
    MODIFY FILE EMPLOYEE
    CRTFORM
  3. When a FOCEXEC is on the screen, enter the PAINT command in the command area or press PF4. TED searches from the current line down the file until it finds a CRTFORM statement and makes the following line the current line. (If you use more than one CRTFORM in the FOCEXEC and you want to create the second CRTFORM, enter the command PAINT 2.)

    Note: A Master File must be active for the Screen Painter to set the default field lengths for data source fields.

    The following PAINT screen is displayed on your terminal:

    ...+...1...+...2...+...3...+...4...+...5...+...6...+...7..+...
     
     
     
     
     
     
     
     
     
     
     
    ...+...1...+...2...+...3...+...4...+...5...+...6...+...7...+...
    COMMAND:_
     
    01=HELP 03=END 07=BACKWARD 08=FORWARD 09=ASGN-FLD 10=ASSIGN 11=FIDEL 17=BOX

    Between the two scale lines are 20 blank lines in which to enter the screen layout. The cursor is positioned in the command zone in the lower left portion of the screen. The codes at the bottom of the screen identify some of the PF keys that you can use.

    These perform the following functions:

    PF Key

    Function

    01=HELP

    Lists all the PF key functions.

    03=END

    Transfers you from the PAINT screen back into TED, within your file.

    07=BACKWARD

    Scrolls back to the previous screen of the CRTFORM. When used with ASSIGN, moves the cursor back to the first field.

    08=FORWARD

    Scrolls forward to the next screen of the CRTFORM. When used with ASSIGN, moves the cursor to the next field.

    09=ASGN-FLD

    Use on the ASSIGN screen. Transfers you to the particular field that the cursor is placed on. You can then immediately assign or change attributes for that field.

    10=ASSIGN

    Transfers you from the PAINT screen to the ASSIGN screen (see Identifying Fields: ASSIGN).

    11=FIDEL

    Shows you the CRTFORM as it will appear on the screen.

    17=BOX

    Enables you to define a box of text. Move the cursor to the upper-left corner and press PF17. Select features from the box menu and then move the cursor to the bottom-right corner and press PF17.

    Note: With the exception of FORWARD, BACKWARD and ASGN-FLD, you can also accomplish these functions by typing the command name in the command zone.

  4. If the CRTFORM already includes fields, and one or more fields are not declared in the Master File, you may see this message:
    (FOC532) LENGTHS OF FIELDS IN THIS CRTFORM CANNOT BE DETERMINED

    To continue type IGNore and provide the lengths explicitly, or type ?F filename to activate the appropriate master. After you follow the message instructions, the PAINT screen appears.



x
PF Keys in PAINT

You can alter the values of PF keys in PAINT with the command

SET PFnnword

where:

nn

Is a number from 1 to 24 specifying the PF key to be set.

word

Is the new value for the key.

The initial PF key settings in PAINT are:

PF Key

Setting

PF1, PF13

: HELP

PF2, PF14

: INSERT

PF3, PF15

: END

PF4

: PAINT

PF5

: TOP

PF6

: BOTTOM

PF7, PF19

: BACKWARD PAGE

PF8, PF20

: FORWARD PAGE

PF9

: ASSIGN FIELD

PF10

: ASSIGN

PF11

: FIDEL

PF12

: DUPLICATE

PF16

: QUIT

PF17

: BOX

PF18

: (currently not used)

PF21

: CRTFORM

PF22

: SET OUTPUT FIDEL

PF23

: SET OUTPUT DIALOGUE

PF24

: (currently not used)



x
Entering Data Onto the Screen

In this section:

In PAINT, you may enter text, and specify field dimensions. Always use the arrow keys to designate text and field areas on this screen. Generally, text is entered by positioning the cursor and typing, but fields require type and width specifications.

To create a field, type

<xx...x

where the total number of x's equals the width of the field desired. If you do not specify a width, or if the command you entered is not syntactically correct, or active, PAINT will automatically default to a width defined in the Master File.

Fields are conditional by default. To specify non-conditional fields, enter

<xx...x>

where the total number of x's equals the width of the field.

You may enter text descriptions of each field, but do not type the field name after the left or right caret. Later you will learn how to assign each field a field name. You may designate the field as Entry, Turnaround or Display with the ASSIGN command (see Identifying Fields: ASSIGN). By default, the fields are conditional. To specify non-conditional, type a right caret (>) after the x's that indicate the field. We recommend that turnaround fields be non-conditional. (See Conditional and Non-Conditional Fields for information on conditional and non-conditional fields.)



x
Editing Functions

When you are designing your screen, you have editing functions available to you. To use them, you must enter the command name on the COMMAND line on your PAINT screen or use the appropriate PF key:



x
Sample PAINT Screen

In the following example, assume that the following FOCEXEC exists:

MODIFY FILE EMPLOYEE
CRTFORM
   "ENTER EMPLOYEE ID #: <EMP_ID"
MATCH EMP_ID
   ON NOMATCH REJECT
   ON MATCH CRTFORM

To use the Screen Painter to create the second CRTFORM, specify PAINT 2 at the TED command line (2 indicates second CRTFORM). Then type the following text and fields on the PAINT screen to create the CRTFORM that will be displayed if there is a match on EMP_ID.

...+...1...+...2...+...3...+...4...+...5...+...6...+...7...+...
 
                                 EMPLOYEE UPDATE
 
EMPLOYEE ID #: <XXXXXXXXX            LAST NAME: <XXXXXXXXXXXXXXX
 
DEPARTMENT: <XXXXXXXXXX>             CURRENT SALARY: <XXXXXXXX
 
BANK: <XXXXXXXXXXXXXXXXXXXX
 
 
 
 
...+...1...+...2...+...3...+...4...+...5...+...6...+...7...+...
COMMAND:_
 
01=HELP 03=END 07=BACKWARD 08=FORWARD 09=ASGN-FLD 10=ASSIGN 11=FIDEL 17=BOX

When you finish entering text and indicating areas for fields (the number of X's corresponds to the field length), press Enter. The following screen results:

...+...1...+...2...+...3...+...4...+...5...+...6...+...7...+...
 
                                 EMPLOYEE UPDATE
 
EMPLOYEE ID #: <111111111           LAST NAME: <22222222222222
 
DEPARTMENT: <1111111111>            CURRENT SALARY: <22222222
 
BANK: <11111111111111111111
 
 
 
 
...+...1...+...2...+...3...+...4...+...5...+...6...+...7...+...
COMMAND:_
 
01=HELP 03=END 07=BACKWARD 08=FORWARD 09=ASGN-FLD 10=ASSIGN 11=FIDEL 17=BOX

Note that the X's are replaced with numbers indicating the relative position of each field on a line. On the second line, EMPLOYEE ID is number 1 and LAST NAME is number 2.

Note: Labels created in Screen Painter cannot exceed 12 characters.



x
Defining a Box on the Screen

You can define a boxed area of the screen, have it flash, or underline it. Text within the box assumes the attributes of the box, but fields within the box do not change their appearance.

To define a box, place the cursor in the upper-left corner of the area you want to enclose in a box, and press PF17. The following screen and menu appear:

...+...1...+...2...+...3...+...4...+...5...+...6...+...7...+...
 
                                 EMPLOYEE UPDATE
 
EMPLOYEE ID #: <111111111           LAST NAME: <22222222222222
 
DEPARTMENT: <1111111111>            CURRENT SALARY: <22222222
 
BANK: <11111111111111111111
 
 
 
 
...+...1...+...2...+...3...+...4...+...5...+...6...+...7...+...
Color (W,B,R,P,G,A,Y):           Flash /Under/Inv/Off (F,U,I,O):
Please position the cursor at other end of box and hit the key again

Fill in the color and/or attributes that you desire, position the cursor at the lower-right corner of the area you want to enclose in a box, and press PF17.

To delete the box, move the cursor to the upper-left corner of the box and type O in the attribute area. Then move the cursor to the lower-right corner of the box and press PF17. The letter O stands for OFF and deletes the box. Note that you must position the cursor exactly at the corners.

The BOX feature of Screen Painter will not generate a proper box if the fields cross or touch the boundary of the box itself. Boxes may not extend past column 77.

If you try to generate a box, but fail, the following message appears:

command.box
(FOC694) INVALID BOX REGION OR CURSOR POSITION DEFINED.

When this happens, press Enter to clear the message, move the cursor to the upper-left corner, and press PF17 to start over.

If you press PF17 to begin a box and then decide not to define a box, press PF3 to cancel.



x
Identifying Fields: ASSIGN

Until now, you have simply laid out text that describes the fields, designated a display length (X's) within the left caret (<), and possibly indicated non-conditional (>) fields. Now you can assign field names and attributes for the fields. Enter the command ASSIGN in the command zone or press PF10. Your ASSIGN screen displays the following:

...+...1...+...2...+...3...+...4...+...5...+...6...+...7...+...
 
                                 EMPLOYEE UPDATE
 
EMPLOYEE ID #: *********            LAST NAME: EEEEEEEEEEEEEEE
 
DEPARTMENT: EEEEEEEEEE              CURRENT SALARY: EEEEEEEE
 
BANK: EEEEEEEEEEEEEEEEEEEE
 
 
 
 
...+...1...+...2...+...3...+...4...+...5...+...6...+...7...+...
Field:                Entry/Turn Disp (E,T,D):    Col (W,B,R,P,G,A,Y):
Field Length: 9(D12.2M)  High/Nodis/Inv (H,N,I):     Label:

The first field following the descriptive text EMPLOYEE ID #: is highlighted and replaced by asterisks. All other fields are displayed in low intensity with E's denoting the length of the fields. The cursor is positioned in the status entry area at the bottom of the screen next to FIELD.

Now you can enter and assign field names and attributes for the field appearing in asterisks. Fill in the appropriate values in the status entry area at the bottom of the screen. To move from one status area to the next, press TAB. You may leave a blank where you do not want to use a particular attribute.

FIELD:

Enter the field name for the first field. In this case, enter EMP_ID, which is the name of the field in the Master File.

ENTRY/TURN/DISP (E,T,D):

You may designate the field as Entry, Turnaround, or Display by specifying E, T, or D, respectively. The default is Entry. (See Data Entry, Display and Turnaround Fields for more information on Entry, Turnaround, and Display fields.) You specify whether a field is conditional or non-conditional when you enter the field on the PAINT screen (see Entering Data Onto the Screen).

COL (W,B,R,P,G,A,Y):

You may designate the field with a color by entering one of the color abbreviations in the COL area. You may choose W, white; B, blue; R, red; P, pink; G, green; A, aqua; Y, yellow. If you do not wish to assign a color, leave this area blank.

FIELD LENGTH: 9 (A9):

In MODIFY, if a Master File is active while you are assigning attributes, the LENGTH status will contain two values: the first value is the number of X's from the PAINT screen, which is the display value; the value in parentheses is the format value from the Master File. The display value must be equal to or less than the format value.

If you want to change the display value on the screen, put a new number in the FIELD LENGTH area or return to PAINT (PF3) and enter the correct number of characters following the <.

HIGH/NODISP/INV (H,N,I):

You can choose highlight, nodisplay or inverse video as an attribute for the field by filling in the appropriate abbreviation.

LABEL:

If you want to enter a label, simply enter its name. The colon and period are automatically provided on the screen.

In the following example, the current field is LAST_NAME. It is designated a display field. The remaining attributes are left blank. After you press Enter and move to the next field, the asterisks turn to D's (display) as did the EMP_ID field.

...+...1...+...2...+...3...+...4...+...5...+...6...+...7...+...
 
                                 EMPLOYEE UPDATE
 
EMPLOYEE ID #: DDDDDDDDD            LAST NAME: ***************
 
DEPARTMENT: EEEEEEEEEE              CURRENT SALARY: EEEEEEEEEEEEEEE
 
BANK: EEEEEEEEEEEEEEEEEEEE
 
 
 
 
...+...1...+...2...+...3...+...4...+...5...+...6...+...7...+...
FIELD: last_name      ENTRY/TURN/DISP (E,T,D): d    COL (B,R,P,G,A,Y):
FIELD LENGTH: 15 (A,15) HIGH/NODISP/INV (H,N,I):       LABEL:

To move to the next field, press PF8. You may assign a field name, prefix, color, attribute or label to the remaining fields on the screen. If you need to move to a previous field to change something, press PF7. This will return you to the first field. From there you can use the TAB key to move to the field that you need.

To move to a specific field directly from PAINT or from within ASSIGN, place the cursor on that field and press PF9, ASGN-FLD.



x
Viewing the Screen: FIDEL

From the PAINT or ASSIGN screen, you can view the exact FIDEL screen that you have created. Press PF11 or type FIDEL in the command zone. As the following screen shows, all entry fields are blank and ready to receive data; all turnaround fields contain T's and may be typed over; all display fields contain D's and are protected:

...+...1...+...2...+...3...+...4...+...5...+...6...+...7...+...
 
                                 EMPLOYEE UPDATE
 
EMPLOYEE ID #: DDDDDDDDD            LAST NAME: DDDDDDDDDDDDDDD
 
DEPARTMENT: TTTTTTTTTT              CURRENT SALARY:
 
 
 
 
FIDEL: Press PF3 or PF15 to return to the PAINT screen.

As indicated on the FIDEL screen, to return to the PAINT screen press PF3 or PF15.



x
Generating CRTFORMs Automatically

To generate CRTFORMs automatically (that is, without specifying individual fields) from the FOCUS Screen Painter, use the asterisk (*) with CRTFORM in the PAINT screen command zone. (See Generating Automatic CRTFORMs for information on CRTFORM * variations and syntax.)

The text description identifying field is the field name from the Master File. Key fields automatically become entry fields, and all other fields become turnaround fields. With multi-segment data sources, the CRTFORM * command ignores all segments following the first cross-reference (segment type KU or KM) described in the Master File.

For example, to generate a CRTFORM containing all fields in the EMPLOYEE Master File, do the following:

  1. Type a MODIFY and a CRTFORM statement in a FOCEXEC.
  2. Enter PAINT on the TED command line to invoke the Screen Painter.
  3. Type CRTFORM * in the Screen Painter command zone.

The following PAINT screen results:

...+...1...+...2...+...3...+...4...+...5...+...6...+...7...+...
 
EMP_ID         :<111111111>   :
LAST_NAME      :<111111111111111   :        FIRST NAME  :<2222222222: 
HIRE_DATE      :<111111    :                DEPARTMENT  :<2222222222:
CURR_SAL       :<111111111111  :            CUR_JOBCODE :<222   :
ED_HRS         :<111111    :
BANK_NAME      :<11111111111111111111  :
BANK_CODE      :<111111    :                BANK_ACCT   :<222222222:
EFFECT_DATE    :<111111    :
DAT_INC        :<111111>   :
PCT_INC        :<111111    :                SALARY      :<222222222222:
JOBCODE        :<111      :
TYPE           :<1111>    :
ADDRESS_LN1    :<11111111111111111111  :
ADDRESS_LN2    :<11111111111111111111  :
ADDRESS_LN3    :<11111111111111111111  :
ACCTNUMBER     :<111111111  :
PAY_DATE       :<111111>   :
GROSS          :<111111111111   :
DED_CODE       :<1111>   :
PF8=NEXT SCREEN PF7=PREVIOUS SCREEN PF1=OUT
 
 
 
 
...+...1...+...2...+...3...+...4...+...5...+...6...+...7...+...
COMMAND:                                                 1, 40
01=HELP 03=END 07=BACKWARD 08=FORWARD 09=ASGN-FLD 10=ASSIGN 11=FIDEL 17=BOX

CRTFORM * creates labels (that is, text describing each field) on the CRTFORM of up to 12 characters. If the field name is shorter than 12 characters, the label is the field name. If the field name exceeds 12 characters, a caret (>) in the 12th position indicates a longer field name.



x
Terminating Screen Painter

To return to TED from the PAINT screen, enter the command END in the command zone or press PF3 until the prompt for TED appears. TED displays the lines as they have been generated, beginning at the current line, which is ON MATCH CRTFORM:

" <.C.                    EMPLOYEE UPDATE                           <0X
" <.C.                                                              <0X
                        <.C."
" <.C. EMPLOYEE ID #: <D.EMP_ID/09                   LAST NAME:     <0X
<LAST_NAME/15           <.C."
" <.C.                                                              <0X
                        <.C."
" <.C. DEPARTMENT: <T.DEPARTMENT/10>            CURRENT SALARY:     <0X
<T.CURR_SAL/08          <.C."
" <.C.                                                              <0X
                        <.C."
" <.C. BANK <T.BANK_NAME/20                                       <.C."
" <.C.                                                              <0X
DATA
END

The generated code for the CRTFORM is in the file. Notice that each field is named and has its length appended to it. Any attributes or labels requested during the ASSIGN process are also present. If you want to change the layout, you can use the TED editor or you can return to the PAINT and/or ASSIGN screen to make the changes.

You can add further MATCH logic to the FOCEXEC by using TED. For example:

MODIFY FILE EMPLOYEE
CRTFORM
   "ENTER EMPLOYEE ID #: <EMP_ID"
   MATCH EMP_ID
      ON NOMATCH REJECT
      ON MATCH CRTFORM
"        EMPLOYEE UPDATE"
" "
" EMPLOYEE ID #: <D.EMP_ID/09            LAST NAME: <D.LAST_NAME/15"
" "
" DEPARTMENT: <:FIRST.H.T.DEPARTMENT/10> CURRENT SALARY: <0X
<.C.CURR_SAL/08"
" "
" BANK : <BANK_NAME/20"
      ON MATCH UPDATE DEPARTMENT CURR_SAL
      ON MATCH CONTINUE TO BANK_NAME
      ON NOMATCH INCLUDE
      ON MATCH REJECT
DATA
END

If you want to add another CRTFORM screen at this point, make sure you are on the current line, type the CRTFORM or -CRTFORM statement, and reenter PAINT to design the next screen. Finally, you can exit the PAINT screen, return to TED, and add or change further logic.

Alternatively, all of the logic of the request could have been entered first and then the Screen Painter used to create all the FIDEL screens. To create the first screen, enter the command PAINT or PAINT 1; to create the second screen, enter the command PAINT 2. PAINT 2 locates the second CRTFORM statement starting from the current line. You can continue with PAINT 3, and so on, for all subsequent CRTFORM statements in the procedure.


Information Builders