home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / devtools / dataflex / dfhelp.src < prev    next >
Encoding:
Text File  |  1993-05-19  |  66.9 KB  |  1,962 lines

  1. // dfhelp.src (help maintenance program)
  2. // March 2, 1992
  3. // LS
  4.  
  5. use dfhelp  // help maintenance utility header package
  6.  
  7. //////////////////////////////////
  8. ////////////////////////////////// global variables
  9. //////////////////////////////////
  10.  
  11. string current_grp current_sbj current_xrf current_ctx current_pth
  12. move EMPTY_STRING to current_grp
  13. move EMPTY_STRING to current_sbj
  14. move EMPTY_STRING to current_xrf
  15. move EMPTY_STRING to current_ctx
  16. move EMPTY_STRING to current_pth
  17.  
  18. indicator testing_state
  19. indicate testing_state false
  20.  
  21. //////////////////////////////////
  22. ////////////////////////////////// obj/proc/func registrations for fwd ref
  23. //////////////////////////////////
  24.  
  25. register_object main
  26. register_object help_editor
  27. register_object status_bar
  28. register_object grp_prompt
  29. register_object sbj_prompt
  30. register_object verify_del
  31. register_function verify_delete_xrf string filename string related returns integer
  32.  
  33. //////////////////////////////////
  34. ////////////////////////////////// global procedures
  35. //////////////////////////////////
  36.  
  37. procedure deactivate_area for desktop
  38.     send deactivate area_type
  39. end_procedure
  40.  
  41. function cb_return_value for desktop returns string
  42.     local string ret_val
  43.  
  44.     get value of clipboard item 0 to ret_val
  45.     trim ret_val to ret_val
  46.  
  47.     if ret_val le EMPTY_STRING begin
  48.         error 93 "Expected value not returned from program"
  49.     end
  50.     else begin
  51.         send goto_line to clipboard 0
  52.         send delete_line to clipboard
  53.     end
  54.  
  55.     function_return ret_val
  56. end_function
  57.  
  58. //////////////////////////////////
  59. ////////////////////////////////// augmentations to help_object class to
  60. ////////////////////////////////// override default help access
  61. //////////////////////////////////
  62.  
  63. procedure request_help for (class(help_object.obj)) integer msg_id integer arg
  64.     local integer orig_grp orig_sbj orig_xrf orig_ctx
  65.     local string old_grp_filename old_sbj_filename old_xrf_filename old_ctx_filename
  66.     local string cur_grp_filename cur_sbj_filename cur_xrf_filename cur_ctx_filename
  67.  
  68.     move current_pth to cur_grp_filename
  69.     append cur_grp_filename current_grp
  70.     move current_pth to cur_sbj_filename
  71.     append cur_sbj_filename current_sbj
  72.     move current_pth to cur_xrf_filename
  73.     append cur_xrf_filename current_xrf
  74.     move current_pth to cur_ctx_filename
  75.     append cur_ctx_filename current_ctx
  76.  
  77.     if cur_grp_filename gt EMPTY_STRING begin
  78.         move grp.recnum to orig_grp
  79.         close grp
  80.     end
  81.     if cur_sbj_filename gt EMPTY_STRING begin
  82.         move sbj.recnum to orig_sbj
  83.         close sbj
  84.     end
  85.     if cur_xrf_filename gt EMPTY_STRING begin
  86.         move xrf.recnum to orig_xrf
  87.         close xrf
  88.     end
  89.     if cur_ctx_filename gt EMPTY_STRING begin
  90.         move ctx.recnum to orig_ctx
  91.         close ctx
  92.     end
  93.  
  94.     [testing_state] begin
  95.         get group_filename   of help_object to old_grp_filename
  96.         get subject_filename of help_object to old_sbj_filename
  97.         get link_filename    of help_object to old_xrf_filename
  98.         get context_filename of help_object to old_ctx_filename
  99.  
  100.         set group_filename   of help_object to cur_grp_filename
  101.         set subject_filename of help_object to cur_sbj_filename
  102.         set link_filename    of help_object to cur_xrf_filename
  103.         set context_filename of help_object to cur_ctx_filename
  104.     end
  105.  
  106.     if num_arguments gt 1 send msg_id arg
  107.     else send msg_id
  108.  
  109.     [testing_state] begin
  110.         set group_filename   of help_object to old_grp_filename
  111.         set subject_filename of help_object to old_sbj_filename
  112.         set link_filename    of help_object to old_xrf_filename
  113.         set context_filename of help_object to old_ctx_filename
  114.     end
  115.  
  116.     if cur_grp_filename gt EMPTY_STRING begin
  117.         open cur_grp_filename as grp
  118.         clear grp
  119.         if orig_grp ne 0 begin
  120.             move orig_grp to grp.recnum
  121.             find eq grp.recnum
  122.         end
  123.     end
  124.     if cur_sbj_filename gt EMPTY_STRING begin
  125.         open cur_sbj_filename as sbj
  126.         clear sbj
  127.         if orig_sbj ne 0 begin
  128.             move orig_sbj to sbj.recnum
  129.             find eq sbj.recnum
  130.         end
  131.     end
  132.     if cur_xrf_filename gt EMPTY_STRING begin
  133.         open cur_xrf_filename as xrf
  134.         clear xrf
  135.         if orig_xrf ne 0 begin
  136.             move orig_xrf to xrf.recnum
  137.             find eq xrf.recnum
  138.         end
  139.     end
  140.     if cur_ctx_filename gt EMPTY_STRING begin
  141.         open cur_ctx_filename as ctx
  142.         clear ctx
  143.         if orig_ctx ne 0 begin
  144.             move orig_ctx to ctx.recnum
  145.             find eq ctx.recnum
  146.         end
  147.     end
  148. end_procedure
  149.  
  150. //////////////////////////////////
  151. ////////////////////////////////// global procedures for testing Help
  152. ////////////////////////////////// currently being edited
  153. //////////////////////////////////
  154.  
  155. procedure test_extended_help for desktop
  156.     indicate testing_state true
  157.     send request_help to help_object msg_view_context_help current_object
  158.     indicate testing_state false
  159. end_procedure
  160.  
  161. procedure test_help_for_help for desktop
  162.     indicate testing_state true
  163.     send request_help to help_object msg_view_help_for_help
  164.     indicate testing_state false
  165. end_procedure
  166.  
  167. procedure test_help_index for desktop
  168.     indicate testing_state true
  169.     send request_help to help_object msg_view_help_index
  170.     indicate testing_state false
  171. end_procedure
  172.  
  173. procedure test_keys_help for desktop
  174.     indicate testing_state true
  175.     send request_help to help_object msg_view_keys_help
  176.     indicate testing_state false
  177. end_procedure
  178.  
  179. //////////////////////////////////
  180. ////////////////////////////////// classes
  181. //////////////////////////////////
  182.  
  183. class import_export_client is a client
  184.     register_function filename returns string
  185.  
  186.     procedure construct_object integer img integer form_img integer btns_img
  187.         forward send construct_object img
  188.  
  189.         set block_mouse_state to true
  190.         set popup_state       to true
  191.         set scope_state       to true
  192.  
  193.         set center_state item 0 to true // for title
  194.         
  195.         object file is a form form_img
  196.             item_list
  197.                 on_item EMPTY_STRING send next
  198.                 set autoclear_state to true
  199.             end_item_list
  200.  
  201.             on_key ksave_record send request_ok private
  202.             on_key kcancel      send cancel     private
  203.         end_object
  204.  
  205.         object buttons is a button btns_img
  206.             item_list
  207.                 on_item F2_OK_TEXT      send request_ok
  208.                 on_item ESC_CANCEL_TEXT send cancel
  209.                 on_item F1_HELP_TEXT    send help
  210.             end_item_list
  211.  
  212.             on_key ksave_record send request_ok private
  213.             on_key kcancel      send cancel     private
  214.         end_object
  215.     end_procedure
  216.  
  217.     procedure request_ok
  218.         local string fname
  219.  
  220.         get filename to fname
  221.         if fname le EMPTY_STRING procedure_return
  222.         else procedure_return msg_ok
  223.     end_procedure
  224.  
  225.     function filename returns string
  226.         local string ret_val
  227.  
  228.         get value of (file(current_object)) item 0 to ret_val
  229.         function_return ret_val
  230.     end_function
  231.  
  232.     procedure set title_name string val
  233.         set value item 0 to val
  234.     end_procedure
  235. end_class
  236.  
  237. class prompt_client_button is a key_button
  238.     procedure construct_object integer img
  239.         forward send construct_object img
  240.  
  241.         item_list
  242.             on_item F4_PROMPT_TEXT  send prompt to (parent(current_object))
  243.             on_item ESC_CANCEL_TEXT send request_cancel_area
  244.             on_item F1_HELP_TEXT    send help
  245.         end_item_list
  246.     end_procedure
  247.  
  248.     procedure set shadow_prompt_state integer flag
  249.         set shadow_state item 0 to flag
  250.     end_procedure
  251.  
  252.     function shadow_prompt_state returns integer
  253.         local integer flag
  254.  
  255.         get shadow_state item 0 to flag
  256.         function_return flag
  257.     end_function
  258. end_class
  259.  
  260. class help_editor_pull_down_menu is a pull_down_menu
  261.     procedure activate
  262.         local integer sco id ss tot
  263.  
  264.         set_deferred 1
  265.         forward send activate
  266.  
  267.         get prior_scope to sco
  268.         if sco eq 0 move desktop to sco
  269.  
  270.         if (sco = help_editor(main(desktop))) move 0 to ss
  271.         else move 1 to ss
  272.  
  273.         move (item_count(current_object) - 1) to tot
  274.  
  275.         for id from 0 to tot
  276.             set shadow_state item id to ss
  277.         loop
  278.  
  279.         set_deferred 0
  280.     end_procedure
  281. end_class
  282.  
  283. class xrf_constraint_data_set is a data_set
  284.     procedure construct_object integer img
  285.         forward send construct_object img
  286.  
  287.         property integer constrain_to_grp public 0
  288.         property integer constrain_to_sbj public 0
  289.     end_procedure
  290.  
  291.     procedure constrain
  292.         local integer flag
  293.  
  294.         forward send constrain
  295.  
  296.         get constrain_to_grp to flag
  297.         if flag constrain xrf relates to grp
  298.         get constrain_to_sbj to flag
  299.         if flag constrain xrf relates to sbj
  300.     end_procedure
  301. end_class
  302.  
  303. class ctx_table is a table
  304.     procedure construct_object integer img
  305.         forward send construct_object img
  306.  
  307.         property integer new_record_state public 0
  308.  
  309.         on_key kclear_all           send none
  310.         on_key ksuper_find          send none
  311.         on_key ksuper_find_next     send none
  312.         on_key ksuper_find_previous send none
  313.     end_procedure
  314.  
  315.     procedure deactivating
  316.         forward send deactivating
  317.         clear ctx
  318.     end_procedure
  319.  
  320.     function name_required integer itm returns integer
  321.         local string temp_name
  322.  
  323.         get value item itm to temp_name
  324.         if temp_name le "" function_return 1
  325.     end_function
  326.  
  327.     function update_row integer row# returns integer
  328.         local integer chg b_itm
  329.  
  330.         get row_changed row# to chg
  331.  
  332.         if chg begin
  333.             get base_item to b_itm
  334.  
  335.             if (name_required(current_object,b_itm) and ;
  336.                 name_required(current_object,b_itm+1) and ;
  337.                     name_required(current_object,b_itm+2)) begin
  338.                 error 13
  339.                 function_return 1
  340.             end
  341.  
  342.             send save_row
  343.         end
  344.     end_function
  345.  
  346.     procedure request_save
  347.         local integer cur_row ret_val
  348.  
  349.         get current_row to cur_row
  350.         get update_row cur_row to ret_val
  351.     end_procedure
  352.  
  353.     procedure refind_ctx integer old_rec
  354.         clear ctx
  355.         if old_rec ne 0 begin
  356.             move old_rec to ctx.recnum
  357.             find eq ctx.recnum
  358.         end
  359.     end_procedure
  360.  
  361.     procedure save_row
  362.         local integer old_recnum chg obj
  363.  
  364.         get current_record to old_recnum
  365.         clear ctx
  366.         send entry_update ctx.file_number 1
  367.  
  368.         move 0 to chg
  369.         ifchange ctx move 1 to chg
  370.  
  371.         if chg begin
  372.             find eq ctx.hlp_name
  373.             [not found] send refind_ctx old_recnum
  374.  
  375.             reread
  376.             send entry_update ctx.file_number 0
  377.             save ctx
  378.             unlock
  379.  
  380.             set current_record to ctx.recnum
  381.             get server to obj
  382.             send request_assign to obj 0
  383.         end
  384.         else send refind_ctx old_recnum // if not changed
  385.     end_procedure
  386.  
  387.     function row_changed integer row# returns integer
  388.         local integer ret_val
  389.  
  390.         if (new_record_state(current_object)) function_return 0
  391.  
  392.         forward get row_changed row# to ret_val
  393.         function_return ret_val
  394.     end_function
  395.  
  396.     procedure add_or_remove_row
  397.         local integer new_rec
  398.  
  399.         get new_record_state to new_rec
  400.         set new_record_state to (current_record(current_object) = 0)
  401.         forward send add_or_remove_row
  402.         set new_record_state to new_rec
  403.     end_procedure
  404. end_class
  405.  
  406. //////////////////////////////////
  407. ////////////////////////////////// data sets
  408. //////////////////////////////////
  409.  
  410. // data sets for main help editor
  411.  
  412. object grp_data is a data_set no_image main_file grp
  413.     set focus_mode to no_activate
  414. end_object
  415.  
  416. object sbj_data is a data_set no_image main_file sbj
  417.     set focus_mode to no_activate
  418. end_object
  419.  
  420. object xrf_data is an xrf_constraint_data_set no_image ;
  421.         main_file xrf updating grp_data sbj_data
  422.  
  423.     set focus_mode to no_activate
  424.     set auto_fill_state to true
  425.  
  426.     set constrain_to_grp to true
  427.     set constrain_to_sbj to true
  428.  
  429.     object ctx_data is a data_set no_image main_file ctx
  430.         set focus_mode to no_activate
  431.     end_object
  432. end_object /
  433.  
  434. // data sets for prompt objects
  435.  
  436. object grp_prompt_data is a data_set no_image main_file grp
  437.     set focus_mode to no_activate
  438. end_object
  439.  
  440. object sbj_prompt_data is a data_set no_image main_file sbj
  441.     set focus_mode to no_activate
  442. end_object
  443.  
  444. object xrf_prompt_data is an xrf_constraint_data_set no_image ;
  445.         main_file xrf updating grp_prompt_data sbj_prompt_data
  446.  
  447.     set focus_mode to no_activate
  448.  
  449.     set constrain_to_grp to false
  450.     set constrain_to_sbj to false
  451. end_object
  452.  
  453. //////////////////////////////////
  454. //////////////////////////////////  main object definitions
  455. //////////////////////////////////
  456.  
  457. /title_img
  458. _______________________________________________________________________________
  459. /*
  460.  
  461. object title is a title title_img
  462.     set center_state item 0 to true
  463.     set location            to 0 0 relative
  464.     set value        item 0 to "Help Maintenance Utility"
  465. end_object
  466.  
  467. /main_img
  468.                                                                                 
  469.                                                                                 
  470.                                                                                 
  471.                                                                                 
  472.                                                                                 
  473.                                                                                 
  474.                                                                                 
  475.                                                                                 
  476.                                                                                 
  477.                                                                                 
  478.                                                                                 
  479.                                                                                 
  480.                                                                                 
  481.                                                                                 
  482.                                                                                 
  483.                                                                                 
  484.                                                                                 
  485.                                                                                 
  486.                                                                                 
  487.                                                                                 
  488. /*
  489.  
  490. class main_help_client is a client
  491.     procedure construct_object integer img
  492.         forward send construct_object img
  493.  
  494.         property integer current_grp_record public 0
  495.         property integer current_sbj_record public 0
  496.         property integer current_xrf_record public 0
  497.     end_procedure
  498. end_class
  499.  
  500. object main is a main_help_client main_img
  501.     set location to 2 0 relative
  502.  
  503. /main_action_bar_img
  504.   ____  ______  ____  ___________  ____  ____                                   
  505. /file_pd_img
  506. ┌────────────────┐
  507. │ ______________ │
  508. │ ______________ │
  509. ├────────────────┤
  510. │ ______________ │
  511. └────────────────┘
  512. /record_pd_img
  513. ┌───────────────────────────────┐
  514. │ _____________________________ │
  515. │ _____________________________ │
  516. │ _____________________________ │
  517. │ _____________________________ │
  518. │ _____________________________ │
  519. │ _____________________________ │
  520. │ _____________________________ │
  521. │ _____________________________ │
  522. │ _____________________________ │
  523. │ _____________________________ │
  524. │ _____________________________ │
  525. │ _____________________________ │
  526. └───────────────────────────────┘
  527. /text_pd_img
  528. ┌─────────────────────────────┐
  529. │ ___________________________ │
  530. │ ___________________________ │
  531. ├─────────────────────────────┤
  532. │ ___________________________ │
  533. │ ___________________________ │
  534. │ ___________________________ │
  535. │ ___________________________ │
  536. │ ___________________________ │
  537. │ ___________________________ │
  538. │ ___________________________ │
  539. └─────────────────────────────┘
  540. /maint_pd_img
  541. ┌────────────────────┐
  542. │ __________________ │
  543. │ __________________ │
  544. │ __________________ │
  545. │ __________________ │
  546. │ __________________ │
  547. │ __________________ │
  548. │ __________________ │
  549. │ __________________ │
  550. └────────────────────┘
  551. /test_pd_img
  552. ┌──────────────────┐
  553. │ ________________ │
  554. │ ________________ │
  555. │ ________________ │
  556. │ ________________ │
  557. └──────────────────┘
  558. /*
  559.  
  560.     create_menu action_bar main_action_bar_img location -1 0 relative
  561.         set action_bar_keys_msg to main_action_bar_keys
  562.  
  563.         on_item "File" begin_pull_down file_pull_down file_pd_img
  564.           on_item "Open..."        send open         to main
  565.           on_item "New..."         send new          to main
  566.           on_item "Exit    Alt+F4" send exit_program to main
  567.         end_pull_down
  568.  
  569.         register_object record_pull_down
  570.         on_item "Record" send activate_pull_down to (record_pull_down(current_object))
  571.  
  572.         object record_pull_down is a help_editor_pull_down_menu record_pd_img
  573.             item_list
  574.                 on_item "Clear                      F5" send Request_Clear
  575.                 on_item "Clear all             Ctrl+F5" send Request_Clear_All
  576.                 on_item "Delete               Shift+F2" send Request_Delete
  577.                 on_item "Find                       F9" send Find_GE
  578.                 on_item "Next                       F8" send Find_Next
  579.                 on_item "Previous                   F7" send Find_Previous
  580.                 on_item "Superfind            Shift+F9" send Superfind
  581.                 on_item "Superfind next       Shift+F8" send Superfind_Next
  582.                 on_item "Superfind previous   Shift+F7" send Superfind_Previous
  583.                 on_item "Find first          Ctrl+Home" send Beginning_Of_Data
  584.                 on_item "Find last            Ctrl+End" send End_Of_Data
  585.                 on_item "Save                       F2" send Request_Save
  586.             end_item_list
  587.         end_object
  588.  
  589.         register_object text_pull_down
  590.         on_item "Text" send activate_pull_down to (text_pull_down(current_object))
  591.  
  592.         object text_pull_down is a shadow_text_pull_down_menu text_pd_img
  593.             item_list
  594.                 on_item "Start of text     Ctrl+Home" send beginning_of_data
  595.                 on_item "End of text        Ctrl+End" send end_of_data
  596.                 on_item "Block mark           Ctrl+\" send mark_block
  597.                 on_item "Column mark"                 send mark_column
  598.                 on_item "Cut marked text       Alt+-" send cut_marked_area
  599.                 on_item "Copy marked text     Ctrl+-" send copy_marked_area
  600.                 on_item "Paste text            Alt+=" send paste_block
  601.                 on_item "Export marked text..."       send export_marked_area
  602.                 on_item "Import text..."              send import_text
  603.             end_item_list
  604.         end_object
  605.  
  606.         register_object maint_pull_down
  607.         on_item "Maintenance" send activate_pull_down to (maint_pull_down(current_object))
  608.  
  609.         object maint_pull_down is a help_editor_pull_down_menu maint_pd_img
  610.             item_list
  611.                 on_item "Group..."           send group           to main
  612.                 on_item "Subject..."         send subject         to main
  613.                 on_item "Cross reference..." send cross_reference to main
  614.                 on_item "Context..."         send context         to main
  615.                 on_item "Cleanup..."         send cleanup         to main
  616.                 on_item "Import..."          send import          to main
  617.                 on_item "Erase data..."      send erase_data      to main
  618.                 on_item "Re-order data..."   send reorder_data    to main
  619.             end_item_list
  620.         end_object
  621.  
  622.         register_object test_pull_down
  623.         on_item "Test" send activate_pull_down to (test_pull_down(current_object))
  624.  
  625.         object test_pull_down is a help_editor_pull_down_menu test_pd_img
  626.             item_list
  627.                 on_item "Help for help..." send test_help_for_help
  628.                 on_item "Extended help..." send test_extended_help
  629.                 on_item "Keys help..."     send test_keys_help
  630.                 on_item "Help index..."    send test_help_index
  631.             end_item_list
  632.         end_object
  633.  
  634.         #INCLUDE HELPA_PD.INC
  635.  
  636.         on_key kcancel send exit_area private
  637.     end_menu
  638.  
  639.     procedure main_action_bar_keys for desktop integer obj
  640.         on_key key_alt+key_f send activate to (file_pull_down(obj))   private
  641.         on_key key_alt+key_r send activate to (record_pull_down(obj)) private
  642.         on_key key_alt+key_t send activate to (text_pull_down(obj))   private
  643.         on_key key_alt+key_m send activate to (maint_pull_down(obj))  private
  644.         on_key key_alt+key_e send activate to (test_pull_down(obj))   private
  645.         on_key key_alt+key_h send activate to (help_pull_down(obj))   private
  646.     end_procedure
  647.  
  648. /help_editor_img
  649. ┌─────────────────────────────────────────────────────────────┐
  650. │_____________________________________________________________│
  651. │                                                             │
  652. │                                                             │
  653. │                                                             │
  654. │ ┌ Subject text: ──────────────────────────────────────────┐ │
  655. │ │                                                         │ │
  656. │ │                                                         │ │
  657. │ │                                                         │ │
  658. │ │                                                         │ │
  659. │ │                                                         │ │
  660. │ │                                                         │ │
  661. │ │                                                         │ │
  662. │ │                                                         │ │
  663. │ │                                                         │ │
  664. │ │                                                         │ │
  665. │ └─────────────────────────────────────────────────────────┘ │
  666. │                                                             │
  667. │                                                             │
  668. └─────────────────────────────────────────────────────────────┘
  669. /topic_img
  670.       Group: _________________________________  
  671.     Subject: _________________________________  
  672. /link_status_img
  673.   Linked:   
  674.     ___    
  675. /help_editor_keys_img
  676.   ____________________________   ________________________  
  677.        ___________    __________________    _________      
  678. /*
  679. //<Alt+F1=Context assignments>   <Alt+F2=Find by context>
  680. //     <F4=Prompt>    <Alt+F9=Zoom text>    <F1=Help>
  681.  
  682. /help_editor_left_zoom_img
  683.   
  684.   
  685.   
  686.   
  687.   
  688.   
  689.   
  690.   
  691.   
  692.   
  693.   
  694.   
  695.   
  696.   
  697.   
  698.   
  699.   
  700. /help_editor_right_zoom_img
  701.   
  702.   
  703.   
  704.   
  705.   
  706.   
  707.   
  708.   
  709.   
  710.   
  711.   
  712.   
  713.   
  714.   
  715.   
  716.   
  717.   
  718. /help_editor_zoom_keys_img
  719.           ____________________          _________          
  720. /*
  721. //        <Alt+F9=Cancel zoom>          <F1=Help>
  722.  
  723.     object help_editor is an entry_client help_editor_img ring popup ;
  724.                        using xrf_data action_bar (action_bar(main.obj))
  725.  
  726.         register_function verify_xrf_delete returns integer
  727.         register_object text
  728.  
  729.         set attach_parent_state to true
  730.         set location            to 0 9 relative
  731.         set scope_state         to true
  732.         set verify_delete_msg   to get_verify_xrf_delete
  733.  
  734.         set center_state item 0 to true
  735.         set value        item 0 to "Help Topics"
  736.  
  737.         object topic is an entry_form topic_img
  738.             set auto_clear_deo_state to false
  739.             set location             to 3 2 relative
  740.  
  741.             item_list
  742.                 entry_item grp.grp_name { autofind, iprompt=(grp_prompt(main.obj)) }
  743.                 entry_item sbj.sbj_name { iprompt=(sbj_prompt(main.obj)) }
  744.             end_item_list
  745.  
  746.             on_key key_alt+key_f1 send edit_contexts
  747.             on_key key_alt+key_f2 send find_by_context
  748.             on_key kcancel        send activate to (action_bar(main.obj))
  749.             on_key kexit_function send none
  750.             on_key kzoom          send zoom_text_area
  751.  
  752.             procedure request_clear
  753.                 send request_clear_all
  754.             end_procedure
  755.  
  756.             procedure request_delete
  757.                 local integer obj
  758.  
  759.                 indicate err false
  760.                 forward send request_delete
  761.                 [not err] get server to obj
  762.                 [not err] send clear to obj
  763.             end_procedure
  764.  
  765.             function name_required integer itm returns integer
  766.                 local string temp_name
  767.  
  768.                 get value item itm to temp_name
  769.                 if temp_name le "" begin // don't save blank records
  770.                     error 13
  771.                     if (focus(desktop)) ne current_object send activate
  772.                     set current_item to itm
  773.                     function_return 1
  774.                 end
  775.             end_function
  776.  
  777.             procedure request_save
  778.                 local integer cur_grp cur_sbj cur_xrf
  779.  
  780.                 if (name_required(current_object,0)) procedure_return
  781.                 if (name_required(current_object,1)) procedure_return
  782.  
  783.                 get current_record of grp_data to cur_grp
  784.                 get current_record of sbj_data to cur_sbj
  785.                 get current_record of xrf_data to cur_xrf
  786.                 if ((cur_grp or cur_sbj) and not(cur_xrf)) set changed_state to true
  787.  
  788.                 forward send request_save
  789.             end_procedure
  790.  
  791.             procedure request_superfind integer mode
  792.                 local integer obj
  793.  
  794.                 get server to obj
  795.                 set constrain_to_grp of obj to false
  796.                 set constrain_to_sbj of obj to false
  797.                 send rebuild_constraints to obj
  798.  
  799.                 forward send request_superfind mode
  800.  
  801.                 set constrain_to_grp of obj to true
  802.                 set constrain_to_sbj of obj to true
  803.                 send rebuild_constraints to obj
  804.             end_procedure
  805.         end_object
  806.  
  807.         object link is an entry_form link_status_img
  808.             register_function link_value returns string
  809.  
  810.             set skip_state to true
  811.             set location   to 3 50 relative
  812.  
  813.             item_list
  814.                 entry_item (link_value(current_object))
  815.             end_item_list
  816.  
  817.             function link_value returns string
  818.                 if xrf.recnum eq 0 begin
  819.                     delegate send shadow_edit_ctx_button true
  820.                     if (grp.recnum ne 0 and sbj.recnum ne 0) function_return NO_STRING
  821.                     else function_return EMPTY_STRING
  822.                 end
  823.                 else begin
  824.                     delegate send shadow_edit_ctx_button false
  825.                     function_return YES_STRING
  826.                 end
  827.             end_function
  828.         end_object
  829.  
  830.         object text is a help_maintenance_text_window
  831.             set auto_clear_deo_state to false
  832.             set location             to 6 3 relative
  833.             set size                 to 10 56
  834.  
  835.             assign_dbms_field sbj.sbj_text
  836.  
  837.             object left_zoom is a message help_editor_left_zoom_img
  838.                 set location   to 0 -2 relative
  839.                 set focus_mode to no_activate
  840.             end_object
  841.                 
  842.             object right_zoom is a message help_editor_right_zoom_img
  843.                 set location   to 0 57 relative
  844.                 set focus_mode to no_activate
  845.             end_object
  846.  
  847.             object zoom_keys is a key_button help_editor_zoom_keys_img
  848.                 set location   to 17 -2 relative
  849.                 set focus_mode to no_activate
  850.  
  851.                 item_list
  852.                     on_item "<Alt+F9=Cancel zoom>" send shrink_text
  853.                     on_item F1_HELP_TEXT           send help
  854.                 end_item_list
  855.             end_object
  856.  
  857. /help_editor_export_img
  858. ╔════════════════════════════════════════════╗
  859. ║____________________________________________║
  860. ║                                            ║
  861. ║  File to export text to:                   ║
  862. ║  ________________________________________  ║
  863. ║                                            ║
  864. ║    _______    ____________    _________    ║
  865. ╚════════════════════════════════════════════╝
  866. /*
  867. //   <F2=OK>    <Esc=Cancel>    <F1=Help>
  868.  
  869. sub_page help_editor_export_file_img  from help_editor_export_img 2
  870. sub_page help_editor_export_btns_img  from help_editor_export_img 3 4 5
  871.  
  872. /help_editor_import_img
  873. ╔════════════════════════════════════════════╗
  874. ║____________________________________________║
  875. ║                                            ║
  876. ║  File to import text from:                 ║
  877. ║  ________________________________________  ║
  878. ║                                            ║
  879. ║    _______    ____________    _________    ║
  880. ╚════════════════════════════════════════════╝
  881. /*
  882. //   <F2=OK>    <Esc=Cancel>    <F1=Help>
  883.  
  884. sub_page help_editor_import_file_img  from help_editor_import_img 2
  885. sub_page help_editor_import_btns_img  from help_editor_import_img 3 4 5
  886.  
  887.             object export is an import_export_client help_editor_export_img help_editor_export_file_img help_editor_export_btns_img
  888.                 set location   to 3 5 relative
  889.                 set title_name to "Export marked text"
  890.             end_object
  891.  
  892.             set export_object to (export(current_object))
  893.  
  894.             object import is an import_export_client help_editor_import_img help_editor_import_file_img help_editor_import_btns_img
  895.                 set location   to 3 5 relative
  896.                 set title_name to "Import text"
  897.             end_object
  898.  
  899.             set import_object to (import(current_object))
  900.  
  901.             on_key key_alt+key_f1 send edit_contexts
  902.             on_key key_alt+key_f2 send find_by_context
  903.             on_key kcancel        send activate to (action_bar(main.obj))
  904.             on_key kexit_function send none
  905.             on_key kzoom          send toggle_zoom
  906.  
  907.             procedure find_by_context
  908.                 local integer flag
  909.  
  910.                 get zoom_state to flag
  911.                 if not flag delegate send find_by_context
  912.             end_procedure
  913.  
  914.             procedure edit_contexts
  915.                 local integer flag
  916.  
  917.                 get zoom_state to flag
  918.                 if not flag delegate send edit_contexts
  919.             end_procedure
  920.  
  921.             procedure switch
  922.                 local integer flag
  923.  
  924.                 get zoom_state to flag
  925.                 if not flag forward send switch
  926.             end_procedure
  927.  
  928.             procedure switch_back
  929.                 local integer flag
  930.  
  931.                 get zoom_state to flag
  932.                 if not flag forward send switch_back
  933.             end_procedure
  934.  
  935.             procedure prompt
  936.                 local integer flag
  937.  
  938.                 get zoom_state to flag
  939.                 if not flag send popup to (sbj_prompt(main.obj))
  940.             end_procedure
  941.  
  942.             procedure request_cancel
  943.                 local integer flag
  944.  
  945.                 forward send request_cancel
  946.                 get zoom_state to flag
  947.                 if flag send shrink_text
  948.             end_procedure
  949.  
  950.             procedure request_clear
  951.                 send request_clear_all
  952.             end_procedure
  953.  
  954.             procedure request_clear_all
  955.                 local integer flag
  956.  
  957.                 forward send request_clear_all
  958.                 get zoom_state to flag
  959.                 if flag send shrink_text
  960.             end_procedure
  961.  
  962.             procedure request_delete
  963.                 local integer obj
  964.                 
  965.                 indicate err false
  966.                 forward send request_delete
  967.                 [not err] get server to obj
  968.                 [not err] send clear to obj
  969.             end_procedure
  970.  
  971.             procedure request_save
  972.                 local integer cur_grp cur_sbj cur_xrf
  973.  
  974.                 if (name_required(topic(parent(current_object)),0)) ;
  975.                     procedure_return
  976.                 if (name_required(topic(parent(current_object)),1)) ;
  977.                     procedure_return
  978.  
  979.                 get current_record of grp_data to cur_grp
  980.                 get current_record of sbj_data to cur_sbj
  981.                 get current_record of xrf_data to cur_xrf
  982.                 if ((cur_grp or cur_sbj) and not(cur_xrf)) ;
  983.                     set changed_state to true
  984.  
  985.                 forward send request_save
  986.             end_procedure
  987.  
  988.             procedure toggle_zoom
  989.                 local integer flag
  990.  
  991.                 get zoom_state to flag
  992.                 if not flag send zoom_text
  993.                 else send shrink_text
  994.             end_procedure
  995.  
  996.             procedure zoom_text
  997.                 local integer obj
  998.  
  999.                 set location to 1 3 relative
  1000.                 set size to 17 56
  1001.  
  1002.                 move (left_zoom(current_object)) to obj
  1003.                 set focus_mode of obj to nonfocusable
  1004.                 send add_focus to obj current_object
  1005.                 move (right_zoom(current_object)) to obj
  1006.                 set focus_mode of obj to nonfocusable
  1007.                 send add_focus to obj current_object
  1008.                 move (zoom_keys(current_object)) to obj
  1009.                 set focus_mode of obj to pointer_only
  1010.                 send add_focus to obj current_object
  1011.                 get focus of desktop to obj
  1012.                 if obj ne current_object send activate
  1013.  
  1014.                 set zoom_state to true
  1015.             end_procedure
  1016.  
  1017.             procedure shrink_text
  1018.                 local integer obj
  1019.  
  1020.                 move (left_zoom(current_object)) to obj
  1021.                 send deactivate to obj
  1022.                 set focus_mode of obj to no_activate
  1023.                 move (right_zoom(current_object)) to obj
  1024.                 send deactivate to obj
  1025.                 set focus_mode of obj to no_activate
  1026.                 move (zoom_keys(current_object)) to obj
  1027.                 send deactivate to obj
  1028.                 set focus_mode of obj to no_activate
  1029.  
  1030.                 set size to 10 56
  1031.                 set location to 6 3 relative
  1032.  
  1033.                 set zoom_state to false
  1034.             end_procedure
  1035.         end_object // text
  1036.  
  1037.         object keys is a key_button help_editor_keys_img
  1038.             set location to 17 2 relative
  1039.  
  1040.             item_list
  1041.                 on_item "<Alt+F1=Context assignments>" send edit_contexts
  1042.                 on_item "<Alt+F2=Find by context>"     send find_by_context
  1043.                 on_item F4_PROMPT_TEXT                 send prompt
  1044.                 on_item "<Alt+F9=Zoom text>"           send zoom_text_area
  1045.                 on_item F1_HELP_TEXT                   send help
  1046.             end_item_list
  1047.         end_object
  1048.  
  1049. /find_ctx_img
  1050. ╔═════════════════════════════════════════════════════════════╗
  1051. ║_____________________________________________________________║
  1052. ║                                                             ║
  1053. ║  Application name: _______________                          ║
  1054. ║       Module name: _______________                          ║
  1055. ║         Help name: ________________________________________ ║
  1056. ║                                                             ║
  1057. ║   _______  __________  __________________  ______________   ║
  1058. ║       _________         ____________         _________      ║
  1059. ╚═════════════════════════════════════════════════════════════╝
  1060. /*
  1061. //  <F2=OK>  <F5=Clear>  <F7=Find previous>  <F8=Find next>
  1062. //      <F9=Find>         <Esc=Cancel>         <F1=Help>
  1063.  
  1064. sub_page find_ctx_form_img  from find_ctx_img 2 3 4
  1065. sub_page find_ctx_btns_img  from find_ctx_img 5 6 7 8 9 10 11
  1066.  
  1067.         object find_ctx is a client find_ctx_img
  1068.             set block_mouse_state to true
  1069.             set location          to 7 0 relative
  1070.             set popup_state       to true
  1071.             set scope_state       to true
  1072.  
  1073.             set center_state item 0 to true
  1074.             set value        item 0 to "Find Help by Context"
  1075.  
  1076.             object ctx_form is an entry_form find_ctx_form_img
  1077.                 item_list
  1078.                     entry_item ctx.app_name
  1079.                     entry_item ctx.mod_name
  1080.                     entry_item ctx.hlp_name { autofind }
  1081.                 end_item_list
  1082.  
  1083.                 on_key kbegin_of_data       send none
  1084.                 on_key kcancel              send request_cancel_area
  1085.                 on_key kclear_all           send none
  1086.                 on_key kdelete_record       send none
  1087.                 on_key kend_of_data         send none
  1088.                 on_key ksave_record         send request_ok
  1089.                 on_key ksuper_find          send none
  1090.                 on_key ksuper_find_next     send none
  1091.                 on_key ksuper_find_previous send none
  1092.             end_object
  1093.  
  1094.             object keys is a button find_ctx_btns_img
  1095.                 item_list
  1096.                     on_item F2_OK_TEXT           send request_ok
  1097.                     on_item "<F5=Clear>"         send request_clear
  1098.                     on_item "<F7=Find previous>" send find_previous
  1099.                     on_item "<F8=Find next>"     send find_next
  1100.                     on_item "<F9=Find>"          send find_ge
  1101.                     on_item ESC_CANCEL_TEXT      send request_cancel_area
  1102.                     on_item F1_HELP_TEXT         send help
  1103.                 end_item_list
  1104.  
  1105.                 on_key ksave_record   send request_ok
  1106.                 on_key kclear         send request_clear
  1107.                 on_key kfind_previous send find_previous
  1108.                 on_key kfind_next     send find_next
  1109.                 on_key kfind          send find_ge
  1110.                 on_key kcancel        send request_cancel_area
  1111.             end_object
  1112.  
  1113.             procedure activating
  1114.                 delegate send save_main_buffers
  1115.                 forward send activating
  1116.             end_procedure
  1117.             
  1118.             procedure find_previous
  1119.                 send find_previous to (ctx_form(current_object))
  1120.             end_procedure
  1121.  
  1122.             procedure find_next
  1123.                 send find_next to (ctx_form(current_object))
  1124.             end_procedure
  1125.  
  1126.             procedure find_ge
  1127.                 send find_ge to (ctx_form(current_object))
  1128.             end_procedure
  1129.  
  1130.             procedure request_cancel_area
  1131.                 delegate send reset_main_buffers
  1132.                 send request_cancel
  1133.             end_procedure
  1134.  
  1135.             procedure request_cancel
  1136.                 send deactivate_area
  1137.                 clear ctx
  1138.             end_procedure
  1139.  
  1140.             procedure request_clear
  1141.                 local integer obj
  1142.  
  1143.                 move (ctx_form(current_object)) to obj
  1144.                 send request_clear to obj
  1145.                 send activate to obj
  1146.                 set current_item of obj to 0
  1147.             end_procedure
  1148.  
  1149.             procedure request_ok
  1150.                 clear ctx
  1151.                 send entry_update to (ctx_form(current_object)) ctx.file_number true
  1152.                 find eq ctx.hlp_name
  1153.  
  1154.                 if [found] begin
  1155.                     send find_by_recnum to xrf_data xrf.file_number ctx.xrf_recnum
  1156.                     send request_cancel
  1157.                 end
  1158.                 else error 25 "CTX"
  1159.             end_procedure
  1160.         end_object // find_ctx
  1161.  
  1162. /contexts_img
  1163. ╔══════════════════════════════════════════════════════════════════════════════╗
  1164. ║______________________________________________________________________________║
  1165. ║                                                                              ║
  1166. ║  Application name Module name      Help name                                 ║
  1167. ║  _______________  _______________  ________________________________________  ║
  1168. ║  _______________  _______________  ________________________________________  ║
  1169. ║  _______________  _______________  ________________________________________  ║
  1170. ║  _______________  _______________  ________________________________________  ║
  1171. ║  _______________  _______________  ________________________________________  ║
  1172. ║                                                                              ║
  1173. ║                      _________        _________________                      ║
  1174. ║              ______________        ___________        _________              ║
  1175. ╚══════════════════════════════════════════════════════════════════════════════╝
  1176. /*
  1177. //                     <F2=Save>        <Shift+F2=Delete>
  1178. //             <F5=Clear/Add>        <Esc=Close>        <F1=Help>
  1179.  
  1180. sub_page contexts_list_img  from contexts_img horizontal 2 15
  1181. sub_page contexts_btns_img  from contexts_img 17 18 19 20 21
  1182.  
  1183.         object contexts is a client contexts_img
  1184.             set block_mouse_state to true
  1185.             set location          to 7 -9 relative
  1186.             set popup_state       to true
  1187.             set scope_state       to true
  1188.  
  1189.             set center_state item 0 to true
  1190.             set value        item 0 to "Help Contexts"
  1191.  
  1192.             object ctx_list is a ctx_table contexts_list_img main_file ctx by index.2 ;
  1193.                     using (ctx_data(xrf_data.obj))
  1194.  
  1195.                 set wrap_state to true
  1196.  
  1197.                 begin_row
  1198.                     entry_item ctx.app_name
  1199.                     entry_item ctx.mod_name
  1200.                     entry_item ctx.hlp_name
  1201.                 end_row
  1202.             end_object // ctx_list
  1203.  
  1204.             object keys is a key_button contexts_btns_img
  1205.                 item_list
  1206.                     on_item "<F2=Save>"         send request_save
  1207.                     on_item "<Shift+F2=Delete>" send request_delete
  1208.                     on_item "<F5=Clear/Add>"    send request_clear
  1209.                     on_item "<Esc=Close>"       send request_cancel
  1210.                     on_item F1_HELP_TEXT        send help
  1211.                 end_item_list
  1212.             end_object
  1213.         end_object // contexts
  1214.  
  1215.         procedure shadow_edit_ctx_button integer flag
  1216.             set shadow_state of (keys(current_object)) item 0 to flag
  1217.         end_procedure
  1218.  
  1219.         procedure find_by_context
  1220.             send popup to (find_ctx(current_object))
  1221.         end_procedure
  1222.  
  1223.         function verify_xrf_delete returns integer
  1224.             local integer ret_val
  1225.  
  1226.             if not status xrf begin
  1227.                 error 71 "XRF"
  1228.                 function_return 1
  1229.             end
  1230.  
  1231.             delegate get verify_delete_xrf "Link" "Context" to ret_val
  1232.             [not err] if ret_val indicate err true
  1233.             function_return ret_val
  1234.         end_function
  1235.  
  1236.         procedure release_focus
  1237.             local integer obj
  1238.  
  1239.             forward send release_focus
  1240.             close grp
  1241.             close sbj
  1242.             close xrf
  1243.             close ctx
  1244.             move EMPTY_STRING to current_grp
  1245.             move EMPTY_STRING to current_sbj
  1246.             move EMPTY_STRING to current_xrf
  1247.             move EMPTY_STRING to current_ctx
  1248.             move EMPTY_STRING to current_pth
  1249.  
  1250.             delegate send no_filenames
  1251.         end_procedure
  1252.  
  1253.         procedure request_clear_all
  1254.             local integer obj
  1255.  
  1256.             move (topic(current_object)) to obj
  1257.             send request_clear_all to obj
  1258.             set current_item of obj to 0
  1259.         end_procedure
  1260.  
  1261.         procedure edit_contexts
  1262.             local integer flag
  1263.  
  1264.             get shadow_state of (keys(current_object)) item 0 to flag
  1265.             if not flag send popup to (contexts(current_object))
  1266.         end_procedure
  1267.  
  1268.         procedure zoom_text_area
  1269.             send zoom_text to (text(current_object))
  1270.         end_procedure
  1271.     end_object // help_editor
  1272.  
  1273. /main_status_bar_img
  1274. Files: ________ ________ ________ ________│Path: _______________________________
  1275. /*
  1276.  
  1277.     object status_bar is a message main_status_bar_img
  1278.         set focus_mode   to nonfocusable
  1279.         set location     to 20 0 relative
  1280.         set object_color to ;
  1281.             (hi(object_color(action_bar(main.obj)))) (low(object_color(action_bar(main.obj))))
  1282.     end_object
  1283.  
  1284. /verify_del_img
  1285. ╔═══════════════════════════════════════════════════════════╗
  1286. ║___________________________________________________________║
  1287. ║                                                           ║
  1288. ║                                                           ║
  1289. ║                                                           ║
  1290. ║                                                           ║
  1291. ║                                                           ║
  1292. ║                                                           ║
  1293. ╚═══════════════════════════════════════════════════════════╝
  1294. /verify_del_btn_img
  1295.          ____           ________           ______          
  1296. /*
  1297. //       <OK>           <Cancel>           <Help>
  1298.  
  1299.     object verify_del is a client verify_del_img
  1300.         set block_mouse_state to true
  1301.         set location          to 6 9 relative
  1302.         set popup_state       to true
  1303.         set scope_state       to true
  1304.  
  1305.         set center_state item 0 to true
  1306.         set value        item 0 to "Verify deletion"
  1307.         
  1308.         object text is an edit
  1309.             set focus_mode   to nonfocusable
  1310.             set location     to 3 2 relative
  1311.             set object_color to (hi(object_color(parent(current_object)))) ;
  1312.                 (low(object_color(parent(current_object))))
  1313.             set size         to 2 56
  1314.             set scroll_bar_visible_state to false
  1315.         end_object
  1316.         
  1317.         object buttons is a button verify_del_btn_img
  1318.             set location to 6 1 relative
  1319.  
  1320.             item_list
  1321.                 on_item '<OK>'     send ok
  1322.                 on_item '<Cancel>' send cancel
  1323.                 on_item '<Help>'   send help
  1324.             end_item_list
  1325.         end_object
  1326.         
  1327.         on_key kcancel send stop_ui
  1328.     end_object // verify_del
  1329.  
  1330. /grp_prompt_img
  1331. ╔══════════════════════════════════════════════╗
  1332. ║______________________________________________║
  1333. ║                                              ║
  1334. ║                                              ║
  1335. ║                                              ║
  1336. ║                                              ║
  1337. ║                                              ║
  1338. ║                                              ║
  1339. ║                                              ║
  1340. ║                                              ║
  1341. ║                                              ║
  1342. ║                                              ║
  1343. ║                                              ║
  1344. ╚══════════════════════════════════════════════╝
  1345. /grp_prompt_list_img
  1346. _________________________________
  1347. _________________________________
  1348. _________________________________
  1349. _________________________________
  1350. _________________________________
  1351. _________________________________
  1352. _________________________________
  1353. _________________________________
  1354. /grp_prompt_btn_img
  1355.    ___________    ____________    _________   
  1356. /*
  1357. // <F4=Prompt>    <Esc=Cancel>    <F1=Help>
  1358.  
  1359.     object grp_prompt is a help_maintenance_prompt_client grp_prompt_img
  1360.         set location to 3 16 relative
  1361.  
  1362.         set center_state item 0 to true
  1363.         set value        item 0 to "Groups"
  1364.  
  1365.         object list is a help_maintenance_selection_list grp_prompt_list_img ;
  1366.                 using grp_prompt_data main_file grp by index.1
  1367.  
  1368.             set export_server to grp_data.obj
  1369.             set location      to 3 7 relative
  1370.  
  1371.             begin_row
  1372.                 entry_item grp.grp_name
  1373.             end_row
  1374.  
  1375.             on_key kcancel           send request_cancel_area
  1376.             on_key kenter            send request_ok
  1377.             on_key kexit_application send quit_help_maint
  1378.             on_key kprompt           send prompt to (parent(current_object))
  1379.         end_object
  1380.  
  1381.         object buttons is a prompt_client_button grp_prompt_btn_img
  1382.             set location to 12 1 relative
  1383.         end_object
  1384.  
  1385.         procedure popup_for_xrf
  1386.             local integer obj
  1387.             local string txt
  1388.  
  1389.             move "Groups for " to txt
  1390.             append txt sbj.sbj_name
  1391.             trim txt to txt
  1392.             set value item 0 to txt // title
  1393.  
  1394.             set shadow_prompt_state of (buttons(current_object)) to true
  1395.  
  1396.             move (list(current_object)) to obj
  1397.             set export_server of obj to xrf_data.obj
  1398.             set main_file     of obj to xrf.file_number
  1399.             set ordering      of obj to index.2
  1400.             set server        of obj to xrf_prompt_data.obj
  1401.             send scan_servers to obj
  1402.  
  1403.             set constrain_to_sbj of xrf_prompt_data to true
  1404.             send rebuild_constraints to xrf_prompt_data
  1405.  
  1406.             set focus_mode to focusable
  1407.             send activate
  1408.         end_procedure
  1409.  
  1410.         procedure popup
  1411.             send reset
  1412.             forward send popup
  1413.         end_procedure
  1414.  
  1415.         procedure prompt
  1416.             local integer flag obj
  1417.  
  1418.             get shadow_prompt_state of (buttons(current_object)) to flag
  1419.  
  1420.             get parent to obj
  1421.             if not flag send popup_for_xrf to (sbj_prompt(obj))
  1422.         end_procedure
  1423.  
  1424.         procedure request_cancel_area
  1425.             local integer obj flag
  1426.  
  1427.             move (list(current_object)) to obj
  1428.             send request_cancel to obj
  1429.  
  1430.             send cancel to obj
  1431.  
  1432.             get parent to obj
  1433.             get active_state of (sbj_prompt(obj)) to flag
  1434.             if flag send reset
  1435.  
  1436.             forward send request_cancel_area
  1437.         end_procedure
  1438.  
  1439.         procedure request_ok
  1440.             local integer obj flag
  1441.  
  1442.             send ok to (list(current_object))
  1443.             get parent to obj
  1444.             move (sbj_prompt(obj)) to obj
  1445.             get active_state of obj to flag
  1446.  
  1447.             if flag begin
  1448.                 send reset
  1449.                 send request_cancel to (list(obj))
  1450.             end
  1451.         end_procedure
  1452.  
  1453.         procedure reset
  1454.             local integer obj
  1455.  
  1456.             set value item 0 to "Groups" // title
  1457.  
  1458.             set shadow_prompt_state of (buttons(current_object)) to false
  1459.  
  1460.             move (list(current_object)) to obj
  1461.             set export_server   of obj to grp_data.obj
  1462.             set main_file       of obj to grp.file_number
  1463.             set ordering        of obj to index.1
  1464.             set server          of obj to grp_prompt_data.obj
  1465.             send scan_servers   to obj
  1466.  
  1467.             set constrain_to_sbj of xrf_prompt_data to false
  1468.         end_procedure
  1469.  
  1470.         procedure quit_help_maint
  1471.             local integer foc
  1472.  
  1473.             send request_cancel_area
  1474.             get focus of desktop to foc
  1475.             send exit_application to foc
  1476.         end_procedure
  1477.     end_object // grp_prompt
  1478.  
  1479. /sbj_prompt_img
  1480. ╔═══════════════════════════════════════════════════════════╗
  1481. ║___________________________________________________________║
  1482. ║                                                           ║
  1483. ║            ┌──────────────────────────────────┐           ║
  1484. ║            │                                  │           ║
  1485. ║            │                                  │           ║
  1486. ║            │                                  │           ║
  1487. ║            │                                  │           ║
  1488. ║            │                                  │           ║
  1489. ║            │                                  │           ║
  1490. ║            │                                  │           ║
  1491. ║            └──────────────────────────────────┘           ║
  1492. ║┌─────────────────────────────────────────────────────────┐║
  1493. ║│                                                         │║
  1494. ║│                                                         │║
  1495. ║│                                                         │║
  1496. ║└─────────────────────────────────────────────────────────┘║
  1497. ║                                                           ║
  1498. ║                                                           ║
  1499. ╚═══════════════════════════════════════════════════════════╝
  1500. /sbj_prompt_list_img
  1501. _________________________________
  1502. _________________________________
  1503. _________________________________
  1504. _________________________________
  1505. _________________________________
  1506. _________________________________
  1507. _________________________________
  1508. /sbj_prompt_btn_img
  1509.          ___________     ____________     _________        
  1510. /*
  1511. //       <F4=Prompt>     <Esc=Cancel>     <F1=Help>
  1512.  
  1513.     object sbj_prompt is a help_maintenance_prompt_client sbj_prompt_img
  1514.         set location to 0 10 relative
  1515.  
  1516.         set center_state item 0 to true
  1517.         set value        item 0 to "Subjects"
  1518.  
  1519.         object list is a help_maintenance_selection_list sbj_prompt_list_img ;
  1520.                 using sbj_prompt_data main_file sbj by index.1
  1521.  
  1522.             set export_server to sbj_data.obj
  1523.             set location      to 4 14 relative
  1524.  
  1525.             begin_row
  1526.                 entry_item sbj.sbj_name
  1527.             end_row
  1528.  
  1529.             object text is a help_maintenance_text_window
  1530.                 set location         to 9 -12 relative
  1531.                 set focus_mode       to nonfocusable
  1532.                 set read_only_state  to true
  1533.                 set size             to 3 56
  1534.  
  1535.                 assign_dbms_field sbj.sbj_text
  1536.             end_object
  1537.  
  1538.             on_key kcancel           send request_cancel_area
  1539.             on_key kenter            send request_ok
  1540.             on_key kexit_application send quit_help_maint
  1541.             on_key kprompt           send prompt to (parent(current_object))
  1542.  
  1543.             procedure find_record integer rec
  1544.                 forward send find_record rec
  1545.                 send entry_display to (text(current_object)) 0 0
  1546.             end_procedure
  1547.  
  1548.             procedure beginning_of_data
  1549.                 forward send beginning_of_data
  1550.                 send entry_display to (text(current_object)) 0 0
  1551.             end_procedure
  1552.  
  1553.             procedure end_of_data
  1554.                 forward send end_of_data
  1555.                 send read_by_recnum to (server(current_object)) (main_file(current_object)) (current_record(current_object))
  1556.                 send entry_display to (text(current_object)) 0 0
  1557.             end_procedure
  1558.         end_object // list
  1559.  
  1560.         object buttons is a prompt_client_button sbj_prompt_btn_img
  1561.             set location to 18 1 relative
  1562.         end_object
  1563.  
  1564.         procedure popup_for_xrf
  1565.             local integer obj
  1566.             local string txt
  1567.  
  1568.             move "Subjects for " to txt
  1569.             append txt grp.grp_name
  1570.             trim txt to txt
  1571.             set value item 0 to txt // title
  1572.  
  1573.             set shadow_prompt_state of (buttons(current_object)) to true
  1574.  
  1575.             move (list(current_object)) to obj
  1576.             set export_server of obj to xrf_data.obj
  1577.             set main_file     of obj to xrf.file_number
  1578.             set ordering      of obj to index.1
  1579.             set server        of obj to xrf_prompt_data.obj
  1580.             send scan_servers to obj
  1581.  
  1582.             set constrain_to_grp of xrf_prompt_data to true
  1583.             send rebuild_constraints to xrf_prompt_data
  1584.  
  1585.             set focus_mode to focusable
  1586.             send activate
  1587.         end_procedure
  1588.  
  1589.         procedure popup
  1590.             send reset
  1591.             forward send popup
  1592.         end_procedure
  1593.  
  1594.         procedure prompt
  1595.             local integer flag obj
  1596.  
  1597.             get shadow_prompt_state of (buttons(current_object)) to flag
  1598.             get parent to obj
  1599.             if not flag send popup_for_xrf to (grp_prompt(obj))
  1600.         end_procedure
  1601.  
  1602.         procedure request_cancel_area
  1603.             local integer obj flag
  1604.             
  1605.             move (list(current_object)) to obj
  1606.             send request_cancel to obj
  1607.  
  1608.             send cancel to obj
  1609.  
  1610.             get parent to obj
  1611.             get active_state of (grp_prompt(obj)) to flag
  1612.             if flag send reset
  1613.  
  1614.             forward send request_cancel_area
  1615.         end_procedure
  1616.  
  1617.         procedure request_ok
  1618.             local integer obj flag
  1619.  
  1620.             send ok to (list(current_object))
  1621.             get parent to obj
  1622.             move (grp_prompt(obj)) to obj
  1623.             get active_state of obj to flag
  1624.  
  1625.             if flag begin
  1626.                 send reset
  1627.                 send request_cancel to (list(obj))
  1628.             end
  1629.         end_procedure
  1630.  
  1631.         procedure reset
  1632.             local integer obj
  1633.  
  1634.             set value item 0 to "Subjects" // title
  1635.  
  1636.             set shadow_prompt_state of (buttons(current_object)) to false
  1637.  
  1638.             move (list(current_object)) to obj
  1639.  
  1640.             set export_server   of obj to sbj_data.obj
  1641.             set main_file       of obj to sbj.file_number
  1642.             set ordering        of obj to index.1
  1643.             set server          of obj to sbj_prompt_data.obj
  1644.             send scan_servers   to obj
  1645.  
  1646.             set constrain_to_grp of xrf_prompt_data to false
  1647.         end_procedure
  1648.  
  1649.         procedure quit_help_maint
  1650.             local integer obj
  1651.  
  1652.             send request_cancel_area
  1653.             get focus of desktop to obj
  1654.             send exit_application to obj
  1655.         end_procedure
  1656.     end_object // sbj_prompt
  1657.  
  1658.     procedure show_current_file integer hfil string hname
  1659.         local integer obj
  1660.  
  1661.         move (status_bar(current_object)) to obj
  1662.         if hfil eq grp.file_number set value of obj item 0 to hname
  1663.         if hfil eq sbj.file_number set value of obj item 1 to hname
  1664.         if hfil eq xrf.file_number set value of obj item 2 to hname
  1665.         if hfil eq ctx.file_number set value of obj item 3 to hname
  1666.         if hfil eq 0 set value of obj item 4 to hname // pathname
  1667.     end_procedure
  1668.  
  1669.     procedure no_filenames
  1670.         local integer obj
  1671.  
  1672.         move (status_bar(current_object)) to obj
  1673.         set value of obj item 0 to NONE_STRING
  1674.         set value of obj item 1 to EMPTY_STRING
  1675.         set value of obj item 2 to EMPTY_STRING
  1676.         set value of obj item 3 to EMPTY_STRING
  1677.         set value of obj item 4 to NONE_STRING
  1678.     end_procedure
  1679.  
  1680.     procedure save_main_buffers
  1681.         set current_grp_record to grp.recnum
  1682.         set current_sbj_record to sbj.recnum
  1683.         set current_xrf_record to xrf.recnum
  1684.     end_procedure
  1685.     
  1686.     procedure reset_main_buffers
  1687.         clear grp
  1688.         get current_grp_record to grp.recnum
  1689.         if grp.recnum ne 0 begin
  1690.             find eq grp.recnum
  1691.             [not found] send clear to grp_data
  1692.         end
  1693.  
  1694.         clear sbj
  1695.         get current_sbj_record to sbj.recnum
  1696.         if sbj.recnum ne 0 begin
  1697.             find eq sbj.recnum
  1698.             [not found] send clear to sbj_data
  1699.         end
  1700.  
  1701.         clear xrf
  1702.         get current_xrf_record to xrf.recnum
  1703.         if xrf.recnum ne 0 begin
  1704.           find eq xrf.recnum
  1705.           [not found] send clear to xrf_data
  1706.         end
  1707.     end_procedure
  1708.  
  1709.     procedure new_help_files
  1710.         local integer obj
  1711.  
  1712.         get cb_return_value to current_grp
  1713.         get cb_return_value to current_sbj
  1714.         get cb_return_value to current_xrf
  1715.         get cb_return_value to current_ctx
  1716.         get cb_return_value to current_pth
  1717.         if current_pth eq EMPTY_REPL_STRING move EMPTY_STRING to current_pth
  1718.  
  1719.         send show_current_file grp.file_number current_grp
  1720.         send show_current_file sbj.file_number current_sbj
  1721.         send show_current_file xrf.file_number current_xrf
  1722.         send show_current_file ctx.file_number current_ctx
  1723.         send show_current_file 0 current_pth
  1724.     end_procedure
  1725.     
  1726.     function call_sub_help string prog_name string opt integer ret_files_state ;
  1727.             returns string
  1728.         local string reply curgrp cursbj curxrf curctx curpth ch_str
  1729.  
  1730.         trim current_grp to curgrp
  1731.         if curgrp le EMPTY_STRING move EMPTY_REPL_STRING to curgrp
  1732.         trim current_sbj to cursbj
  1733.         if cursbj le EMPTY_STRING move EMPTY_REPL_STRING to cursbj
  1734.         trim current_xrf to curxrf
  1735.         if curxrf le EMPTY_STRING move EMPTY_REPL_STRING to curxrf
  1736.         trim current_ctx to curctx
  1737.         if curctx le EMPTY_STRING move EMPTY_REPL_STRING to curctx
  1738.         trim current_pth to curpth
  1739.         if curpth le EMPTY_STRING move EMPTY_REPL_STRING to curpth
  1740.  
  1741.         move prog_name to ch_str
  1742.         append ch_str SPACE_STRING opt    SPACE_STRING curgrp SPACE_STRING cursbj
  1743.         append ch_str SPACE_STRING curxrf SPACE_STRING curctx SPACE_STRING curpth
  1744.  
  1745.         chain wait ch_str export_files
  1746.         send refresh_screen to desktop // in case screen was corrupted
  1747.  
  1748.         get cb_return_value to reply
  1749.         if reply eq SUCCESS_REPLY if ret_files_state send new_help_files
  1750.  
  1751.         function_return reply
  1752.     end_function
  1753.  
  1754.     procedure new
  1755.         local string reply
  1756.  
  1757.         get call_sub_help SECONDARY_DFHELP_PROGRAM_A NEW_FILE_OPTION true to reply
  1758.         if reply eq ABORT_REPLY send exit_application
  1759.         else if reply eq SUCCESS_REPLY begin
  1760.             send request_clear_all to (help_editor(current_object))
  1761.             send edit_help_data
  1762.         end
  1763.     end_procedure
  1764.  
  1765.     procedure open
  1766.         local string reply
  1767.  
  1768.         get call_sub_help SECONDARY_DFHELP_PROGRAM_A OPEN_FILE_OPTION true to reply
  1769.         if reply eq ABORT_REPLY send exit_application
  1770.         else if reply eq SUCCESS_REPLY begin
  1771.             send request_clear_all to (help_editor(current_object))
  1772.             send edit_help_data
  1773.         end
  1774.     end_procedure
  1775.  
  1776.     procedure exit_program returns integer
  1777.         send deactivate
  1778.         procedure_return 1
  1779.     end_procedure
  1780.  
  1781.     procedure group
  1782.         local string reply
  1783.  
  1784.         send save_main_buffers
  1785.         get call_sub_help SECONDARY_DFHELP_PROGRAM_B GRP_MAINT_OPTION false to reply
  1786.         send reset_main_buffers
  1787.     end_procedure
  1788.  
  1789.     procedure subject
  1790.         local string reply
  1791.  
  1792.         send save_main_buffers
  1793.         get call_sub_help SECONDARY_DFHELP_PROGRAM_B SBJ_MAINT_OPTION false to reply
  1794.         send reset_main_buffers
  1795.     end_procedure
  1796.  
  1797.     procedure cross_reference
  1798.         local string reply
  1799.  
  1800.         send save_main_buffers
  1801.         get call_sub_help SECONDARY_DFHELP_PROGRAM_B XRF_MAINT_OPTION false to reply
  1802.         send reset_main_buffers
  1803.     end_procedure
  1804.  
  1805.     procedure context
  1806.         local string reply
  1807.  
  1808.         send save_main_buffers
  1809.         get call_sub_help SECONDARY_DFHELP_PROGRAM_C CTX_MAINT_OPTION false to reply
  1810.         if reply eq ABORT_REPLY send exit_application
  1811.         else send reset_main_buffers
  1812.     end_procedure
  1813.  
  1814.     procedure cleanup
  1815.         local string reply
  1816.  
  1817.         send save_main_buffers
  1818.         get call_sub_help SECONDARY_DFHELP_PROGRAM_C CLN_MAINT_OPTION false to reply
  1819.         if reply eq ABORT_REPLY send exit_application
  1820.         else send reset_main_buffers
  1821.     end_procedure
  1822.  
  1823.     procedure import
  1824.         local string reply
  1825.  
  1826.         send save_main_buffers
  1827.         get call_sub_help SECONDARY_DFHELP_PROGRAM_A IMP_MAINT_OPTION false to reply
  1828.         if reply eq ABORT_REPLY send exit_application
  1829.         else send reset_main_buffers
  1830.     end_procedure
  1831.  
  1832.     procedure erase_data
  1833.         local string reply
  1834.  
  1835.         get call_sub_help SECONDARY_DFHELP_PROGRAM_A ERS_MAINT_OPTION false to reply
  1836.         if reply eq ABORT_REPLY send exit_application
  1837.         else if reply eq SUCCESS_REPLY send request_clear_all to (help_editor(current_object))
  1838.     end_procedure
  1839.  
  1840.     procedure reorder_data
  1841.         local string reply
  1842.  
  1843.         get call_sub_help SECONDARY_DFHELP_PROGRAM_C REORD_MAINT_OPTION false to reply
  1844.         if reply eq ABORT_REPLY send exit_application
  1845.         else if reply eq SUCCESS_REPLY send request_clear_all to (help_editor(current_object))
  1846.     end_procedure
  1847.  
  1848.     procedure edit_help_data
  1849.         local integer obj flag
  1850.  
  1851.         move (help_editor(current_object)) to obj
  1852.         get active_state of obj to flag
  1853.         if not flag send popup to obj
  1854.         broadcast recursive send rebuild_constraints to xrf_data
  1855.     end_procedure
  1856.  
  1857.     function verify_delete_xrf string filename string related returns integer
  1858.         local string txt
  1859.         local integer result obj tobj
  1860.  
  1861.         move (verify_del(current_object)) to obj
  1862.         move (text(obj)) to tobj
  1863.  
  1864.         move 'Delete the ' to txt
  1865.         append txt filename ' record and ' related ' records that relate to it?'
  1866.         send delete_data to tobj
  1867.         send insert to tobj txt
  1868.  
  1869.         ui_accept obj to result
  1870.  
  1871.         if result eq msg_ok function_return 0
  1872.         else function_return 1
  1873.         // ret_val: 0 means delete, 1 means cancel
  1874.     end_function
  1875.  
  1876.     send no_filenames // initialize status_bar
  1877. end_object // main
  1878.  
  1879. /about_img
  1880. ╔════════════════════════════════════════╗
  1881. ║                                        ║
  1882. ║________________________________________║
  1883. ║                                        ║
  1884. ║             Version 1.0b               ║
  1885. ║                                        ║
  1886. ║  Copyright 1987-1992 Data Access Corp  ║
  1887. ║  Miami FL, USA - All rights reserved   ║
  1888. ║                                        ║
  1889. ║        Memory: __________ bytes        ║
  1890. ║                                        ║
  1891. ║           ____        ______           ║
  1892. ║                                        ║
  1893. ╚════════════════════════════════════════╝
  1894. /*
  1895. //          <OK>        <Help>
  1896.  
  1897. sub_page about_btn_img from about_img 3 4
  1898.  
  1899. object about is a client about_img
  1900.     set block_mouse_state to true
  1901.     set location          to 6 20 relative
  1902.     set popup_state       to true
  1903.     set scope_state       to true
  1904.  
  1905.     set center_state item 0 to true
  1906.     set value item 0 to "DataFlex Help Maintenance Utility"
  1907.  
  1908.     object buttons is a button about_btn_img
  1909.         item_list
  1910.             on_item "<OK>"   send deactivate to (parent(current_object))
  1911.             on_item "<Help>" send help
  1912.         end_item_list
  1913.     end_object
  1914. end_object
  1915.  
  1916. procedure about for desktop
  1917.     local integer mem
  1918.  
  1919.     memory mem
  1920.     set value of about item 1 to mem
  1921.     send popup to about
  1922. end_procedure
  1923.  
  1924. procedure open_on_cmd_arg for desktop
  1925.     local string prfx cb_reply ch_str
  1926.  
  1927.     cmdline prfx
  1928.     if prfx gt EMPTY_STRING begin
  1929.         uppercase prfx
  1930.  
  1931.         fix_up
  1932.  
  1933.         move SECONDARY_DFHELP_PROGRAM_A to ch_str
  1934.         append ch_str SPACE_STRING PATH_OPTION SPACE_STRING prfx
  1935.         trim ch_str to ch_str
  1936.  
  1937.         chain wait ch_str export_files
  1938.         send refresh_screen to desktop // in case screen was corrupted
  1939.  
  1940.         get cb_return_value to cb_reply
  1941.         if cb_reply eq ABORT_REPLY send exit_application
  1942.         else if cb_reply eq SUCCESS_REPLY begin
  1943.             send new_help_files to main
  1944.             send request_clear_all to (help_editor(main.obj))
  1945.             send edit_help_data to main
  1946.         end
  1947.     end
  1948. end_procedure
  1949.  
  1950. //////////////////////////////////
  1951. ////////////////////////////////// main logic
  1952. //////////////////////////////////
  1953.  
  1954. send add_focus to title desktop
  1955. send activate to main
  1956.  
  1957. send open_on_cmd_arg // use optional path/file_prefix passed on cmd line
  1958.  
  1959. start_ui
  1960.  
  1961. abort
  1962.