! LSE$EVE_HELP.TPU ! !************************************************************************* ! * ! © Copyright 2005 Hewlett-Packard Development Company, L.P. * ! * ! Confidential computer software. Valid license from HP required for * ! possession, use or copying. Consistent with FAR 12.211 and 12.212, * ! Commercial Computer Software, Computer Software Documentation, and * ! Technical Data for Commercial Items are licensed to the U.S. * ! Government under vendor's standard commercial license. * ! * !************************************************************************* ! !++ ! FACILITY: ! VAX Language-Sensitive Editor ! ! ABSTRACT: ! This file contains superceded EVE procedures that are located in the ! file EVE$HELP.TPU. ! ! ENVIRONMENT: ! VAX/VMS ! ! CREATION DATE: 21-DEC-1989 ! ! MODIFIED BY: ! ! X3.1-1 DAS 21-Dec-89 First pass. ! X4.0-1 LRH 25-Mar-91 Support for new grammar in eve$$keypad_captions ! X4.0-2 LRH 5-Sep-91 Erase $caption$ buffer in eve$$keypad_captions ! X4.0-3 WC3 6-Sep-91 Remove overridden eve$set_key_procedure it was ! for performance only and wasn't that significant. ! Fixes have been made in EVE's copy. ! X4.0-4 SAA 17-Nov-91 Superceded eve$$help_keypad_template; ours uses ! lse$help_text. ! X4.0-5 SAA 12-Dec-91 Removed unnecessary erasures from ! eve$$help_keypad_template. ! X4.0-6 WC3 12-Feb-92 Erase help buffer in eve$$help_keypad_template !- procedure lse$eve_help_module_ident return "X4.0-6"; endprocedure; ! EVE$HELP.TPU Page 38 procedure eve$help_keypad ! --- Obsolete --- (which_key_map_list, which) ! 1 = keypad 2 = key list local help_char, ! Keyword of key to provide help on facility, ! "Facility" - points to library/main-topic topic, ! String with help library subtopic legend, ! Key legend which_choice, ! Local copy of which vt100, ! Set if on a vt100 this_key_map_list, ! Local copy of which_key_map_list answer, ! String user may type in at the prompt to_be_ignored; ! Key-name of the stroke to be ignored on_error [OTHERWISE]: endon_error; this_key_map_list := which_key_map_list; if (this_key_map_list = "") then this_key_map_list := eve$current_key_map_list; endif; facility := ""; which_choice := which; eve$clear_message; eve$x_old_help_topic := ""; vt100 := eve$on_a_pre_lk201; %if eve$x_option_keyhelp %then case which_choice [1]: eve$x_showing_keypad := TRUE; eve$draw_keypad (this_key_map_list); ! draw the keypad [2]: eve$$x_help_showing_keys := TRUE; eve$list_keys (this_key_map_list); ! List the keys endcase; eve$help_status_line; %else eve$x_showing_keypad := TRUE; if eve$x_numeric_keypad then eve$help_text (eve$get_help_item (eve$k_help_facility, "eve"), message_text (EVE$_VT200PADHELP, 1)); else eve$help_text (eve$get_help_item (eve$k_help_facility, "eve"), message_text (EVE$_VT100PADHELP, 1)); endif; %endif loop update (tpu$x_show_window); if (eve$x_showing_keypad) !!! or (eve$$x_help_showing_keys) then answer := eve$prompt_line (message_text (EVE$_HELPKEYRET, 1), HELP, ""); else answer := eve$prompt_line (message_text (EVE$_HELPKEYHELP, 1), HELP, ""); endif; if answer = 0 then return (0); endif; which_choice := 0; ! default to keypad diagram if answer <> "" then topic := "help"; ! Set up topic in case we got an answer edit(answer,lower); if answer = substr (eve$x_keypad, 1, length (answer)) then which_choice := 1; ! keypad diagram else if answer = substr (eve$x_keys, 1, length (answer)) then which_choice := 2; ! keys else return (answer); endif; endif; endif; help_char := last_key; ! A wordaround for ALT-modified key. lse$$check_alt_key(help_char); if help_char = to_be_ignored then to_be_ignored := FALSE; ! ignore mouse up key else ! see if a mouse up key should be ignored next time around loop to_be_ignored := eve$key_to_ignore (help_char); if answer = "" then eve$$parse_comment (help_char, this_key_map_list, facility, legend, topic); else legend := ""; endif; exitif eve$test_synonym ("return", topic); ! perform next/prev screen only if topic_length > window_length if ((eve$test_synonym ("next_screen", topic)) or (eve$test_synonym ("previous_screen", topic)) or (vt100 and ((eve$test_synonym ("move_up", topic)) or (eve$test_synonym ("move_down", topic))))) and (get_info (help_buffer, "record_count") > get_info (tpu$x_show_window, "visible_length") - 1) then if (eve$test_synonym ("next_screen", topic)) or (vt100 and (eve$test_synonym ("move_down", topic))) then eve$move_by_screen (1); else if (eve$test_synonym ("previous_screen", topic)) or (vt100 and (eve$test_synonym ("move_up", topic))) then eve$move_by_screen (-1); endif; endif; eve$set_status_line (tpu$x_show_window); eve$clear_message; else ! switch the facility if the topic = a facility eve$is_help_facility (topic, facility); if topic = "" then if eve$alphabetic (help_char) <> "" then topic := message_text (EVE$_TYPING, 1); else topic := message_text (EVE$_UNKNOWN, 1); ! LSE hack to get the undefined key help from a LSE ! help library. !#### ! BEGIN HACK facility := "lsekeypad"; ! END HACK !#### endif; endif; eve$clear_message; %if eve$x_option_keyhelp %then change_case (legend, LOWER); if eve$test_synonym ("help", topic) then if (legend = topic + " " + eve$x_keypad) and (not eve$x_showing_keypad) then ! draw the keypad which_choice := 1; else if (legend = topic + " " + eve$x_keys) and (not eve$$x_help_showing_keys) then which_choice := 2; endif; endif; endif; if which_choice <> 0 then case which_choice [1]: if eve$x_showing_keypad then eve$message (EVE$_ALRHELP, 0, eve$x_keypad); else eve$draw_keypad (this_key_map_list); endif; eve$x_showing_keypad := TRUE; eve$$x_help_showing_keys := FALSE; [2]: if eve$$x_help_showing_keys then eve$message (EVE$_ALRHELP, 0, eve$x_keys); else eve$list_keys (this_key_map_list); eve$$x_help_showing_keys := TRUE; eve$x_showing_keypad := FALSE; endif; endcase; eve$set_status_line (tpu$x_show_window); eve$x_old_help_topic := ""; ! allow alternate 's else if facility = "" then facility := eve$get_help_item (eve$k_help_facility, "eve"); endif; eve$help_text (facility, topic); ! #### LSE patch: after eve$help_text, the eve$prompt_window get mapped by ! eve$help_enter_prompt which will cause eve$prompt_line issuing already ! performing prompt function error and get stuck. Have to force the window ! upmapped. if get_info (eve$prompt_window, "buffer") <> 0 then unmap(eve$prompt_window); endif; eve$x_showing_keypad := FALSE; eve$$x_help_showing_keys := FALSE; which_choice := 0; endif; %else if (topic = "help " + eve$x_keypad) and (not eve$x_showing_keypad) then eve$x_showing_keypad := TRUE; if eve$x_numeric_keypad then eve$help_text (eve$get_help_item (eve$k_help_facility, "eve"), message_text (EVE$_VT200PADHELP, 1)); else eve$help_text (eve$get_help_item (eve$k_help_facility, "eve"), message_text (EVE$_VT100PADHELP, 1)); endif; eve$x_old_help_topic := ""; ! allow alternate 's else if facility = "" then facility := eve$get_help_item (eve$k_help_facility, "eve"); endif; eve$help_text (facility, topic); eve$x_showing_keypad := FALSE; eve$$x_help_showing_keys := FALSE; endif; %endif endif; ! end of next/prev screen test endif; ! end of ignoring a mouse up key endloop; eve$clear_message; endprocedure; ! ! Superceded simply for performance work and taking advantage of new EDIT ! ! EVE$HELP.TPU Page 43 procedure eve$declare_help_library ! Declare a facility-specific help library (facility, ! facility code (product name), e.g., EVE, TPU, NOTES library; ! file spec for facility help library, doesn't include ! dev:[dir] for logical names to work major_topic, ! top level help topic(s) above the facility topics ! - input (string, or message code) how_to_invoke, ! comment to be added to list of topic displays that ! tells user how to invoke the facility help library, ! e.g., "For help on VAXTPU built-ins, type TPU and ! press RETURN." - input (string, or message code) cs_help_arg_list) ! Arg-list to be used when the HELP widget is used ! Declare a facility help library. local the_facility, temp_string; on_error [OTHERWISE]: endon_error; if get_info (eve$$x_help_facility_array, "type") <> ARRAY then eve$$x_help_facility_array := create_array; eve$$x_help_library_array := create_array; eve$$x_help_fac_topic_array := create_array; eve$$x_help_invoke_array := create_array; eve$$x_help_arg_list_array := create_array; endif; the_facility := edit (facility, COMPRESS, TRIM, LOWER, OFF, NOT_IN_PLACE); eve$$x_help_facility_array {the_facility} := the_facility; eve$$x_help_library_array {the_facility} := library; case get_info (major_topic, "type") [STRING]: eve$$x_help_fac_topic_array {the_facility} := edit (major_topic, COMPRESS, TRIM, UPPER, OFF, NOT_IN_PLACE); [KEYWORD, INTEGER]: temp_string := message_text (major_topic); if temp_string <> 0 then eve$$x_help_fac_topic_array {the_facility} := edit (temp_string, COMPRESS, TRIM, UPPER, OFF); else eve$$x_help_fac_topic_array {the_facility} := ""; endif; [OTHERWISE]: eve$$x_help_fac_topic_array {the_facility} := ""; endcase; case get_info (how_to_invoke, "type") [STRING]: eve$$x_help_invoke_array {the_facility} := how_to_invoke; [KEYWORD, INTEGER]: temp_string := message_text (how_to_invoke); if temp_string <> 0 then eve$$x_help_invoke_array {the_facility} := temp_string; else eve$$x_help_invoke_array {the_facility} := ""; endif; [OTHERWISE]: eve$$x_help_invoke_array {the_facility} := ""; endcase; eve$$x_help_arg_list_array {the_facility} := cs_help_arg_list; return (TRUE); endprocedure; ! eve$declare_help_library ! ! Superceded simply for performance work and taking advantage of new EDIT ! ! EVE$HELP.TPU Page 44 procedure eve$get_help_item ! Return info about facility help library (item_code, a_facility) ! return the specified help item associated with the indicated facility: ! item_code = 0 (eve$k_help_facility), return the facility's facility name ! item_code = 1 (eve$k_help_library), return the facility's library file spec ! item_code = 2 (eve$k_help_topic), return the facility's major help topic ! item_code = 3 (eve$k_help_invoke), return the facility's how-to-invoke ! string ! item_code = 4 (eve$k_help_arg_list), return HELP widget arg-list local the_facility; on_error [OTHERWISE]: endon_error; the_facility := edit (a_facility, COMPRESS, LOWER, TRIM, OFF, NOT_IN_PLACE); if eve$$x_help_facility_array {the_facility} = tpu$k_unspecified then return (""); endif; case item_code [eve$k_help_facility]: ! facility return (eve$$x_help_facility_array {the_facility}); [eve$k_help_library]: ! library return (eve$$x_help_library_array {the_facility}); [eve$k_help_topic]: ! major topic return (eve$$x_help_fac_topic_array {the_facility}); [eve$k_help_invoke]: ! how-to-invoke string return (eve$$x_help_invoke_array {the_facility}); [eve$k_help_arg_list]: return (eve$$x_help_arg_list_array {the_facility}); endcase; endprocedure; ! eve$get_help_item ! ! This routine was superceded in order to use lse$help_text ! procedure eve$$help_keypad_template ! Get the template for draw_keypad (which_key_map_list) ! The keypad diagram is built from one of a set of templates ! stored in the EVE help library. Currently, there are three ! templates in the library, 1 for the vt100, and two for the ! LK201-based terminals (VT200s and later). ! ! The three basic layouts look like this: ! ! VT100 Simple LK201 Full LK201 ! ! [][][][] [][][][] [][][][] [][__] [][__] [][][][] ! [][][][] [][][] [][][] [][][][] ! [][][][] [][][] [][][] [][][][] ! [][][]|| [] [] [][][][] ! [__][]|| [][][] [][][] [][][]|| ! [__][]|| ! ! The full LK201 layout is used if any of the F17-F20 keys or the ! numeric kepad keys are defined. ! ! In each of the diagrams stored in the EVE help file, there are ! flags indicating where the keys go. The flags all start and end ! with a tilde (~). The flags are created with the procedure ! EVE$DEFINE_KEY_CLUSTER. ! ! A number of flags are handled specially. They are: ! ! ~PF1~ Indicates the whole numeric keypad ! ~XXXX~ "Legend" field used for DO key message ! ~GGGG~ "Banner" field used for GOLD keys msg ! ~FFFF~ "Filled" area used for text. ! ! The legend and banner fields are both variable width fields ! whose widths are determined by the number of X's or G's used. ! The legend field is a two line tall field. The text for both ! legends is centered. ! ! The legend field can be used by EVE-based applications. Only one ! application in a section file may use them. (Notes uses them today.) ! To do so, the application places the text to be displayed in the ! legend filed in the two variables EVE$X_HELP_LEGEND_TOP and ! EVE$X_HELP_LEGEND_BOTTOM. ! ! If no application is using the legend EVE uses it to either ! display the "Use the DO key to enter advanced commands" message ! or to list the various DO keys if the LK201 DO key is not ! available or is not bound to DO. ! ! The filled area is a variable width, variable length rectangular ! field used to display text. local keyboard_type; keyboard_type := eve$keyboard_type (which_key_map_list); erase( help_buffer ); lse$help_text (eve$$x_keypad_help_library {keyboard_type}, eve$$x_keypad_help_topic {keyboard_type}, OFF, help_buffer); endprocedure; ! eve$$help_keypad_template ! EVE$HELP.TPU Page 15 procedure eve$$keypad_captions ! Get the text to fill and insert local saved_mark, the_library, ! HELP library containing diagrams the_topic; ! and the major topic saved_mark := mark (FREE_CURSOR); eve$get_help_library_topic (eve$x_facility_for_captions, the_library, the_topic); if get_info (eve$$x_caption_buffer, "type") <> BUFFER then if eve$x_buf_str_caption = tpu$k_unspecified then eve$x_buf_str_caption := "$CAPTION$"; endif; eve$$x_caption_buffer := eve$init_buffer (eve$x_buf_str_caption, "[EOB]"); endif; ! The CLI HELP/KEYPAD works as always, that is, the user can get help on ! keys by pressing such keys in the keypad. The LSE HELP KEYPAD only displays ! the keypad in the buffer $show_$help_keypad, no user interaction is ! available at this time. The following takes care of these 2 instances. ! if get_info(lse$system, "lse$cli_parser") then help_text (the_library, the_topic + "keypad_captions", OFF, eve$$x_caption_buffer); position (beginning_of (eve$$x_caption_buffer)); erase_line; erase_line; erase_line; else ! A blank is written to eve$$x_caption_buffer to prevent instructions ! on getting help on the keys being displayed (CLI functionality). ! position(eve$$x_caption_buffer); erase(current_buffer); copy_text(" "); position(beginning_of(eve$$x_caption_buffer)); endif; position (saved_mark); return (eve$$x_caption_buffer); endprocedure; ! eve$$keypad_captions