Form PHONE_BOOK /************************************************************************ /* Copyright (c) 1989 By /* Digital Equipment Corporation, Maynard, Mass. /* /* This software is furnished under a license and may be used and copied /* only in accordance with the terms of such license and with the /* inclusion of the above copyright notice. This software or any other /* copies thereof may not be provided or otherwise made available to any /* other person. no title to and ownership of the software is hereby /* transferred. /* /* The information in this software is subject to change without notice /* and should not be construed as a commitment by Digital Equipment /* Corporation. /* /* Digital assumes no responsibility for the use or reliability of its /* software on equipment which is not supplied by Digital. /************************************************************************ /* /* This form demonstrates a simple phone book application. /* /* This form shows examples of: /* /* Multiple Line Scrolling /* Each occurrence of the group takes up three lines. Thus /* when the group is scrolled one instance, three physical lines /* are scrolled. /* /* Pull-Down Menus /* It shows how to pull down the same menu at various locations /* on the display. /* /* Procedural Escapes /* It shows how simple mathematical and more complex procedural /* escapes are called from IFDL. /* /* Output Whens /* It shows how some fields (with insertion literals) can be /* effectively concealled without using concealled when functionality. /* /* First and Current Form Data Item Usage /* It shows some examples of use the First and Current form data /* to display pull-down menus /* /* Printing Support /* It shows an example of how to use a printing viewport and panel /* to generate a large hardcopy list /* /*********************************************************************/ /* /* 3-March-1989 JWP Original Version /* /*********************************************************************/ Form Data /* /* Variables that contain the First and Current values. /*/ PREVIOUS_ENTRY Unsigned Longword CURRENT_ENTRY Unsigned Longword FIRST_ENTRY Unsigned Longword TEMP_ENTRY Unsigned Longword /* /* The Phone Book group, note that a current data item is declared. /*/ Group LISTING Occurs 30 Current CURRENT_ENTRY NAME Character(25) COMMENT Character(25) HOME_AREA_CODE Character(3) HOME_NUMBER Character(7) WORK_AREA_CODE Character(3) WORK_NUMBER Character(7) MARKER Character(1) End Group End Data Form Data FUNCTIONNAME Character(13) Builtin /* /* Pull-Down values that determine which viewport /* to display the options menu in. /*/ TEMP_CHOICE Unsigned Longword VIEWPORT_CHOICE Unsigned Longword /* /* Constants /*/ ONE Unsigned Longword Value 1 SIX Unsigned Longword Value 6 /* /* Create/Modify Entry Form Data Items. /*/ MENU_TITLE Character(7) MODIFIED Character(1) MOD_NAME Character(25) MOD_COMMENT Character(25) MOD_HOME_Area_Code Character(3) MOD_HOME_NUMBER Character(7) MOD_WORK_Area_Code Character(3) MOD_WORK_NUMBER Character(7) REMOVE_NAME Character(25) REMOVAL_CONFIRMATION Character(1) PRESS_RETURN Character(1) End Data /* /* Phone Book Record Definition. This record is both the send and /* receive record for the Transceive request. /*/ Form Record PHONE_BOOK_RECORD Group LISTING Occurs 30 NAME Character(25) COMMENT Character(25) HOME_AREA_CODE Character(3) HOME_NUMBER Character(7) WORK_AREA_CODE Character(3) WORK_NUMBER Character(7) End Group End Record Layout VT_LAYOUT Device Terminal Type %VT100 End Device Size 24 Lines by 80 Columns /* /* Viewport Declarations /*/ Viewport PHONE_BOOK_VP Lines 1 Through 23 Columns 1 Through 80 End Viewport Viewport MODIFY_VP Lines 4 Through 15 Columns 20 Through 60 End Viewport Viewport REMOVE_VP Lines 4 Through 15 Columns 20 Through 60 End Viewport Viewport PRINT_PHONE_BOOK_VP For Printing Lines 1 Through 100 Columns 1 Through 80 End Viewport Viewport PHONE_BOOK_HELP_VP Lines 1 Through 23 Columns 1 Through 80 End Viewport /* /* Options viewport declarations. Note that each possible viewport /* that the options panel could be displayed in is declared here. /* How we know which viewport to display the panel in is calculated /* in the Select Function Response in the Phone_Book_Panel /*/ Viewport OPTIONS_VP_1 Lines 2 Through 8 Columns 15 Through 32 End Viewport Viewport OPTIONS_VP_2 Lines 5 Through 11 Columns 15 Through 32 End Viewport Viewport OPTIONS_VP_3 Lines 8 Through 14 Columns 15 Through 32 End Viewport Viewport OPTIONS_VP_4 Lines 11 Through 17 Columns 15 Through 32 End Viewport Viewport OPTIONS_VP_5 Lines 14 Through 20 Columns 15 Through 32 End Viewport Viewport OPTIONS_VP_6 Lines 17 Through 23 Columns 15 Through 32 End Viewport /* /* Function Key Declarations /*/ Function QUIT Is %F8 (%PF1 %CAPITAL_Q) (%PF1 %SMALL_Q) End Function Function EXIT_FORM Is %F10 %CONTROL_Z (%PF1 %CAPITAL_X) (%PF1 %SMALL_X) End Function Function SELECT Is %SELECT %KP_PERIOD End Function Function NEXT_SCREEN Is %NEXT_SCREEN End Function Function PREV_SCREEN Is %PREV_SCREEN End Function Function CURSOR_UP Is %UP End Function Function CURSOR_DOWN Is %DOWN End Function Function CURSOR_RIGHT Is %RIGHT End Function Function CURSOR_LEFT Is %LEFT End Function /* /* Function Response Declarations /*/ /* /* Define Next and Previous screen /* as doing nothing at the layout level. /*/ Function Response PREV_SCREEN End Response Function Response NEXT_SCREEN End Response /* /* Define the up and down arrows to position to the previous and next /* active items, respectively. /*/ Function Response CURSOR_DOWN If LAST ITEM Then Message %NO_DOWN_ITEM Else Position To Next Item End If End Response Function Response CURSOR_UP If FIRST ITEM Then Message %NO_UP_ITEM Else Position To Previous Item End If End Response /* /* Define the right and left arrows to position to the right and left /* active items, respectively. /*/ Function Response CURSOR_RIGHT If RIGHTMOST ITEM Then Message %NO_RIGHT_ITEM Else Position To Right Item End If End Response Function Response CURSOR_LEFT If LEFTMOST ITEM Then Message %NO_LEFT_ITEM Else Position To Left Item End If End Response /* /* External Response Declarations /*/ Disable Response /* /* We activate this panel because the Form Manager will only /* return control text from Accept Phase. We want to return /* control when the phone book list has been modified (add, /* delete, or modify was executed). /*/ Activate Panel CLOSING_PANEL End Response Transceive Response PHONE_BOOK_RECORD PHONE_BOOK_RECORD /* /* We display a help message, and activate the main phone book /* panel. /*/ Message "Press Select to display phone book options. Press Help anytime for Help." Activate Panel PHONE_BOOK_PANEL End Response /* /* Define a layout wide help panel. /*/ Use Help Panel Phone_Book_Help_Panel /* /* Define a layout wide field default. /*/ Apply Field Default Of Active Highlight Reverse Bold Autoskip End Default Panel PHONE_BOOK_PANEL Viewport PHONE_BOOK_VP Display %Keypad_Application /* /* This panel displays a list of phone book entries and /* allows the user to scroll through that list using the /* arrow keys and the next/previous screen keys. /*/ /* /* Define what happens when F10 (Exit) or F8 (Quit) is pressed. /* In this panel, we want to return immediate (no validation), /* and leave the application. /*/ Function Response EXIT_FORM Return Immediate End Response Function Response QUIT Return Immediate End Response /* /* Define what happens when Next and Previous Screen is pressed. /* In this panel, first is manipulated such that we scroll the /* list by a page in the specified direction. By changing the /* value of first, the Form Manager automatically updates what /* portion of the list is actually displayed. /*/ Function Response NEXT_SCREEN Call "Forms$$Demo_Phone_ADD" Using By Reference FIRST_ENTRY By Reference SIX Giving TEMP_ENTRY Let FIRST_ENTRY = TEMP_ENTRY Position To Field LISTING(FIRST_ENTRY).MARKER On PHONE_BOOK_PANEL End Response Function Response PREV_SCREEN Call "Forms$$Demo_Phone_SUB" Using By Reference FIRST_ENTRY By Reference SIX Giving TEMP_ENTRY Let FIRST_ENTRY = TEMP_ENTRY Position Immediate To Field LISTING(FIRST_ENTRY).MARKER On PHONE_BOOK_PANEL End Response /* /* Define the panel group Listing. Note that we have declared a /* first data item on this group. /*/ Group LISTING Vertical Displays 6 First FIRST_ENTRY /* /* Field Marker. This is the only field that we can actually /* visit on this panel. The user can only visit this field /* if the corresponding name field is non-blank, or the previous /* occurrence's name field is non-blank. In the field's entry /* response the field get's set to '`' which will display a /* diamond in the graphics (rule) character set. /*/ Field MARKER Line 2 Column 13 Entry Response /* /* Determine if we can visit this field by checking the /* prior fields name for non-blanks. /* /* Procedural escape FORMS$$DEMO_PHONE_SUB is used to /* subtract one from the 'current' position in the list /* denoted by the current form data item, CURRENT_ENTRY. /*/ Call "FORMS$$DEMO_PHONE_SUB" Using By Reference CURRENT_ENTRY By Reference ONE Giving PREVIOUS_ENTRY If (PREVIOUS_ENTRY < 1) Then Let PREVIOUS_ENTRY = CURRENT_ENTRY End If If (((CURRENT_ENTRY > 1) AND (LISTING(CURRENT_ENTRY).NAME = " "- " ")) AND (LISTING(PREVIOUS_ENTRY).NAME = " "- " ")) Then Position To Previous Item Else Let LISTING(CURRENT_ENTRY).MARKER = "`" End If End Response /* /* When we leave the field, reset the field's value. /*/ Exit Response Let LISTING(CURRENT_ENTRY).MARKER = " " End Response /* /* When Select is pressed, determine which viewport /* to display the options panel in. /*/ Function Response SELECT /* /* Determine which visible entry we are currently on. /* Current_Entry - First_Entry + 1 will yield a value /* between 1 and 6, denoting the viewport to display /* the options panel in. /*/ Call "Forms$$Demo_Phone_SUB" Using By Reference CURRENT_ENTRY By Reference FIRST_ENTRY Giving TEMP_CHOICE Call "Forms$$Demo_Phone_ADD" Using By Reference TEMP_CHOICE By Reference ONE Giving VIEWPORT_CHOICE /* /* Display the panel in the specified viewport. /*/ If ((VIEWPORT_CHOICE = 0) OR (VIEWPORT_CHOICE = 1)) Then Display OPTIONS_PANEL on OPTIONS_VP_1 End If If (VIEWPORT_CHOICE = 2) Then Display OPTIONS_PANEL on OPTIONS_VP_2 End If If (VIEWPORT_CHOICE = 3) Then Display OPTIONS_PANEL on OPTIONS_VP_3 End If If (VIEWPORT_CHOICE = 4) Then Display OPTIONS_PANEL on OPTIONS_VP_4 End If If (VIEWPORT_CHOICE = 5) Then Display OPTIONS_PANEL on OPTIONS_VP_5 End If If (VIEWPORT_CHOICE = 6) Then Display OPTIONS_PANEL on OPTIONS_VP_6 End If Activate Panel OPTIONS_PANEL Position Immediate To Icon ADD_ICON On OPTIONS_PANEL End Response Validation Response /* /* Don't allow the user to position to the next /* field (next occurrence) if the current name is blank. /* Always allow the user to position to a previous /* occurrence. /*/ If ((FUNCTIONNAME = "PREVIOUS ITEM") OR (FUNCTIONNAME = "CURSOR_UP ")) Then Position To Previous Item Else If (LISTING(CURRENT_ENTRY).NAME = " "- " ") Then Invalid Signal Message "Press Select to enter a name before "- "moving to the next entry." End If End If End Response Display Character Set Private_Rule No Data Input End Field /* /* Highlight the name field when we are positioned /* next to it. /*/ Field NAME Line 2 Column 15 Highlight Reverse When (LISTING(**).MARKER = "`") Protected End Field Field COMMENT Line 2 Column 44 Protected End Field /* /* When the telephone number fields are empty, output /* spaces. This will also hide the insertion literals /* and not clutter up the display with parens, dashes, /* and 0's. /*/ Field HOME_AREA_CODE Line 3 Column 21 Output Picture '('999')' Output " " When (LISTING(**).HOME_AREA_CODE = " ") Or (LISTING(**).HOME_AREA_CODE = 0) Protected End Field Field HOME_NUMBER Line 3 Column 26 Output Picture 999'-'9999 Output " " When (LISTING(**).HOME_NUMBER = " ") Or (LISTING(**).HOME_NUMBER = 0) Protected End Field Literal Text Line 3 Column 15 Value "Home: " End Literal Field WORK_AREA_CODE Line 3 Column 50 Output Picture '('999')' Output " " When (LISTING(**).WORK_AREA_CODE = " ") Or (LISTING(**).WORK_AREA_CODE = 0) Protected End Field Field WORK_NUMBER Line 3 Column 55 Output Picture 999'-'9999 Output " " When (LISTING(**).WORK_NUMBER = " ") Or (LISTING(**).WORK_NUMBER = 0) Protected End Field Literal Text Line 3 Column 44 Value "Work: " End Literal Literal Text Line 2 Column 41 Value "||" End Literal Literal Polyline Line 4 Column 68 Line 4 Column 12 End Literal Literal Polyline Line 2 Column 12 Line 4 Column 12 End Literal Literal Polyline Line 2 Column 69 Line 4 Column 69 End Literal Literal Text Line 4 Column 69 Value "u" Display Character Set Private_Rule End Literal Literal Text Line 4 Column 12 Value "t" Display Character Set Private_Rule End Literal /* /* These null literals tell the Form Manager that /* the group extends to both ends of the screen. /* This allows hardware scrolling to be performed. /*/ Literal Text Line 2 Column 1 Value "" End Literal Literal Text Line 4 Column 3 Value "" End Literal Literal Text Line 2 Column 80 Value "" End Literal End Group /* /* These graphic literals resolve some of the /* lines in the panel and make the display look /* nicer. /*/ Literal Text Line 1 Column 69 Value "k" Display Character Set Private_Rule End Literal Literal Text Line 1 Column 12 Value "l" Display Character Set Private_Rule End Literal Literal Text Line 20 Column 69 Value "j" Display Character Set Private_Rule End Literal Literal Text Line 20 Column 12 Value "m" Display Character Set Private_Rule End Literal Literal Polyline Line 20 Column 13 Line 20 Column 68 End Literal Literal Text Line 20 Column 28 Value " DECforms Phone Book V1.1" End Literal Literal Polyline Line 1 Column 68 Line 1 Column 13 End Literal End Panel Panel OPTIONS_PANEL Viewport OPTIONS_VP_1 /* /* This panel offers the user a list of options for /* the user to choose from. These options include /* Adding an entry, Removing an entry, Modifying an /* entry, printing a list of entries, and exiting the /* application. /*/ /* /* When leaving this panel, remove any viewport /* that this panel might have been displayed in, /* and deactivate this panel. /*/ Exit Response Remove OPTIONS_VP_1 OPTIONS_VP_2 OPTIONS_VP_3 OPTIONS_VP_4 OPTIONS_VP_5 OPTIONS_VP_6 Deactivate Panel OPTIONS_PANEL End Response /* /* If F10 or F8 is pressed, then reposition to the /* previous entry on the main panel. /*/ Function Response EXIT_FORM Position To Field LISTING(CURRENT_ENTRY).MARKER On PHONE_BOOK_PANEL End Response Function Response QUIT Position To Field LISTING(CURRENT_ENTRY).MARKER On PHONE_BOOK_PANEL End Response Literal Rectangle Line 1 Column 1 Line 7 Column 18 End Literal Icon ADD_ICON /* /* If the user tries to leave this panel by /* pressing up arrow or backspace on this entry, /* then position to the previous entry on the main /* panel. (Since this is the first option on the list.) /* /* If the user presses Select on this icon, then /* activate the panel which will allow the user to /* enter a new entry. /*/ Function Response PREVIOUS ITEM Position To Field LISTING(CURRENT_ENTRY).MARKER On PHONE_BOOK_PANEL End Response Function Response CURSOR_UP Position To Field LISTING(CURRENT_ENTRY).MARKER On PHONE_BOOK_PANEL End Response Function Response SELECT Let MENU_TITLE = " Create" Activate Panel CREATE_MODIFY_PANEL Position To Field MOD_NAME On CREATE_MODIFY_PANEL End Response Literal Text Line 2 Column 3 Value " Add Entry " Display Bold End Literal End Icon Icon REMOVE_ICON /* /* If the user presses Select on this icon, then /* activate the panel which will allow the user to /* remove the current entry. /*/ Function Response SELECT If (LISTING(CURRENT_ENTRY).NAME <> " "- " ") Then Let REMOVE_NAME = LISTING(CURRENT_ENTRY).NAME Activate Panel REMOVE_PANEL Position To Next Panel Else Signal Message "To remove an entry you must be positioned on "- "that entry." Position To Field LISTING(CURRENT_ENTRY).MARKER On PHONE_BOOK_PANEL End If End Response /* /* Note that we only highlight and unprotect this /* entry if the user is positioned on an existing /* entry. /*/ Highlight Bold When (LISTING(CURRENT_ENTRY).NAME <> " "- " ") Protected When (LISTING(CURRENT_ENTRY).NAME = " "- " ") Literal Text Line 3 Column 3 Value " Remove Entry " End Literal End Icon Icon MODIFY_ICON /* /* If the user presses Select on this icon, then /* activate the panel which will allow the user to /* modify the current entry. /*/ Function Response SELECT If (LISTING(CURRENT_ENTRY).NAME <> " "- " ") Then Let MENU_TITLE = " Modify" Let MOD_NAME = LISTING(CURRENT_ENTRY).NAME Let MOD_COMMENT = LISTING(CURRENT_ENTRY).COMMENT Let MOD_HOME_Area_Code = LISTING(CURRENT_ENTRY).HOME_Area_Code Let MOD_HOME_NUMBER = LISTING(CURRENT_ENTRY).HOME_NUMBER Let MOD_WORK_Area_Code = LISTING(CURRENT_ENTRY).WORK_Area_Code Let MOD_WORK_NUMBER = LISTING(CURRENT_ENTRY).WORK_NUMBER Activate Panel CREATE_MODIFY_PANEL Position To Field MOD_COMMENT On CREATE_MODIFY_PANEL Else Signal Message "To modify an entry you must be positioned on an "- "entry." Position To Field LISTING(CURRENT_ENTRY).MARKER On PHONE_BOOK_PANEL End If End Response /* /* Note that we only highlight and unprotect this /* entry if the user is positioned on an existing /* entry. /*/ Highlight Bold When (LISTING(CURRENT_ENTRY).NAME <> " "- " ") Protected When (LISTING(CURRENT_ENTRY).NAME = " "- " ") Literal Text Line 4 Column 3 Value " Modify Entry " End Literal End Icon Icon PRINT_ICON /* /* If the user presses Select on this icon, then /* print the phone book printing panel in the /* printing viewport. The file that gets generated /* is specified at enable time through the item list. /*/ Function Response SELECT Print Immediate PRINT_PHONE_BOOK_PANEL Message "Phone Book Listing Printed." Position To Previous Panel End Response Literal Text Line 5 Column 3 Value " Print List " Display Bold End Literal End Icon Icon EXIT_ICON /* /* If the user tries to leave this panel by /* pressing down arrow, return or tab on this entry, /* then position to the previous entry on the main /* panel. (Since this is the last option on the list.) /* /* If the user presses Select on this icon, then /* return immediate. This option shuts down the /* application. /*/ Function Response SELECT Message "Leaving Phone Book Application..." Return Immediate End Response Function Response CURSOR_DOWN Position To Field LISTING(CURRENT_ENTRY).MARKER On PHONE_BOOK_PANEL End Response Function Response NEXT ITEM Position To Field LISTING(CURRENT_ENTRY).MARKER On PHONE_BOOK_PANEL End Response Literal Text Line 6 Column 3 Value " Exit " Display Bold End Literal End Icon End Panel Panel CREATE_MODIFY_PANEL Viewport MODIFY_VP /* /* This panel serves as both the create entry and /* modify entry panel. The title on the banner is /* controled by the contents of a field. /*/ /* /* When leaving this panel, remove the viewport /* and deactivate this panel. Also reset the /* data items used. /*/ Exit Response Remove MODIFY_VP Deactivate Panel CREATE_MODIFY_PANEL Reset MOD_NAME MOD_COMMENT MOD_HOME_AREA_CODE MOD_HOME_NUMBER MOD_WORK_AREA_CODE MOD_WORK_NUMBER End Response /* /* If F10 is pressed, then add or modify the entry /* as specified by the panel's title. In either case, /* return to the main phone book panel and position /* to the created or modified entry. /*/ Function Response EXIT_FORM If (MENU_TITLE = " Create") Then /* /* We wish to create an entry. Call procedural /* escape FORMS$$DEMO_ADD_TO_LIST to add the entry /* alphabetically to the list. /*/ If (MOD_NAME <> " ") Then Call "FORMS$$DEMO_ADD_TO_LIST" Using By Reference MOD_NAME By Reference MOD_COMMENT By Reference MOD_HOME_AREA_CODE By Reference MOD_HOME_NUMBER By Reference MOD_WORK_AREA_CODE By Reference MOD_WORK_NUMBER By Reference PHONE_BOOK_RECORD By Reference FIRST_ENTRY Position To Field LISTING(FIRST_ENTRY).MARKER On PHONE_BOOK_PANEL End If Else /* /* We wish to modify the entry. Simply copy the /* modified data back to the original entry. /*/ Let LISTING(CURRENT_ENTRY).NAME = MOD_NAME Let LISTING(CURRENT_ENTRY).COMMENT = MOD_COMMENT Let LISTING(CURRENT_ENTRY).HOME_AREA_CODE = MOD_HOME_AREA_CODE Let LISTING(CURRENT_ENTRY).HOME_NUMBER = MOD_HOME_NUMBER Let LISTING(CURRENT_ENTRY).WORK_AREA_CODE = MOD_WORK_AREA_CODE Let LISTING(CURRENT_ENTRY).WORK_NUMBER = MOD_WORK_NUMBER Position To Field LISTING(CURRENT_ENTRY).MARKER On PHONE_BOOK_PANEL End If /* /* In either case, set the modified flag. /*/ Let MODIFIED = "T" End Response /* /* If we wish to quit, then simply position back to the /* entry on the main panel. /*/ Function Response QUIT Position Immediate To Field LISTING(CURRENT_ENTRY).MARKER On PHONE_BOOK_PANEL End Response Literal Text Line 1 Column 1 Value "l" Display Character Set Private_Rule End Literal Literal Text Line 1 Column 41 Value "k" Display Character Set Private_Rule End Literal Literal Polyline Line 2 Column 1 Line 12 Column 1 Line 12 Column 41 Line 2 Column 41 End Literal Literal Text Line 3 Column 3 Value "Enter the new values:" End Literal Literal Text Line 5 Column 5 Value "Name:" End Literal /* /* Protect this field during a modify operation since /* modifing the name might cause the list to be out of /* order, alphabetically. /*/ Field MOD_NAME Line 5 Column 14 Highlight Underlined When (MENU_TITLE = " Create") Uppercase Minimum Length 1 Protected When (MENU_TITLE = " Modify") End Field Literal Text Line 6 Column 5 Value "Comment:" End Literal Field MOD_COMMENT Line 6 Column 14 Display Underlined End Field Literal Text Line 8 Column 5 Value "Home Phone:" End Literal /* /* When the telephone number fields are empty, output /* spaces. This will also hide the insertion literals /* and not clutter up the display with parens, dashes, /* and 0's. /*/ Field MOD_HOME_AREA_CODE Line 8 Column 17 Display Underlined Output Picture '('999')' Output " " When (MOD_HOME_AREA_CODE= " ") Or (MOD_HOME_AREA_CODE= 0) End Field Field MOD_HOME_NUMBER Line 8 Column 23 Display Underlined Output Picture 999'-'9999 Output " " When (MOD_HOME_NUMBER = " ") Or (MOD_HOME_NUMBER = 0) End Field Literal Text Line 9 Column 5 Value "Work Phone:" End Literal Field MOD_WORK_AREA_CODE Line 9 Column 17 Display Underlined Output Picture '('999')' Output " " When (MOD_WORK_AREA_CODE= " ") Or (MOD_WORK_AREA_CODE= 0) End Field Field MOD_WORK_NUMBER Line 9 Column 23 /* /* Don't allow the user to get to the next field /* from this field (the last field). The next field /* is on a different panel. /*/ Function Response NEXT ITEM Signal Message "No next item." End Response No Autoskip Display Underlined Output Picture 999'-'9999 Output " " When (MOD_WORK_NUMBER = " ") Or (MOD_WORK_NUMBER = 0) End Field Literal Text Line 11 Column 6 Value "Press" End Literal Literal Text Line 11 Column 12 Value "F10" Display Bold End Literal Literal Text Line 11 Column 16 Value "to Exit," End Literal Literal Text Line 11 Column 25 Value "F8" Display Bold End Literal Literal Text Line 11 Column 28 Value "to Quit." End Literal /* /* This field displays the type of menu /* the user invoked (Create or Modify). /*/ Field MENU_TITLE Line 1 Column 2 Display Reverse Protected End Field Literal Text Line 1 Column 9 Value " Entry Menu " Display Reverse End Literal End Panel Panel REMOVE_PANEL Viewport REMOVE_VP /* /* This panel warns the user that the specified /* field is going to be deleted. If the user /* selects Ok then the field is deleted. If the /* user presses Cancel, then the deletion is aborted. /*/ Entry Response Position To Icon CANCEL_ICON On REMOVE_PANEL End Response /* /* When leaving this panel, remove the viewport /* and deactivate this panel. /*/ Exit Response Remove REMOVE_VP Deactivate Panel REMOVE_PANEL End Response /* /* If exit or quit is entered, then abort the /* delete operation (the default behavior). To /* actually delete the option, the user MUST press /* Select on the Ok Option (Icon). /*/ Function Response EXIT_FORM Message "Entry removal cancelled." Position To Field LISTING(CURRENT_ENTRY).MARKER On PHONE_BOOK_PANEL End Response Function Response QUIT Message "Entry removal cancelled." Position To Field LISTING(CURRENT_ENTRY).MARKER On PHONE_BOOK_PANEL End Response Literal Text Line 1 Column 1 Value "l" Display Character Set Private_Rule End Literal Literal Text Line 1 Column 2 Value " Remove Entry Verification " Display Reverse Character Set Private_User_Preference End Literal Literal Text Line 1 Column 41 Value "k" Display Character Set Private_Rule End Literal Literal Polyline Line 2 Column 1 Line 12 Column 1 Line 12 Column 41 Line 2 Column 41 End Literal /* /* Display the name that is a candidate for deletion. /*/ Field REMOVE_NAME Line 7 Column 9 Protected End Field Literal Text Line 4 Column 7 Value "Do you really want to remove" End Literal Literal Text Line 5 Column 16 Value "this entry?" End Literal Literal Rectangle Line 9 Column 24 Line 11 Column 33 Display Bold End Literal Literal Rectangle Line 9 Column 8 Line 11 Column 13 End Literal Icon OK_ICON /* /* If this option is selected, then call procedural /* escape FORMS$$DEMO_REMOVE_FROM_LIST to remove the /* entry from the list. /*/ Function Response SELECT Call "FORMS$$DEMO_REMOVE_FROM_LIST" Using By Reference PHONE_BOOK_RECORD By Reference CURRENT_ENTRY Message "Entry successfully removed." Let MODIFIED = "T" Position To Field LISTING(CURRENT_ENTRY).MARKER On PHONE_BOOK_PANEL End Response Literal Text Line 10 Column 9 Value " OK " End Literal End Icon Icon CANCEL_ICON /* /* If this option is selected, then simply return /* to the main panel as we are not going to delete /* this entry. /*/ Function Response SELECT Message "Entry removal cancelled." Position To Field LISTING(CURRENT_ENTRY).MARKER On PHONE_BOOK_PANEL End Response Function Response NEXT ITEM Signal Message "No next item." End Response Literal Text Line 10 Column 25 Value " Cancel " End Literal End Icon Literal Text Line 3 Column 3 Value " ! " Display Reverse End Literal End Panel Panel PRINT_PHONE_BOOK_PANEL Viewport PRINT_PHONE_BOOK_VP /* /* This panel is contained in a printing viewport /* because it lists every occurrence of the phone book /* listing group and is too large to display in the /* layout. A panel larger than the layout must be /* associated with a printing viewport. /* /* This panel is printed (via the PRINT response step), /* and will contain the complete list of phone book entries. /*/ Group LISTING Vertical Displays 30 Field NAME Line 3 Column 15 End Field Field HOME_AREA_CODE Line 4 Column 21 Output Picture '('999')' End Field Field HOME_NUMBER Line 4 Column 26 Output Picture 999'-'9999 End Field Field COMMENT Line 3 Column 44 End Field Literal Text Line 4 Column 15 Value "Home: " End Literal Field WORK_AREA_CODE Line 4 Column 50 Output Picture '('999')' End Field Field WORK_NUMBER Line 4 Column 55 Output Picture 999'-'9999 End Field Literal Text Line 4 Column 44 Value "Work: " End Literal Literal Text Line 3 Column 41 Value "||" End Literal Literal Polyline Line 5 Column 68 Line 5 Column 12 End Literal End Group Literal Text Line 1 Column 28 Value " DECforms Phone Book V1.1 " End Literal End Panel Panel CLOSING_PANEL /* /* This panel is activated from the disable response /* and is used to return control text which indicates /* the modifiation state of the phone book list. /* /* Since DECforms can only return control text /* during Accept Phase, this dummy panel contains /* the return response in it's entry response. Thus /* it never gets displayed. /*/ Entry Response If (MODIFIED = "T") Then Return " FWRT" Else Return End If End Response Field MOD_NAME Line 5 Column 14 End Field End Panel Help Panel Phone_Book_Help_Panel Viewport PHONE_BOOK_HELP_VP /* /* This panel contains help text to inform the user /* how to use the Phone Demo. /*/ /* /* Display a message on panel entry, and clear the message /* panel on panel exit. /*/ Entry Response Message "Press Return to get back to the phone book." End Response Exit Response Remove PHONE_BOOK_HELP_VP Message " " End Response /* /* When the user presses Return or F10 or F8, exit help. /*/ Function Response NEXT ITEM Exit Help End Response Function Response EXIT_FORM Exit Help End Response Function Response QUIT Exit Help End Response Literal Text Line 2 Column 17 Value "DECforms Phone Book Help" Display Font Size Double High End Literal Literal Rectangle Line 3 Column 1 Line 23 Column 80 End Literal Literal Text Line 5 Column 3 Value "This demonstration application implements a simple "- "phone book. Initially, " End Literal Literal Text Line 6 Column 3 Value "a list is displayed which the user may scroll through, "- "and modify. To" End Literal Literal Text Line 7 Column 3 Value "scroll through the list, use the up and down arrow, "- "and the next/previous" End Literal Literal Text Line 8 Column 3 Value "screen keys. To modify the list, press Select and you "- "will be asked to " End Literal Literal Text Line 9 Column 3 Value "choose from a list of options:" End Literal Literal Text Line 11 Column 3 Value "Create:" Display Bold End Literal Literal Text Line 11 Column 11 Value "Selecting this option will allow you to create a new "- "entry. Note" End Literal Literal Text Line 12 Column 11 Value "that entries are added alphabetically to the list." End Literal Literal Text Line 13 Column 3 Value "Remove:" Display Bold End Literal Literal Text Line 13 Column 11 Value "Selecting this option" End Literal Literal Text Line 13 Column 33 Value "will remove the current entry from the list." End Literal Literal Text Line 14 Column 3 Value "Modify:" Display Bold End Literal Literal Text Line 14 Column 11 Value "Selecting this option will allow you to change the "- "data associated" End Literal Literal Text Line 15 Column 11 Value "with the current entry." End Literal Literal Text Line 16 Column 3 Value "Print :" Display Bold End Literal Literal Text Line 16 Column 11 Value "Selecting this option will create a file containing a "- "complete, " End Literal Literal Text Line 17 Column 11 Value "current list of names an numbers." End Literal Literal Text Line 18 Column 3 Value "Exit :" Display Bold End Literal Literal Text Line 18 Column 11 Value "Selecting this option will exit the phone book "- "application, writing" End Literal Literal Text Line 19 Column 11 Value "out a new phone book file if any entry was added, "- "modified, or" End Literal Literal Text Line 20 Column 11 Value "deleted." End Literal Literal Text Line 22 Column 27 Value "Press RETURN to continue..." Display Bold End Literal Field PRESS_RETURN Line 22 Column 54 No Data Input End Field End Panel End Layout End Form