home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-05-19 | 41.3 KB | 1,153 lines |
- // dfhelp_b.src (secondary help maintenance program [B])
- // January 21, 1992
- // LS
-
- use dfhelp_b // secondary help maintenance program [B] header package
-
- DEFINE_SYMBOL LEFT_SERVER_TYPE FOR 0 // used in cross reference maintenance
- DEFINE_SYMBOL RIGHT_SERVER_TYPE FOR 1 // area to determine which server to use
-
- //////////////////////////////////
- ////////////////////////////////// global variables
- //////////////////////////////////
-
- string cmd_option // option passed on cmd line (via chain wait)
- move EMPTY_STRING to cmd_option
-
- string current_grp current_sbj current_xrf current_ctx current_pth
- move EMPTY_STRING to current_grp // names of currently open help data files
- move EMPTY_STRING to current_sbj // passed on cmd line (via chain wait)
- move EMPTY_STRING to current_xrf
- move EMPTY_STRING to current_ctx
- move EMPTY_STRING to current_pth
-
- //////////////////////////////////
- ////////////////////////////////// global procedures
- //////////////////////////////////
-
- procedure deactivate_area for desktop
- send deactivate AREA_TYPE
- end_procedure
-
- procedure insert_cb for desktop string val integer itm
- local integer flag
-
- get insert_mode of clipboard to flag
- set insert_mode of clipboard to true
-
- send goto_line to clipboard itm
- set right_margin of clipboard to 56
- send key to clipboard kenter
- set value of clipboard item itm to val
-
- set insert_mode of clipboard to flag
- end_procedure
-
- function next_cmd_arg for desktop returns string
- local string arg
-
- cmdline arg
- if arg le EMPTY_STRING begin
- error 57 ("Command line argument not specified")
- send insert_cb FAIL_REPLY 0
- abort
- end
- if arg eq EMPTY_REPL_STRING function_return EMPTY_STRING
- else function_return arg
- end_function
-
- // retrieve option passed on command line to determine which objects to use
-
- procedure init_program for desktop // retrieve option passed on command line to determine which objects to use
- cmdline cmd_option
-
- if cmd_option le EMPTY_STRING begin
- error 57 ("Option not specified for program")
- send insert_cb FAIL_REPLY 0
- abort
- end
-
- left cmd_option to cmd_option 1
- uppercase cmd_option
-
- if not cmd_option in VALID_OPTIONS begin
- error 57 ("Invalid option passed to program: " + cmd_option)
- send insert_cb FAIL_REPLY 0
- abort
- end
-
- get next_cmd_arg to current_grp
- get next_cmd_arg to current_sbj
- get next_cmd_arg to current_xrf
- get next_cmd_arg to current_ctx
- get next_cmd_arg to current_pth
- end_procedure
-
- procedure exit_program for desktop
- send insert_cb SUCCESS_REPLY 0
- send exit_application
- end_procedure
-
- send init_program
-
- //////////////////////////////////
- ////////////////////////////////// augmentation to help_object class to
- ////////////////////////////////// override default help access
- //////////////////////////////////
-
- procedure request_help for (class(help_object.obj)) integer msg_id integer arg
- local integer orig_grp orig_sbj orig_xrf orig_ctx
- local string old_grp_filename old_sbj_filename old_xrf_filename old_ctx_filename
- local string cur_grp_filename cur_sbj_filename cur_xrf_filename cur_ctx_filename
-
- move current_pth to cur_grp_filename
- append cur_grp_filename current_grp
- move current_pth to cur_sbj_filename
- append cur_sbj_filename current_sbj
- move current_pth to cur_xrf_filename
- append cur_xrf_filename current_xrf
- move current_pth to cur_ctx_filename
- append cur_ctx_filename current_ctx
-
- if cur_grp_filename gt EMPTY_STRING begin
- move grp.recnum to orig_grp
- close grp
- end
- if cur_sbj_filename gt EMPTY_STRING begin
- move sbj.recnum to orig_sbj
- close sbj
- end
- if cur_xrf_filename gt EMPTY_STRING begin
- move xrf.recnum to orig_xrf
- close xrf
- end
- if cur_ctx_filename gt EMPTY_STRING begin
- move ctx.recnum to orig_ctx
- close ctx
- end
-
- if num_arguments gt 1 send msg_id arg
- else send msg_id
-
- if cur_grp_filename gt EMPTY_STRING begin
- open cur_grp_filename as grp
- clear grp
- if orig_grp ne 0 begin
- move orig_grp to grp.recnum
- find eq grp.recnum
- end
- end
- if cur_sbj_filename gt EMPTY_STRING begin
- open cur_sbj_filename as sbj
- clear sbj
- if orig_sbj ne 0 begin
- move orig_sbj to sbj.recnum
- find eq sbj.recnum
- end
- end
- if cur_xrf_filename gt EMPTY_STRING begin
- open cur_xrf_filename as xrf
- clear xrf
- if orig_xrf ne 0 begin
- move orig_xrf to xrf.recnum
- find eq xrf.recnum
- end
- end
- if cur_ctx_filename gt EMPTY_STRING begin
- open cur_ctx_filename as ctx
- clear ctx
- if orig_ctx ne 0 begin
- move orig_ctx to ctx.recnum
- find eq ctx.recnum
- end
- end
- end_procedure
-
- //////////////////////////////////
- ////////////////////////////////// main object definitions
- //////////////////////////////////
-
- register_object grp_prompt
- register_object sbj_prompt
- register_object verify_del
- register_function verify string filename string related returns integer
-
- class prompt_client is a help_maintenance_prompt_client
- procedure construct_object integer img
- forward send construct_object img
-
- property integer list_object public 0
- end_procedure
-
- procedure request_cancel_area
- local integer obj svr
-
- get list_object to to obj
-
- send request_cancel to obj
- send cancel to obj
-
- forward send request_cancel_area
- end_procedure
-
- procedure quit_help_maint
- send request_cancel_area
- send exit_program to (focus(desktop))
- end_procedure
- end_class
-
- if cmd_option eq GRP_MAINT_OPTION begin
-
- /grp_menu_img
- ______ ____
- /grp_maint_img
- ╔════════════════════════════════════════════════╗
- ║________________________________________________║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ╚════════════════════════════════════════════════╝
- /grp_maint_entry_img
- Group name: _________________________________
- /grp_maint_keys_img
- ___________ _________
- /*
- // <F4=Prompt> <F1=Help>
-
- object grp_maint is a data_set grp_maint_img main_file grp ring popup
- register_function verify_grp_delete returns integer
-
- integer old_grp_recnum
-
- set block_mouse_state to true
- set location to 5 16 relative
- set scope_state to true
- set verify_delete_msg to get_verify_grp_delete
-
- set center_state item 0 to true
- set value item 0 to "Group Maintenance"
-
- object xrf_data is a data_set no_image main_file xrf // for deletion
- set focus_mode to no_activate
- object ctx_data is a data_set no_image main_file ctx
- set focus_mode to no_activate
- end_object
- end_object
-
- create_menu grp_menu grp_menu_img location 2 1 relative
- set action_bar_keys_msg to grp_menu_keys
-
- #INCLUDE RECDE_PD.INC
- set value of (record_pull_down(current_object)) ;
- item (item_count(record_pull_down(current_object)) - 1) to ;
- "Exit Group Maint. Alt+F4"
-
- #INCLUDE HELP_PD.INC
-
- on_key kcancel send exit_area private
- end_menu
-
- procedure grp_menu_keys for desktop integer obj
- on_key key_alt+key_r send activate to (record_pull_down(obj)) private
- on_key key_alt+key_h send activate to (help_pull_down(obj)) private
- end_procedure
-
- set action_bar_id to (grp_menu(current_object))
-
- object grp_entry is an entry_form grp_maint_entry_img
- set location to 5 2 relative
-
- item_list
- entry_item grp.grp_name { autofind, required, iprompt=(grp_prompt(desktop)) }
- end_item_list
-
- on_key kcancel send activate to (grp_menu(grp_maint.obj)) private
- end_object
-
- object keys is a key_button grp_maint_keys_img
- set location to 7 1 relative
-
- item_list
- on_item F4_PROMPT_TEXT send prompt
- on_item F1_HELP_TEXT send help
- end_item_list
- end_object
-
- procedure add_focus integer obj
- move grp.recnum to old_grp_recnum
- forward send add_focus obj
- end_procedure
-
- procedure release_focus
- forward send release_focus
- clear grp
- if old_grp_recnum ne 0 begin
- move old_grp_recnum to grp.recnum
- find eq grp.recnum
- end
- end_procedure
-
- function verify_grp_delete returns integer
- if status grp function_return (verify(verify_del(desktop), "Group", "Link and Context"))
- error 71 "GRP"
- function_return 1
- end_function
- end_object // grp_maint
-
- send popup to grp_maint
-
- end
- else if cmd_option eq SBJ_MAINT_OPTION begin
-
- class import_export_client is a client
- register_function filename returns string
-
- procedure construct_object integer img integer form_img integer btns_img
- forward send construct_object img
-
- set block_mouse_state to true
- set popup_state to true
- set scope_state to true
-
- set center_state item 0 to true
-
- object file is a form form_img
- item_list
- on_item EMPTY_STRING send next
- set autoclear_state to true
- end_item_list
-
- on_key ksave_record send request_ok private
- on_key kcancel send cancel private
- end_object
-
- object buttons is a button btns_img
- item_list
- on_item F2_OK_TEXT send request_ok
- on_item ESC_CANCEL_TEXT send cancel
- on_item F1_HELP_TEXT send help
- end_item_list
-
- on_key ksave_record send request_ok private
- on_key kcancel send cancel private
- end_object
- end_procedure
-
- procedure request_ok
- if (filename(current_object)) le EMPTY_STRING procedure_return
- else procedure_return msg_ok
- end_procedure
-
- function filename returns string
- function_return (value(file(current_object), 0))
- end_function
-
- procedure set title_name string val
- set value item 0 to val
- end_procedure
- end_class
-
- /sbj_menu_img
- ______ ____ ____
- /sbj_text_pd_img
- ┌─────────────────────────────┐
- │ ___________________________ │
- │ ___________________________ │
- ├─────────────────────────────┤
- │ ___________________________ │
- │ ___________________________ │
- │ ___________________________ │
- │ ___________________________ │
- │ ___________________________ │
- │ ___________________________ │
- │ ___________________________ │
- └─────────────────────────────┘
- /sbj_maint_img
- ╔═════════════════════════════════════════════════════════════╗
- ║_____________________________________________________________║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ║ ┌ Subject text: ──────────────────────────────────────────┐ ║
- ║ │ │ ║
- ║ │ │ ║
- ║ │ │ ║
- ║ │ │ ║
- ║ │ │ ║
- ║ │ │ ║
- ║ │ │ ║
- ║ │ │ ║
- ║ │ │ ║
- ║ │ │ ║
- ║ └─────────────────────────────────────────────────────────┘ ║
- ║ ║
- ╚═════════════════════════════════════════════════════════════╝
- /sbj_maint_entry_img
- Subject name: _________________________________
- /sbj_maint_keys_img
- ___________ _________
- /*
- // <F4=Prompt> <F1=Help>
-
- object sbj_maint is a data_set sbj_maint_img main_file sbj popup ring
- register_function verify_sbj_delete returns integer
-
- integer old_sbj_recnum
-
- set block_mouse_state to true
- set location to 2 9 relative
- set scope_state to true
- set verify_delete_msg to get_verify_sbj_delete
-
- set center_state item 0 to true
- set value item 0 to "Subject Maintenance"
-
- object xrf_data is a data_set no_image main_file xrf // for deletion
- set focus_mode to no_activate
-
- object ctx_data is a data_set no_image main_file ctx
- set focus_mode to no_activate
- end_object
- end_object
-
- create_menu sbj_menu sbj_menu_img location 2 1 relative
- set action_bar_keys_msg to sbj_menu_keys
-
- #INCLUDE RECDE_PD.INC
- set value of (record_pull_down(current_object)) ;
- item (item_count(record_pull_down(current_object)) - 1) to ;
- "Exit Subject Maint. Alt+F4"
-
- register_object text_pull_down
- on_item "Text" send activate_pull_down to (text_pull_down(current_object))
-
- object text_pull_down is a shadow_text_pull_down_menu sbj_text_pd_img
- item_list
- on_item "Start of text Ctrl+Home" send beginning_of_data
- on_item "End of text Ctrl+End" send end_of_data
- on_item "Block mark Ctrl+\" send mark_block
- on_item "Column mark" send mark_column
- on_item "Cut marked text Alt+-" send cut_marked_area
- on_item "Copy marked text Ctrl+-" send copy_marked_area
- on_item "Paste text Alt+=" send paste_block
- on_item "Export marked text..." send export_marked_area
- on_item "Import text..." send import_text
- end_item_list
- end_object
-
- #INCLUDE HELP_PD.INC
-
- on_key kcancel send exit_area private
- end_menu
-
- procedure sbj_menu_keys for desktop integer obj
- on_key key_alt+key_r send activate to (record_pull_down(obj)) private
- on_key key_alt+key_t send activate to (text_pull_down(obj)) private
- on_key key_alt+key_h send activate to (help_pull_down(obj)) private
- end_procedure
-
- set action_bar_id to (sbj_menu(current_object))
-
- object sbj_entry_form is an entry_form sbj_maint_entry_img
- set location to 4 2 relative
-
- item_list
- entry_item sbj.sbj_name { required, iprompt=(sbj_prompt(desktop)) }
- end_item_list
-
- on_key kcancel send activate to (sbj_menu(sbj_maint.obj)) private
- end_object // sbj_entry_form
-
- object sbj_text is a help_maintenance_text_window
- set location to 7 3 relative
- set size to 10 56
-
- assign_dbms_field sbj.sbj_text
-
- /sbj_maint_export_img
- ╔════════════════════════════════════════════╗
- ║____________________________________________║
- ║ ║
- ║ File to export text to: ║
- ║ ________________________________________ ║
- ║ ║
- ║ _______ ____________ _________ ║
- ╚════════════════════════════════════════════╝
- /*
- // <F2=OK> <Esc=Cancel> <F1=Help>
- sub_page sbj_maint_export_file_img from sbj_maint_export_img 2
- sub_page sbj_maint_export_btns_img from sbj_maint_export_img 3 4 5
-
- /sbj_maint_import_img
- ╔════════════════════════════════════════════╗
- ║____________________________________________║
- ║ ║
- ║ File to import text from: ║
- ║ ________________________________________ ║
- ║ ║
- ║ _______ ____________ _________ ║
- ╚════════════════════════════════════════════╝
- /*
- // <F2=OK> <Esc=Cancel> <F1=Help>
- sub_page sbj_maint_import_file_img from sbj_maint_import_img 2
- sub_page sbj_maint_import_btns_img from sbj_maint_import_img 3 4 5
-
- object export is an import_export_client sbj_maint_export_img sbj_maint_export_file_img sbj_maint_export_btns_img
- set location to 3 5 relative
- set title_name to "Export marked text"
- end_object
-
- set export_object to (export(current_object))
-
- object import is an import_export_client sbj_maint_import_img sbj_maint_import_file_img sbj_maint_import_btns_img
- set location to 3 5 relative
- set title_name to "Import text"
- end_object
-
- set import_object to (import(current_object))
-
- on_key kprompt send popup to (sbj_prompt(desktop)) private
- on_key kcancel send activate to (sbj_menu(sbj_maint.obj)) private
- end_object // sbj_text
-
- object keys is a key_button sbj_maint_keys_img
- set location to 18 1 relative
-
- item_list
- on_item F4_PROMPT_TEXT send prompt
- on_item F1_HELP_TEXT send help
- end_item_list
- end_object
-
- procedure add_focus integer obj
- move sbj.recnum to old_sbj_recnum
- forward send add_focus obj
- end_procedure
-
- procedure release_focus
- forward send release_focus
- clear sbj
- if old_sbj_recnum ne 0 begin
- move old_sbj_recnum to sbj.recnum
- find eq sbj.recnum
- end
- end_procedure
-
- function verify_sbj_delete returns integer
- if status sbj function_return (verify(verify_del(desktop), "Subject", "Link and Context"))
- error 71 "SBJ"
- function_return 1
- end_function
- end_object // sbj_maint
-
- send popup to sbj_maint
-
- end
- else if cmd_option eq XRF_MAINT_OPTION begin
-
- class cross_ref_entry_form is an entry_form
- procedure construct_object integer img
- forward send construct_object img
-
- property integer server_type public 0
- end_procedure
-
- procedure entering returns integer
- local integer svr_typ ret_val
-
- forward get msg_entering to ret_val
- if ret_val procedure_return ret_val
-
- get server_type to svr_typ
- delegate send reset_servers svr_typ
- delegate send shadow_prompt_button false
-
- end_procedure
-
- procedure request_delete
- end_procedure
- end_class
-
- class cross_ref_table is a table
- procedure construct_object integer img
- forward send construct_object img
-
- property integer server_type public 0
- property integer new_record_state public 0
-
- set wrap_state to true
-
- on_key knext_item send switch private
- on_key kprevious_item send switch_back private
- end_procedure
-
- procedure exiting integer obj returns integer
- local integer ret_val
- forward get msg_exiting obj to ret_val
- if not ret_val set select_state item current to true
- else procedure_return ret_val
- end_procedure
-
- procedure display
- forward send display
-
- if (current_scope(desktop) = find_scope(current_object) and ;
- focus(desktop) <> current_object) ;
- set select_state item current to true
- end_procedure
-
- procedure request_find integer mode integer flag
- if (current_record(current_object)) eq 0 forward send request_find mode flag
- end_procedure
-
- procedure request_superfind integer mode
- if (current_record(current_object)) eq 0 forward send request_superfind mode
- end_procedure
-
- function row_changed integer row# returns integer
- local integer ret_val
-
- if (new_record_state(current_object)) function_return 0
-
- forward get row_changed row# to ret_val
- function_return ret_val
- end_function
-
- procedure add_or_remove_row
- local integer new_rec
-
- get new_record_state to new_rec
- set new_record_state to (current_record(current_object) = 0)
- forward send add_or_remove_row
- set new_record_state to new_rec
- end_procedure
-
- procedure prompt
- if (current_record(current_object)) eq 0 forward send prompt
- end_procedure
-
- procedure entering returns integer
- local integer svr_typ cur_rec ret_val
-
- forward get msg_entering to ret_val
- if ret_val procedure_return ret_val
-
- get server_type to svr_typ
- delegate send reset_servers svr_typ
- if (item_count(current_object)) gt 0 set select_state item current to false
- get current_record to cur_rec
- delegate send shadow_prompt_button (cur_rec <> 0)
- end_procedure
-
- procedure item_change integer from_itm integer to_itm returns integer
- local integer ret_val row_num rec_num
-
- forward get msg_item_change from_itm to_itm to ret_val
-
- if (focus(desktop)) eq current_object begin
- get row ret_val to row_num
- get record_number row_num to rec_num
- delegate send shadow_prompt_button (rec_num <> 0)
- end
-
- procedure_return ret_val
- end_procedure
- end_class
-
- object cross_ref_left_grp_data is a data_set no_image main_file grp
- end_object
-
- object cross_ref_left_xrf_data is a data_set no_image main_file xrf ;
- updating cross_ref_left_grp_data sbj
-
- begin_constraints
- constrain xrf relates to grp
- end_constraints
-
- object ctx_data is a data_set no_image main_file ctx // for deletion
- end_object
- end_object
-
- object cross_ref_right_sbj_data is a data_set no_image main_file sbj
- end_object
-
- object cross_ref_right_xrf_data is a data_set no_image main_file xrf ;
- updating grp cross_ref_right_sbj_data
-
- begin_constraints
- constrain xrf relates to sbj
- end_constraints
-
- object ctx_data is a data_set no_image main_file ctx // for deletion
- end_object
- end_object
-
- /cross_ref_img
- ╔══════════════════════════════════════════════════════════════════════════════╗
- ║______________________________________________________________________________║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ║ ┌ Subject text: ──────────────────────────────────────────┐ ║
- ║ │ │ ║
- ║ │ │ ║
- ║ │ │ ║
- ║ └─────────────────────────────────────────────────────────┘ ║
- ║ ║
- ╚══════════════════════════════════════════════════════════════════════════════╝
- /cross_ref_action_bar_img
- ______ ____
- /cross_ref_left_entry_img
- ┌─ Group: ───────────────────────────┐
- │ _________________________________ │
- ├─ Subjects: ────────────────────────┤
- │ _________________________________ │
- │ _________________________________ │
- │ _________________________________ │
- │ _________________________________ │
- │ _________________________________ │
- │ _________________________________ │
- │ _________________________________ │
- └────────────────────────────────────┘
- /*
- sub_page cross_ref_grp_form_img from cross_ref_left_entry_img 1
- sub_page cross_ref_sbj_list_img from cross_ref_left_entry_img vertical 2 7
- /cross_ref_right_entry_img
- ┌─ Subject: ─────────────────────────┐
- │ _________________________________ │
- ├─ Groups: ──────────────────────────┤
- │ _________________________________ │
- │ _________________________________ │
- │ _________________________________ │
- │ _________________________________ │
- │ _________________________________ │
- │ _________________________________ │
- │ _________________________________ │
- └────────────────────────────────────┘
- /*
- sub_page cross_ref_sbj_form_img from cross_ref_right_entry_img 1
- sub_page cross_ref_grp_list_img from cross_ref_right_entry_img vertical 2 7
- /cross_ref_keys_img
- ___________ _________
- /*
- // <F4=Prompt> <F1=Help>
-
- object cross_ref is a client cross_ref_img
- register_object left_entry
- register_object grp_form
- register_object sbj_list
- register_object right_entry
- register_object sbj_form
- register_object grp_list
-
- set location to 1 0 relative
- set popup_state to true
-
- set center_state item 0 to true
- set value item 0 to "Cross Reference Maintenance"
-
- create_menu action_bar cross_ref_action_bar_img location 2 1 relative
- set action_bar_keys_msg to xrf_menu_keys
-
- #INCLUDE RECDE_PD.INC
- set value of (record_pull_down(current_object)) ;
- item (item_count(record_pull_down(current_object)) - 1) to ;
- "Exit Cross Ref. Maint. Alt+F4"
-
- #INCLUDE HELP_PD.INC
-
- on_key kcancel send exit_area private
- end_menu
-
- procedure xrf_menu_keys for desktop integer obj
- on_key key_alt+key_r send activate to (record_pull_down(obj)) private
- on_key key_alt+key_h send activate to (help_pull_down(obj)) private
- end_procedure
-
- object left_entry is an entry_client cross_ref_left_entry_img ;
- action_bar (action_bar(cross_ref(desktop)))
-
- set location to 3 2 relative
-
- object grp_form is a cross_ref_entry_form cross_ref_grp_form_img ;
- using (cross_ref_left_grp_data(desktop))
-
- set server_type to LEFT_SERVER_TYPE
-
- item_list
- entry_item grp.grp_name { autofind, noput, ;
- iprompt=(grp_prompt(desktop)) }
- end_item_list
-
- on_key kcancel send activate to (action_bar(cross_ref.obj)) private
- on_key kswitch send activate to (right_entry(cross_ref.obj)) private
- on_key kswitch_back send activate to (right_entry(cross_ref.obj)) private
- end_object
-
- object sbj_list is a cross_ref_table cross_ref_sbj_list_img ;
- using (cross_ref_left_xrf_data(desktop)) ;
- main_file xrf by index.1
-
- set server_type to LEFT_SERVER_TYPE
-
- begin_row
- entry_item sbj.sbj_name { autofind, iprompt=(sbj_prompt(desktop)) }
- end_row
-
- on_key kcancel send activate to (action_bar(cross_ref.obj)) private
- on_key kswitch send activate to (right_entry(cross_ref.obj)) private
- on_key kswitch_back send activate to (right_entry(cross_ref.obj)) private
- end_object
- end_object // left_entry
-
- object right_entry is an entry_client cross_ref_right_entry_img ;
- action_bar (action_bar(cross_ref(desktop)))
-
- set location to 3 40 relative
-
- object sbj_form is a cross_ref_entry_form cross_ref_sbj_form_img ;
- using (cross_ref_right_sbj_data(desktop))
-
- set server_type to RIGHT_SERVER_TYPE
-
- item_list
- entry_item sbj.sbj_name { autofind, noput, iprompt=(sbj_prompt(desktop)) }
- end_item_list
-
- on_key kcancel send activate to (action_bar(cross_ref.obj)) private
- on_key kswitch send activate to (left_entry(cross_ref.obj)) private
- on_key kswitch_back send activate to (left_entry(cross_ref.obj)) private
- end_object
-
- object grp_list is a cross_ref_table cross_ref_grp_list_img ;
- using (cross_ref_right_xrf_data(desktop)) ;
- main_file xrf by index.2
-
- set server_type to RIGHT_SERVER_TYPE
-
- begin_row
- entry_item grp.grp_name { autofind, iprompt=(grp_prompt(desktop)) }
- end_row
-
- on_key kcancel send activate to (action_bar(cross_ref.obj)) private
- on_key kswitch send activate to (left_entry(cross_ref.obj)) private
- on_key kswitch_back send activate to (left_entry(cross_ref.obj)) private
- end_object
- end_object // right_entry
-
- object sbj_text is a help_maintenance_text_window
- set focus_mode to nonfocusable
- set location to 15 11 relative
- set read_only_state to true
- set size to 3 56
-
- assign_dbms_field sbj.sbj_text
- end_object
-
- object keys is a key_button cross_ref_keys_img
- set location to 19 1 relative
-
- item_list
- on_item F4_PROMPT_TEXT send prompt
- on_item F1_HELP_TEXT send help
- end_item_list
- end_object
-
- procedure reset_servers integer svr_type
- local integer obj new_svr old_svr rec
-
- clear grp sbj xrf
-
- if svr_type eq LEFT_SERVER_TYPE ;
- move (cross_ref_left_xrf_data(desktop)) to new_svr
- else move (cross_ref_right_xrf_data(desktop)) to new_svr
-
- get current_record of new_svr to rec
- if rec ne 0 send read_by_recnum to new_svr xrf.file_number rec
-
- if svr_type eq LEFT_SERVER_TYPE begin
- move (cross_ref_left_grp_data(desktop)) to new_svr
- get current_record of new_svr to rec
- if rec ne 0 send read_by_recnum to new_svr grp.file_number rec
- else clear grp
- end
-
- if svr_type eq RIGHT_SERVER_TYPE begin
- move (cross_ref_right_sbj_data(desktop)) to new_svr
- get current_record of new_svr to rec
- if rec ne 0 send read_by_recnum to new_svr sbj.file_number rec
- else clear sbj
- end
-
- if svr_type eq LEFT_SERVER_TYPE ;
- move (cross_ref_left_xrf_data(desktop)) to new_svr
- else move (cross_ref_right_sbj_data(desktop)) to new_svr
-
- move (sbj_text(current_object)) to obj
- get server of obj to old_svr
-
- if old_svr ne new_svr begin
- set server of obj to new_svr
- if sbj.recnum ne 0 send entry_display to obj 0 true
- else send entry_clear to obj 0
- end
- end_procedure
-
- procedure shadow_prompt_button integer flag
- set shadow_state of (keys(current_object)) item 0 to flag
- end_procedure
-
- procedure activate
- if not (active_state(current_object)) clear grp sbj xrf
- forward send activate
- send activate to (left_entry(current_object))
- end_procedure
- end_object
-
- send popup to cross_ref
-
- end
-
- // data sets for prompt objects
-
- /grp_prompt_img
- ╔══════════════════════════════════════════════╗
- ║______________________________________________║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ╚══════════════════════════════════════════════╝
- /grp_prompt_list_img
- _________________________________
- _________________________________
- _________________________________
- _________________________________
- _________________________________
- _________________________________
- _________________________________
- _________________________________
- /grp_prompt_keys_img
- ____________ _________
- /*
- // <Esc=Cancel> <F1=Help>
-
- object grp_prompt is a prompt_client grp_prompt_img
- set location to 3 16 relative
-
- set center_state item 0 to true
- set value item 0 to "Groups"
-
- object list is a help_maintenance_selection_list grp_prompt_list_img ;
- main_file grp by index.1
-
- set location to 3 7 relative
-
- begin_row
- entry_item grp.grp_name
- end_row
-
- on_key kcancel send request_cancel_area
- on_key kexit_application send quit_help_maint
- end_object
-
- set list_object to (list(current_object))
-
- object keys is a key_button grp_prompt_keys_img
- set location to 12 1 relative
-
- item_list
- on_item ESC_CANCEL_TEXT send request_cancel
- on_item F1_HELP_TEXT send help
- end_item_list
- end_object
- end_object // grp_prompt
-
- /sbj_prompt_img
- ╔═══════════════════════════════════════════════════════════╗
- ║___________________________________________________________║
- ║ ║
- ║ ┌──────────────────────────────────┐ ║
- ║ │ │ ║
- ║ │ │ ║
- ║ │ │ ║
- ║ │ │ ║
- ║ │ │ ║
- ║ │ │ ║
- ║ │ │ ║
- ║ └──────────────────────────────────┘ ║
- ║┌─────────────────────────────────────────────────────────┐║
- ║│ │║
- ║│ │║
- ║│ │║
- ║└─────────────────────────────────────────────────────────┘║
- ║ ║
- ║ ║
- ╚═══════════════════════════════════════════════════════════╝
- /sbj_prompt_list_img
- _________________________________
- _________________________________
- _________________________________
- _________________________________
- _________________________________
- _________________________________
- _________________________________
- /sbj_prompt_keys_img
- ____________ _________
- /*
- // <Esc=Cancel> <F1=Help>
-
- object sbj_prompt is a prompt_client sbj_prompt_img
- set location to 2 10 relative
-
- set center_state item 0 to true
- set value item 0 to "Subjects"
-
- object list is a help_maintenance_selection_list sbj_prompt_list_img ;
- main_file sbj by index.1
-
- set location to 4 14 relative
-
- begin_row
- entry_item sbj.sbj_name
- end_row
-
- object text is a help_maintenance_text_window
- set location to 9 -12 relative
- set focus_mode to nonfocusable
- set read_only_state to true
- set size to 3 56
-
- assign_dbms_field sbj.sbj_text
- end_object
-
- on_key kcancel send request_cancel_area
- on_key kexit_application send quit_help_maint
-
- procedure add_focus integer obj
- forward send add_focus obj
- send entry_display to (text(current_object)) 0 0
- end_procedure
-
- procedure find_record integer rec
- forward send find_record rec
- send entry_display to (text(current_object)) 0 0
- end_procedure
-
- procedure beginning_of_data
- forward send beginning_of_data
- send entry_display to (text(current_object)) 0 0
- end_procedure
-
- procedure end_of_data
- forward send end_of_data
- send find_record (current_record(current_object))
- send entry_display to (text(current_object)) 0 0
- end_procedure
- end_object // list
-
- set list_object to (list(current_object))
-
- object keys is a key_button sbj_prompt_keys_img
- set location to 18 1 relative
-
- item_list
- on_item ESC_CANCEL_TEXT send request_cancel
- on_item F1_HELP_TEXT send help
- end_item_list
- end_object
- end_object // sbj_prompt
-
- /verify_del_img
- ╔═══════════════════════════════════════════════════════════╗
- ║___________________________________________________________║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ║ ║
- ╚═══════════════════════════════════════════════════════════╝
- /verify_del_btn_img
- ____ ________ ______
- /*
-
- object verify_del is a client verify_del_img
- set block_mouse_state to true
- set location to 9 9 relative
- set popup_state to true
- set scope_state to true
-
- set center_state item 0 to true
- set value item 0 to "Verify deletion"
-
- object text is an edit
- set focus_mode to nonfocusable
- set location to 3 2 relative
- set object_color to (hi(object_color(parent(current_object)))) ;
- (low(object_color(parent(current_object))))
- set size to 2 56
- end_object
-
- object buttons is a button verify_del_btn_img
- set location to 6 1 relative
-
- item_list
- on_item '<OK>' send ok
- on_item '<Cancel>' send cancel
- on_item '<Help>' send help
- end_item_list
- end_object
-
- on_key kcancel send stop_ui
-
- function verify string filename string related returns integer
- local string txt
- local integer result
-
- move 'Delete the ' to txt
- append txt filename ' record and ' related ' records that relate to it?'
- send delete_data (text(current_object))
- send insert to (text(current_object)) txt
-
- ui_accept current_object to result
-
- // 0 means delete, 1 means cancel
-
- if result eq msg_ok function_return 0
- else function_return 1
- end_function
- end_object // verify_del
-
- on_key kexit_application send exit_program
-
- //////////////////////////////////
- ////////////////////////////////// main logic
- //////////////////////////////////
-
- start_ui
-
- send insert_cb SUCCESS_REPLY 0
-
- abort
-