! LSE$DECWINDOWS.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 TPU procedures for LSE that relate to the contents ! of the EVE$DECWINDOWS.TPU file. ! ! ENVIRONMENT: ! VAX/VMS ! !Author: Glenn J. Joyce ! ! CREATION DATE: 9-Aug-1988 ! ! MODIFIED BY: ! X2.3 GJJ 9-Aug-88 Created module with new definition of ! EVE$$RESIZE_ACTION routine to account for a ! three line message buffer. ! X2.3-1 GJJ 11-Aug-88 Added LSE widget definitions. ! X2.3-2 GJJ 19-Aug-88 Added widget definition of NEXT OCCURRENCE. ! X2.3-3 GJJ 21-Aug-88 Added LSE dialog box dispatches. ! X2.3-4 GJJ 23-Aug-88 Added EXIT to the FILE pull down. Corrected ! the definition of the REVIEW widget. ! X2.3-5 GJJ 30-Aug-88 Pick up the new definition of EVE$$RESIZE_ACTION ! for the DECwindows V1 TPU. Superseeded the ! definition of EVE$$RESIZE_SYSTEM_WINDOWS to ! provide for a 3 line message window. ! X2.3-6 GJJ 13-Sep-88 Changed the TPU dispatch routine for the CMS ! preferences dialog box. ! X2.3-7 CCC 16-Sep-88 Add SEARCH/SUBSTITUTE/SEARCH PREF,ETC ! X2.3-8 GJJ 16-Sep-88 Put the declarations of LSE's widgets back in ! synch with the declarations of the widget closure ! values in LSE$CONSTANTS.SDL. Added a beware notice ! at the top of the file explaining this dependency. ! The dependency should go away when a baselevel of ! Eve V2.3 is picked up. Fixed the recalculation of ! the position of the prompt window in ! EVE$$RESIZE_SYSTEM_WINDODWS. Added code to set ! the correct values for LSE$SCREEN_MIDDLE and ! LSE$SCREEN_BOTTOM after a resize operation. ! X2.3-9 GHL 21-Sep-88 Remove a number of menu items and remove "..." ! from some menu labels. Change CLOSE to invoke ! a CLOSE BUFFER command. Add /INDICATED to Find ! Symbol and Find Declaration. ! X2.3-10 GJJ 19-Sep-88 Added widget definitions for the OPEN dialog box. ! X2.3-11 GHL 21-Sep-88 Add calls to EVE$$DEFINE_WIDGET for the "Change ! Indentation" dialog box. ! X2.3-12 CCC 22-Sep-88 Change eve's code into LSE code convension. ! X2.3-13 CCC 23-Sep-88 Remove replace patten/case_sensitive callback ! X2.3-14 CCC 27-Sep-88 Add widget defines for "SET INTERFACE" dialog box. ! X2.3-15 GJJ 27-Sep-88 Added widget definitions for LSE's version of the ! INCLUDE dialog box. ! X2.3-16 CCC 27-Sep-88 Add pending_delete for SET INTERFACE dialog box. ! X2.3-17 GJJ 28-Sep-88 Modify our definition of EVE$$RESIZE_SYSTEM_WINDOWS ! so that the command window and the message window ! are in the correct position and they are the correct ! sizes. ! X2.3-18 GJJ 29-Sep-88 Added widget definition for LSE$$K_NEW. ! X2.3-19 WCC 15-Sep-88 Add DEFINE KEY dialog box ! X2.3-20 CCC 28-Sep-88 Add forward/reverse widgets for FIND DIALOG BOX. ! X2.3-21 WCC 03-Oct-88 Add SAVE FILE AS dialog box ! X2.3-22 CCC 04-Oct-88 Add more stuff for SET INTERFACE (width,tabs,etc) ! X2.3-23 WC3 05-Oct-88 Added Support for "Open Selected" ! X2.3-24 CCC 10-Oct-88 Add lse$$widget_setint_apply ! X2.3-25 DAS 13-Oct-88 Changed name and arguments of eve$define_widget ! X2.3-26 CCC 13-Oct-88 Add lse$$widget_replace_apply and cut/paste/copy ! change all eve$$widget_dialog_callback to eve$null ! X2.3-27 CCC 14-Oct-88 Add set search preference apply button ! X2.3-28 GJJ 17-Oct-88 Removed 'beware' notice at the top of this file; ! Pulled in generation 30 changes concerning use of ! EVE$$DEFINE_WIDGET into this version in order to ! successfully complete the build of LSE2_3P. ! X2.3-29 DAS 18-Oct-88 Removed eve$$load_widget_array which is no longer ! needed explicitly. Also removed the widget array ! and widget help array declarations. ! X2.3-30 DAS 20-Oct-88 Redid the module_init routine and redid the resize ! procedures to avoid having to override EVE routines. ! X2.3-31 DAS 24-Oct-88 Redid all of the help identifiers to be LSEMENU. ! Removed define widgets that had eve$null as the ! action. Brought in the eve$define_widgets for menu ! items that were being defaulted to eves. The reason ! is that we must use our help identifiers. ! X2.3-32 DAS 27-Oct-88 Removed variables for popup widget widths and heights. ! X2.3-33 GJJ 27-Oct-88 Changed call to EVE$SET_MESSAGE_WINDOW_SIZE to ! use the constant LSE$$K_MESSAGE_WINDOW_SIZE rather ! than use the constant 2. ! X2.3-34 CCC 26-Oct-88 Add eve$$decwindows_init and chanage logical name ! from eve$widgets to lse$widget ! X2.3-35 DAS 31-Oct-88 Add lse$$x_user_buffer_popup variable. ! X2.3-36 CCC 31-Oct-88 Add screen_width_label and re-order set interface ! X2.3-37 CCC 1-Nov-88 Remove callback routines for setint ! X2.3-38 CCC 1-Nov-88 Add find_selected callback routine ! X2.3-39 DAS 2-Nov-88 Removed eve$set_message_window_size from our resize ! procedure. ! X2.3-40 DAS 4-Nov-88 Use EVE's popup menu name so that it is faster. ! Created pre_init procedure to eliminate overriding ! EVE's module init code to set hierarchy. ! X2.3-41 CCC 7-Nov-88 Add callback lse$$widget_find_each_cancel ! X2.3-42 DAS 8-Nov-88 Overrode eve's resize procedures to fix an infinite ! loop problem in resize. ! X2.3-43 DAS 10-Nov-88 Changed help identifiers for pulldown menus ! X2.3-44 DAS 11-Nov-88 Added help_widget declaration ! X2.3-45 DAS 14-Nov-88 More help work ! X2.3-42 WCC 9-Nov-88 Add lse$$resize_sys_window as the counterpart ! to eve$$resize_sys_window which is needed ! after resize_action procedure is executed ! X2.3-46 DAS 18-Nov-88 Changed NEW_USER to NEW_USERS ! X2.3-47 CCC 7-Dec-88 Add constant eve$dwt$c_nsensitive := "sensitive" ! X2.3-48 DAS 7-Dec-88 Removed lse help widget. ! Removed EVE resize routines. ! X2.3-49 DAS 9-Dec-88 Added action to picking entries from help menu ! X2.3-50 WC3 14-Dec-88 Changed Open selected semantics to STRING then ! FILE_NAME ! X2.3-51 CCC 18-Jan-89 Change CLEAR menu to call lse$$erase_selection ! X2.3-52 CCC 19-Jan-89 Add callaback routines for fonts & bell ! X2.3-53 DAS 21-Jan-89 Make split_window call lse$$widget_split_window. ! X2.3-54 CCC 27-Jan-89 Add callaback routines for window_attributes dialog ! X2.3-55 CCC 03-Feb-89 Add eve$manage_widget (add to unmange old widget if ! widget if found...)( this will be changed later.) ! X2.3-56 DAS 16-Feb-89 Rework help pulldown menu ! X2.3-57 DAS 16-Feb-89 Resize recreates command_window so must set reverse ! X2.3-58 WC3 17-Feb-89 Add a call the LSE$$BALANCE_WINDOWS in resize ! action routine ! X2.3-59 WC3 21-Feb-89 Change the definitions of SPLIT WINDOW, ! DELETE WINDOW, ONE WINDOW to us LSE commands ! instead of EVE. SO that balance windows happens ! properly. ! X2.3-60 DAS 24-Feb-89 Changed SPLIT WINDOW to go directly to the LSE ! command SPLIT WINDOW 2 instead of to the dialog box. ! X2.3-61 DAS 08-Mar-89 Supercede EVE$DISPATCH_SCROLL to alter the set ! values call at the end that causes dancing scrolls. ! X2.3-62 WC3 09-Mar-89 Add a call to LSE$$HIGHLIGHT in EVE$SCROLL_DISPATCH ! So the highlighting in QUERY and REVIEW buffer ! works with scroll bars. ! X2.3-63 CCC 15-Mar-89 Modify lse$$resize_action to support resize of ! windows in character_cell mode. ! X2.3-64 CCC 17-Mar-89 Supersede eve$$insert_clipbard to fixe bug that ! paste/clipboard will get extra blank line. ! X2.3-65 CCC 22-Mar-89 Remove eve$$insert_clipboard which is wrong. ! X2.3-66 CCC 22-Mar-89 Fix and supersede eve$$insert_clipboard finally. ! X2.3-67 DAS 22-Mar-89 Change the behavior of eve resize to continue even ! if the heights are the same, but only if the ! decterm bit is set. This is for the set command ! and message window heights. ! X2.3-68 CCC 24-Mar-89 Add callback lse$$widget_update_height_width in ! lse$$resize_action. ! X2.3-69 DAS 24-Mar-89 Reorganized resize with new EVE organization ! X2.3-70 DAS 30-Mar-89 Changed OPEN_SELECTED to give an error FNF after ! fetching the STRING if we owned the global select. ! Changed get_global_select to call the handler ! routine if we owned the global select. ! X2.3-71 CCC 4-Apr-89 Change lse$$resize_action that LSE$$BALANCE_WINDOWS ! is called by bliss code SET.B32 if it is running on ! a character_cell terminal to work around the resize ! problem, also remove eve$$insert_clipboard(). ! X2.3-72 CCC 13-Apr-89 Add eve$cut_copy to allow create null range to ! erase the clipboard. ! X2.3-73 WC3 12-Apr-89 Initialize lse$$global_select_span1 and .._span2 ! to -1 so the caller of lse$$get_global_select ! can tell that no global selection data was obtained. ! X2.3-74 CCC 24-Apr-89 Modify eve$$cut_copy to erase remove_range if ! remove_range is not 0 or none. ! X2.3-75 CCC 04-May-89 Modify eve$$cut_copy() that it shouldn't erase ! clipboard when no selection is made. ! X3.0-01 CCC 18-May-89 Redid SUBSTITUTE dialog box with more callback ! such as replace,replace_and_find_next,find_next,etc. ! X3.0-02 CCC 8-Jun-89 Add to define view callback routines. ! X3.0-03 CCC 14-Jun-89 Modify eve$scroll_dispatch to use lse$$top instead ! of position(beginning_of(current_buffer)). ! X3.0-04 CCC 21-Jun-89 Modify eve$scroll_dispatch to add to move cursor ! to the next visible line after scrolling. ! Also removed code which causes the callback routine ! called twice. ! X3.0-05 WC3 23-JUN-89 Change the menu item commands for FIND/IND and ! GOTO DECL/IND to the new SCA V2 commands ! X3.0-06 GHL 26-Jun-89 Change help topic for Using_LSE_HELP to match ! help library. ! X3.0-07 CCC 27-JUN-89 Fixed the help topics on the view menu items. ! X3.0-08 CCC 28-JUN-89 Change VIEW MENU help topics into case sensitive ! words and rename help topics: ! DECW_CMS_Preference to DECW_CMS_Attributes ! DECW_SET_INTERFACE to DECW_Global_Attributes ! DECW_Search to DECW_Search_Attributes ! X3.0-09 WC3 10-Jul-89 Make LSE$$GET_SELECT_OWNER follow the new BLISS to ! TPU calling standard. ! X3.0-10 CCC 13-JUL-89 Change callback routine for SHOW BUFFER menu item ! to "lse$do_command('show buffer')". ! X3.0-11 WC3 18-Aug-89 Convert to preprocessor BLISS calling TPU ! X3.0-11 CCC 07-Aug-89 Removed eve$$resize_handler and eve$$resize_ ! system_buffers and eve$manage_widget ! X3.0-12 CCC 15-Aug-89 Add to supersede eve$create_menu_bar and ! remove lse$decwindows_module_pre_init ! X3.0-13 CCC 17-Aug-89 Remove creating widget for select popup ! X3.0-14 CCC 21-Aug-89 Add review and query popup menu extension service ! X3.0-15 CCC 21-Aug-89 Change callback routine "NEXT ITEM" to "NEXT SYMBOL" ! and "PREVIOUS ITEM" to "PREVIOUS SYMBOL" ! X3.0-16 CCC 30-Aug-89 Merge cms /gen=96e6 (eve24) into main line ! X3.0-17 DAS 30-Aug-89 New procedure LSE$$DECWINDOWS_V1 returns true/false ! X3.0-18 DAS 19-Sep-89 Change the mark(none) to mark(free_cursor) in calls ! to lse$find_visible. Reported in QAR #277. ! X3.0-19 DAS 19-Sep-89 Change the binding of the EXIT and QUIT pulldown ! menu entries to bind to LSE$DO_COMMAND of EXIT and ! QUIT instead of to EVE_EXIT and EVE_QUIT. ! X3.0-20 CCC 29-Sep-89 Modify SAVE menu should call lse$do_command('write') ! X3.0-21 CCC 24-Oct-89 Rename DECW_Symbol_Next_Item to ...Next_Symbol ! and DECW_Symbol_Previous_Item to ...Previous_Symbol ! X3.1-1 DAS 28-Dec-89 Moved all superceded eve procedures to ! LSE$EVE_DECWINDOWS module. ! X3.1-2 DAS 10-Jan-90 Change reference to LSE$$SELECT_ALL to SELECT ALL ! command. ! X3.1-3 LRH 29-Jan-90 Changed call to EVE_CENTER_LINE to LSE$DO_COMMAND ! ('CENTER LINE'). ! X3.1-4 WC3 07-May-90 Correct column positioning loop in OPEN_SELECTED ! X3.2-1 NMC 05-Jun-90 Add procedure lse$use_dialog_box ! X3.2-2 NMC 13-Jul-90 Remove procedure LSE$$DECWINDOWS_V1 ! X3.2-3 WC3 25-Jul-90 Change the global attributes pulldown to use ! lse_show_global_attributes ! X3.2-4 WC3 22-Aug-90 Remove: lse$$gz_screen_height ! lse$$gz_screen_width ! lse$$gz_old_screen_height ! lse$$gz_old_screen_width ! X3.2-5 WCC 12-Sep-90 Remove lse$do_command in eve$define_widget; use new ! grammar for the commands to bind the widget ! X3.2-6 WC3 01-Oct-90 Changes name of: ! lse_show_global_attributes to lse_show_system_attributes ! lse$$widget_search_preferences to lse_show_search_attributes ! X3.2-7 AVH 15-Nov-90 Change lse$$search_next to lse$search_util_next. ! X3.2-7 DAS 10-Nov-90 Changed the procedure lse$$widget_open_selected to ! the new grammar routine LSE_GOTO_SELECTED_FILE. ! Removed some EVE$DEFINE_WIDGET calls. ! X3.2-8 SAA 26-Nov-90 Removed find_each_dialog code ! X3.2-9 SHE 06-Dec-90 Added documentation headers ! X3.2-10 DAS 13-Dec-90 LSE$USE_DIALOG_BOX during initialization ! X4.0 SHE 03-Jun-91 Broke up lse$$resize_action into lse$$resize_action ! plus lse$$resize_windows. ! X4.0-1 SHE 11-Jun-91 Renamed lse$x_find_dialog to lse$x_search_dialog. ! X4.0-2 WC3 13-Jun-91 Prompting consistency ! X4.0-3 DAS 30-Jun-91 Expect NOGBLSEOWNER error in get global select ! X4.0-4 SHE 1-Aug-91 Added lse$create_dialog_box and ! lse$add_minimum_size_to_dialog ! X4.0-5 DBH 9-Sep-91 Added lse$in_method to lse$use_dialog_box. ! X4.0-6 DBH 2-Oct-91 Added lse$$_screen. ! X4.0-7 DBH 16-Oct-91 lse$in_method() -> lse$method_executing. ! X4.0-8 SHE 31-Oct-91 Added lse$$remove_button, lse$$remove_help_button, ! and lse$$remove_cancel_button ! Added lse$$popup_message, lse$$cb_info_box_ok ! X4.0-9 DBH 16-Oct-91 Activating raise lower widget ! X4.0-10 SHE 25-Nov-91 Modified lse$create_dialog_box to do a RAISE_WIDGET ! if the dialog box is already created and managed. ! X4.0-11 WC3 12-Dec-91 Remove MODULE/ENDMODULE construct ! X4.0-12 WC3 25-Feb-92 Change LSE$$GET_SELECT_OWNER to use input focus ! instead of primary selection. ! X4.0-13 SHE 10-Apr-92 Removed size_varies_with_contents parameter ! of lse$create_dialog_box ! Change unit of dialog box to Pixels before setting ! minwidth ! X4.0-14 WC3 08-May-92 Added missing local declarations !-- procedure lse$decwindows_module_ident return 'X4.0-14'; endprocedure; ! Called for a DECwindows RESIZE event. We get the old and new window ! values, and then call a routine that does the work. ! ! The optional parameter defaults to false which means that this resize is a ! result of the user directly resizing the DECwindows interface. ! ! procedure lse$$resize_action ! DECWindows resize action local old_width, new_width, old_length, new_length; ON_ERROR [OTHERWISE]: lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse$$resize_action"); ENDON_ERROR; new_length := get_info (SCREEN, "new_length"); old_length := get_info (SCREEN, "old_length"); new_width := get_info (SCREEN, "new_width"); old_width := get_info (SCREEN, "old_width"); !+ ! We need to update rows/columns within Window Attributes Dialog box ! if displayed. !- lse$$widget_update_height_width; lse$$resize_windows (old_length, new_length, old_width, new_width); endprocedure; ! ! Called to resize the windows. This can be called in the context of ! a DecWindows resize event, or for resizing after a SET HEIGHT command. ! procedure lse$$resize_windows (old_length, new_length, old_width, new_width) !+ ! Set the EVE variables that we are required to use !- eve$$x_resize_new_length := new_length; eve$$x_resize_old_length := old_length; eve$$x_resize_new_width := new_width; eve$$x_resize_old_width := old_width; !+ ! Call EVE's resize processing procedure to do the *REAL* work... !- eve$$resize_handler; !+ ! Set the command window to reverse again... !- set (VIDEO, eve$command_window, REVERSE); lse$$balance_windows; !+ ! Recalculate LSE$SCREEN_MIDDLE and LSE$SCREEN_BOTTOM for use with EXPAND. !- lse$screen_bottom := new_length - eve$get_message_window_size - eve$get_command_window_size; lse$screen_middle := ( lse$screen_top + lse$screen_bottom ) / 2 ; endprocedure; PROCEDURE lse$$raise_screen ! ! Raises the screen to the top of an occlusion stack ! ON_ERROR [OTHERWISE]: lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse$$raise_screen"); ENDON_ERROR; RAISE_WIDGET (GET_INFO (SCREEN, 'widget')); ENDPROCEDURE; PROCEDURE lse$$lower_screen ! ! Lowers the screen to the bottom of an occlusion stack ! ON_ERROR [OTHERWISE]: lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse$$lower_screen"); ENDON_ERROR; LOWER_WIDGET (GET_INFO (SCREEN, 'widget')); ENDPROCEDURE; PROCEDURE lse$$get_select_owner ! ! FUNCTION ! Return whether LSE has the selection or some other application ! ! INPUTS ! The current global selection ! ! OUTPUTS ! returns - TRUE if LSE/TPU has the PRIMARY selection ! FALSE if some other application has the selection ! ON_ERROR [OTHERWISE]: lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse$$get_select_owner"); ENDON_ERROR; IF EVE$X_DECWINDOWS_ACTIVE THEN RETURN GET_INFO(SCREEN, "input_focus"); ENDIF; ! ! Character cell returns TRUE always ! RETURN TRUE; ENDPROCEDURE; PROCEDURE lse$$get_global_select(property_name) ! ! FUNCTION ! Returns PRIMARY global selection information. It is designed to be ! called from BLISS and thus used glboal variables as return values. ! ! INPUTS ! property_name - The kind of information desired. ! ! OUTPUTS ! lse$$global_select_return - The return value when it is string ! lse$$global_select_span1 - The first element of a SPAN return value ! lse$$global_select_span2 - The second element of a SPAN return value ! local temp_array; on_error [TPU$_NOGBLSELDATA, TPU$_NOGBLSELOWNER]: [OTHERWISE]: lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse$$get_global_select"); endon_error; lse$$global_select_return := 0; lse$$global_select_span1 := -1; lse$$global_select_span2 := -1; if get_info (SCREEN, "global_select", PRIMARY) = 0 then lse$$global_select_return := GET_GLOBAL_SELECT(PRIMARY, property_name); else temp_array := create_array (2); temp_array {1} := PRIMARY; temp_array {2} := property_name; lse$$global_select_return := eve$write_global_select_handler (temp_array); endif; IF (GET_INFO(lse$$global_select_return, "type") = ARRAY) THEN IF (lse$$global_select_return{0} = "SPAN") THEN lse$$global_select_span1 := lse$$global_select_return{2}; lse$$global_select_span2 := lse$$global_select_return{3}; ELSE IF (lse$$global_select_return{1} = 8) THEN lse$$global_select_return := lse$$global_select_return{2}; ENDIF; ENDIF; ENDIF; ENDPROCEDURE; procedure lse$use_dialog_box ! ! FUNCTION ! Return true/false whether LSE should use the decwindow dialog box for ! prompting. ! ! INPUTS ! none ! ! OUTPUTS ! returns - TRUE if decwindow dialog box should be used ! FALSE if decwindow dialog box should not be used ! ! !doc_begin ! ! ONE LINE DEFINITION: ! «TBS» ! ! DESCRIPTION: ! «TBS» ! ! RELATED COMMANDS: ! «TBS» ! ! EXAMPLE: ! «TBS» ! ! CATEGORY: ! «TBS» ! !doc_end ! ON_ERROR [OTHERWISE]: lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse$use_dialog_box"); ENDON_ERROR; if eve$x_decwindows_active <> tpu$k_unspecified then if eve$x_decwindows_active then if (eve$$x_state_array{eve$$k_command_line_flag} = eve$k_invoked_by_menu) OR (lse$$x_use_dialog = lse$$k_pdialog_window) OR (lse$method_executing) then lse$use_dialog_box := true; endif; endif; endif; if lse$$x_use_dialog = lse$$k_pdialog_cct then lse$use_dialog_box := false; endif; return; endprocedure; procedure lse$create_dialog_box (widget_name, widget_id; parent_widget) ! ! FUNCTION ! Creates a dialog box widget, setting the minimum width and height to ! the default width/height values respectively. ! ! INPUTS ! widget_name - the name of the widget to create, such as "SEARCH_DIALOG" ! ! OUTPUTS ! widget_id - the id of the widget created ! ! RETURN VALUE ! true if dialog box was created, false otherwise ! !doc_begin ! ! ONE LINE DEFINITION: ! «TBS» ! ! DESCRIPTION: ! «TBS» ! ! RELATED COMMANDS: ! «TBS» ! ! EXAMPLE: ! «TBS» ! ! CATEGORY: ! «TBS» ! !doc_end ! LOCAL local_parent, the_status, the_width, the_height, the_parent, not_resizeable; ON_ERROR [OTHERWISE]: lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse$create_dialog_box"); ENDON_ERROR; ! If we don't already have a dialog box ! if get_info (widget_id, "type") <> WIDGET then local_parent := SCREEN; if parent_widget <> tpu$k_unspecified then ! If the parent isn't managed, then don't use it. If we do, the ! box comes up where the parent *was*. ! if get_info (parent_widget, "is_managed") then local_parent := parent_widget; endif; endif; widget_id := create_widget (widget_name, eve$x_widget_hierarchy, local_parent, eve$kt_callback_routine); ! minWidth and minHeight need to be in terms of pixels. We've already ! created the widget, so we switch the units to Pixels. ! the_status := set (widget, widget_id, "unitType", lse$k_XmPIXELS); return true; else ! If the dialog box is already created and managed, then RAISE it so that ! it comes to the top. if get_info (widget_id, "is_managed") then RAISE_WIDGET (widget_id); endif; return false; endif; endprocedure; procedure lse$add_minimum_size_to_dialog (widget_id) ! ! FUNCTION ! Sets the minimum width and height of a dialog box to be the current ! values for its width and height. ! ! This procedure is intended for use with widgets whose width is not ! determined until the time of the MANAGE_WIDGET call, so we must ! set the min width and height after the widget is managed. ! ! INPUTS ! widget_id - the widget on which to set the min width and height ! ! !doc_begin ! ! ONE LINE DEFINITION: ! «TBS» ! ! DESCRIPTION: ! «TBS» ! ! RELATED COMMANDS: ! «TBS» ! ! EXAMPLE: ! «TBS» ! ! CATEGORY: ! «TBS» ! !doc_end ! local the_status, the_parent, the_width, the_height; ON_ERROR [OTHERWISE]: lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse$add_minimum_size_to_dialog"); ENDON_ERROR; the_status := get_info (widget_id, "widget_info", eve$x_resource_array {eve$k_nwidth}, the_width); the_status := get_info (widget_id, "widget_info", eve$x_resource_array {eve$k_nheight}, the_height); the_parent := get_info (widget_id, "parent"); ! ! The values for minWidth and minHeight apparently can't be set from ! the UIL file. When this was tried, their default values of 65535 ! were used regardless of the value given. ! the_status := set (WIDGET, the_parent, "minWidth", the_width); the_status := set (WIDGET, the_parent, "minHeight", the_height); endprocedure; procedure lse$$remove_help_button (the_widget) lse$$remove_button (the_widget, "Help"); endprocedure; procedure lse$$remove_cancel_button (the_widget) lse$$remove_button (the_widget, "Cancel"); endprocedure; procedure lse$$remove_button (the_widget, button_name) local status, num_children, i, child_array, current_child, the_label; num_children := get_info (widget, "children", the_widget, child_array); ! Look for the "Help" push button, and get rid of it ! i := 1; loop exitif i > num_children; current_child := child_array {i}; if get_info (current_child, "class") = "XmPushButtonGadget" then status := get_info (current_child, "widget_info", "labelString", the_label); if (the_label = button_name) then unmanage_widget (current_child); exitif; endif; endif; i := i + 1; endloop; endprocedure; procedure lse$$popup_message (the_message; parent_widget) local the_message_text; if eve$$x_state_array{eve$$k_command_line_flag} = eve$k_invoked_by_menu then lse$create_dialog_box ("INFO_BOX", lse$$x_info_dialog, parent_widget); the_message_text := lse$get_message_text (the_message); SET (WIDGET, lse$$x_info_dialog, "messageString", the_message_text); lse$$remove_cancel_button (lse$$x_info_dialog); lse$$remove_help_button (lse$$x_info_dialog); eve$manage_widget (lse$$x_info_dialog); else eve$message (the_message); endif; endprocedure; procedure lse$$cb_info_box_ok eve$unmanage_widget (lse$$x_info_dialog); delete (lse$$x_info_dialog); endprocedure; ! For use in setting the unitType to Pixels, we need to use DecWindow's ! XmPIXELS value. No way to get it into tpu easily. Make sure this ! value is in synch with DECW$INCLUDE:XM.H. ! CONSTANT lse$k_XmPIXELS := 0;