home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / wp_dtp / xdme1821.lha / XDME / menucom.c < prev    next >
C/C++ Source or Header  |  1993-02-05  |  22KB  |  1,280 lines

  1. /******************************************************************************
  2.  
  3.     MODUL
  4.     menucom.c
  5.  
  6.     DESCRIPTION
  7.     [X]DME command interface for menubase.c
  8.  
  9.     NOTES
  10.     experimental status
  11.  
  12.     in zukunft koennte es moeglich sein,
  13.     einen einzien namensprameter zu akzeptieren,
  14.     der dann ueber split_menu_names in seine
  15.     komponenten aufgespalten wuerde
  16.  
  17.     BUGS
  18.     IMPORTANT
  19.         we cannot actually react on ERRORs !!
  20.  
  21.     TODO
  22.     include some error()-calls
  23.     support checks
  24.  
  25.     EXAMPLES
  26.  
  27.     description of the user-commands:
  28.  
  29.     the commands below might get other names;
  30.     if so, please update their descriptions according
  31.     to the names they are used in command.c
  32.  
  33. *!  MENUES:
  34. *!  ******
  35. *!
  36. *!  the following commands allow access to [X]DME's menustructures
  37. *!  that way it is possible for each user to create an individual
  38. *!  GUI for "his" [X]DME, for "his" programming language and for
  39. *!  his wishes.
  40. *!
  41. *! >MENUDELHDR menuname
  42. *!
  43. *!    delete a menuheader and all associated items (and subitems)
  44. *!
  45. *!    menuheaders are created by using their names in item or
  46. *!    subitem definitions
  47. *!
  48. *! >MENUDEL    menuname itemname
  49. *! >MENUDELBAR menuname
  50. *!
  51. *!    delete a menuitem-entry
  52. *!    DELBAR deletes the first itembar in a menu's itemlist
  53. *!    DEL deletes the menuitem with the name itemname
  54. *!        if itemname is a subitem-carrier, all subs are deleted, too
  55. *!
  56. *!    You can delete all items of a menu, if You call MENUDELHDR
  57. *!
  58. *! >MENUDELSUB      menuname itemname subname
  59. *! >MENUDELSUBBAR menuname itemname
  60. *!
  61. *!    delete a submenu-entry
  62. *!    DELSUBBAR deletes the first submenubar in a menuitem's subitemlist
  63. *!    DELSUB deletes the submenu with the name subname
  64. *!
  65. *!    You can delete all an item's subitem if You MENUDEL the carrying item
  66. *!
  67. *! >MENUADD   menuname itemname subname command
  68. *! >MENUBAR   menuname itemname
  69. *! >MENUCHECK menuname itemname subname command
  70. *!
  71. *!    create a menuitem-entry
  72. *!    BAR simply appends an itembar to the item-list
  73. *!    ADD creates a full menuitem-entry, if not already one
  74. *!        of the same name exists
  75. *!    CHECK also sets the menutoggle flag to an entry created
  76. *!        like ADD
  77. *!
  78. *!    You cannot add subitems to items that were created with
  79. *!        MENUADD or MENUCHECK as these have commands added
  80. *!        while we expect subitem carrier to have no command added
  81. *!    You cannot redefine the type of an menuitem once created
  82. *!        normal items can't be redefined to checkitems
  83. *!        or subitem carriers and vice versa
  84. *!
  85. *! >MENUSUBADD     menuname itemname subname command
  86. *! >MENUSUBBAR     menuname itemname
  87. *! >MENUSUBCHECK menuname itemname subname command
  88. *!
  89. *!    create a submenu-entry
  90. *!    SUBBAR simply appends an itembar to the subitem-list
  91. *!    SUBADD creates a full subitem-entry, if not already one
  92. *!        of the same name exists
  93. *!    SUBCHECK also sets the menutoggle flag to an entry created
  94. *!        like SUBADD
  95. *!
  96. *!    You cannot add subitems to items that were created with
  97. *!        MENUADD or MENUCHECK as these are managed in a quite
  98. *!        different way, so You create subitem-carrier simply by
  99. *!        using their names in a subitem definition
  100. *!    You cannot redefine the type of an subitem once created
  101. *!        normal subs can't be redefined to subcheck and vice versa
  102. *!
  103. *! >MENUSETITEM menuname itemname      status
  104. *! >MENUSETSUB    menuname itemname subname status
  105. *! >MENUCHKITEM menuname itemname      variablename
  106. *! >MENUCHKSUB    menuname itemname subname variablename
  107. *!
  108. *!    these commands set or check the satus of the (/sub)item-checked
  109. *!    flags for (sub)items created with the MENU(SUB)CHECK commands
  110. *!    status is one of 0|1 the value set into variable is also 0|1
  111. *!
  112. *! >MENUCLEAR
  113. *!
  114. *!    clean up the menustrip, i.e. delete all of its
  115. *!    menuheaders
  116. *!
  117. *! >MENUSAVE filename
  118. *!
  119. *!    save the menustrip as a file that can be
  120. *!    read by MENULOAD
  121. *!
  122. *! >MENULOAD filename
  123. *!
  124. *!    clear the menustrip and instead build a new
  125. *!    contents out of the file filename
  126. *!
  127. *! >MENUON
  128. *! >MENUOFF
  129. *!
  130. *!    show or hide the whole menustrip
  131. *!    MENUOFF is stackable, i.e You need as many MENUON calls
  132. *!    to show the menustrip as previously MENUOFF calls
  133. *!
  134. *!
  135. *!  MENUSTRIPS:
  136. *!  **********
  137. *!
  138. *!  the following commands do only make sense, if
  139. *!  You are using multiple menustrips
  140. *!  at [X]DME's start a menustrip called "default" is created;
  141. *!  for "normal" usage, that single strip may suffer.
  142. *!
  143. *!  Please note that the above MENU... commands apply to the
  144. *!  CURRENT menustrip (and only to it)
  145. *!
  146. *! >USEMENUSTRIP name
  147. *!
  148. *!    search for a certain menustrip and use it as the current one
  149. *!
  150. *! >REMMENUSTRIP
  151. *!
  152. *!    delete the current menustrip, if it is not the only one
  153. *!
  154. *! >NEWMENUSTRIP name
  155. *!
  156. *!    if there is already a menustrip called name,
  157. *!        simply call USEMENUSTRIP name
  158. *!    else create a new menustrip called name and use it
  159. *!
  160.  
  161.     SEE ALSO
  162.     menustrips.c menu_dme.c menucontrol.c command.c
  163.  
  164.  
  165.     INDEX
  166.     $Header : $
  167.  
  168.     HISTORY
  169.     18 Dec 1992 b_null created
  170.     20 Dec 1992 b_null rewritten & documented
  171.     23 Jan 1993 b_null added menutomacro
  172.     25 Jan 1993 b_null added do_delmenu, do_itemcheck, do_subcheck
  173.  
  174. ******************************************************************************/
  175.  
  176. /**************************************
  177.         Includes
  178. **************************************/
  179. #include "defs.h"
  180. #include "menubase.h"
  181.  
  182.  
  183. /**************************************
  184.         Globale Variable
  185. **************************************/
  186. /* menu(item)management */
  187. Prototype void do_delmenu   (void);
  188. Prototype void do_delitem   (void);
  189. Prototype void do_delitembar(void);
  190. Prototype void do_delsub    (void);
  191. Prototype void do_delsubbar (void);
  192. Prototype void do_itembar   (void);
  193. Prototype void do_itemcheck (void);
  194. Prototype void do_itemadd   (void);
  195. Prototype void do_subadd    (void);
  196. Prototype void do_subcheck  (void);
  197. Prototype void do_subbar    (void);
  198. Prototype void do_menuoff   (void);
  199. Prototype void do_menuon    (void);
  200. Prototype void do_menuload  (void);
  201. Prototype void do_menusave  (void);
  202. Prototype char*menutomacro  (char*);
  203. Prototype void do_menuclear (void);
  204.  
  205. /* modification on checks */
  206. Prototype void do_getcheckitem (void);
  207. Prototype void do_getchecksub  (void);
  208. Prototype void do_setcheckitem (void);
  209. Prototype void do_setchecksub  (void);
  210.  
  211. /* management for menustrips */
  212. Prototype void do_new_menustrip (void);
  213. Prototype void do_del_menustrip (void);
  214. Prototype void do_use_menustrip (void);
  215.  
  216.  
  217. /**************************************
  218.       Interne Defines & Strukturen
  219. **************************************/
  220.  
  221.  
  222. /**************************************
  223.         Interne Variable
  224. **************************************/
  225.  
  226.  
  227. /**************************************
  228.        Interne Prototypes
  229. **************************************/
  230.  
  231.  
  232.  
  233. /*****************************************************************************
  234.  
  235.     NAME
  236.     do_delmenu
  237.  
  238.     PARAMETER
  239.     void
  240.  
  241.     RESULT
  242.     -/-
  243.  
  244.     RETURN
  245.     void
  246.  
  247.     DESCRIPTION
  248.     [X]DME command interface for
  249.  
  250.     NOTES
  251.  
  252.     BUGS
  253.  
  254.     EXAMPLES
  255.  
  256.     SEE ALSO
  257.  
  258.     INTERNALS
  259.  
  260.     HISTORY
  261.     25 Jan 1993 b_noll created
  262.  
  263. ******************************************************************************/
  264.  
  265. void do_delmenu (void)
  266. {
  267.     menuoff (currentmenu(), currentwindow());
  268.     menudel (currentmenu(), GetArg(1));
  269.     menuon  (currentmenu(), currentwindow());
  270. } /* do_delmenu */
  271.  
  272.  
  273.  
  274. /*****************************************************************************
  275.  
  276.     NAME
  277.     do_itemadd
  278.  
  279.     PARAMETER
  280.     void
  281.  
  282.     RESULT
  283.     -/-
  284.  
  285.     RETURN
  286.     void
  287.  
  288.     DESCRIPTION
  289.     [X]DME command interface for
  290.  
  291.     NOTES
  292.  
  293.     BUGS
  294.  
  295.     EXAMPLES
  296.  
  297.     SEE ALSO
  298.  
  299.     INTERNALS
  300.  
  301.     HISTORY
  302.     20 Dec 1992 b_noll created
  303.  
  304. ******************************************************************************/
  305.  
  306. void do_itemadd (void)
  307. {
  308.     menuoff (currentmenu(), currentwindow());
  309.     itemadd (currentmenu(), GetArg(1), GetArg(2), GetArg(3), NULL, 0);
  310.     menuon  (currentmenu(), currentwindow());
  311. } /* do_itemadd */
  312.  
  313.  
  314.  
  315. /*****************************************************************************
  316.  
  317.     NAME
  318.     do_itemcheck
  319.  
  320.     PARAMETER
  321.     void
  322.  
  323.     RESULT
  324.     -/-
  325.  
  326.     RETURN
  327.     void
  328.  
  329.     DESCRIPTION
  330.     [X]DME command interface for
  331.  
  332.     NOTES
  333.  
  334.     BUGS
  335.  
  336.     EXAMPLES
  337.  
  338.     SEE ALSO
  339.  
  340.     INTERNALS
  341.  
  342.     HISTORY
  343.     25 Jan 1993 b_noll created
  344.  
  345. ******************************************************************************/
  346.  
  347. void do_itemcheck (void)
  348. {
  349.     menuoff (currentmenu(), currentwindow());
  350.     itemadd (currentmenu(), GetArg(1), GetArg(2), GetArg(3), NULL, 1);
  351.     menuon  (currentmenu(), currentwindow());
  352. } /* do_itemcheck */
  353.  
  354.  
  355.  
  356. /*****************************************************************************
  357.  
  358.     NAME
  359.     do_itembar
  360.  
  361.     PARAMETER
  362.     void
  363.  
  364.     RESULT
  365.     -/-
  366.  
  367.     RETURN
  368.     void
  369.  
  370.     DESCRIPTION
  371.     [X]DME command interface for
  372.  
  373.     NOTES
  374.  
  375.     BUGS
  376.  
  377.     EXAMPLES
  378.  
  379.     SEE ALSO
  380.  
  381.     INTERNALS
  382.  
  383.     HISTORY
  384.     20 Dec 1992 b_noll created
  385.  
  386. ******************************************************************************/
  387.  
  388. void do_itembar (void)
  389. {
  390.     menuoff (currentmenu(), currentwindow());
  391.     itemadd (currentmenu(), GetArg(1), BAR, NULL, NULL, 0);
  392.     menuon  (currentmenu(), currentwindow());
  393. } /* do_itembar */
  394.  
  395.  
  396.  
  397. /*****************************************************************************
  398.  
  399.     NAME
  400.     do_subadd
  401.  
  402.     PARAMETER
  403.     void
  404.  
  405.     RESULT
  406.     -/-
  407.  
  408.     RETURN
  409.     void
  410.  
  411.     DESCRIPTION
  412.     [X]DME command interface for
  413.  
  414.     NOTES
  415.  
  416.     BUGS
  417.  
  418.     EXAMPLES
  419.  
  420.     SEE ALSO
  421.  
  422.     INTERNALS
  423.  
  424.     HISTORY
  425.     20 Dec 1992 b_noll created
  426.  
  427. ******************************************************************************/
  428.  
  429. void do_subadd (void)
  430. {
  431.     menuoff (currentmenu(), currentwindow());
  432.     subadd  (currentmenu(), GetArg(1), GetArg(2), GetArg(3), GetArg(4), NULL, 0);
  433.     menuon  (currentmenu(), currentwindow());
  434. } /* do_subadd */
  435.  
  436.  
  437.  
  438. /*****************************************************************************
  439.  
  440.     NAME
  441.     do_subcheck
  442.  
  443.     PARAMETER
  444.     void
  445.  
  446.     RESULT
  447.     -/-
  448.  
  449.     RETURN
  450.     void
  451.  
  452.     DESCRIPTION
  453.     [X]DME command interface for
  454.  
  455.     NOTES
  456.  
  457.     BUGS
  458.  
  459.     EXAMPLES
  460.  
  461.     SEE ALSO
  462.  
  463.     INTERNALS
  464.  
  465.     HISTORY
  466.     25 Jan 1993 b_noll created
  467.  
  468. ******************************************************************************/
  469.  
  470. void do_subcheck (void)
  471. {
  472.     menuoff (currentmenu(), currentwindow());
  473.     subadd  (currentmenu(), GetArg(1), GetArg(2), GetArg(3), GetArg(4), NULL, 1);
  474.     menuon  (currentmenu(), currentwindow());
  475. } /* do_subcheck */
  476.  
  477.  
  478.  
  479. /*****************************************************************************
  480.  
  481.     NAME
  482.     do_subbar
  483.  
  484.     PARAMETER
  485.     void
  486.  
  487.     RESULT
  488.     -/-
  489.  
  490.     RETURN
  491.     void
  492.  
  493.     DESCRIPTION
  494.     [X]DME command interface for
  495.  
  496.     NOTES
  497.  
  498.     BUGS
  499.  
  500.     EXAMPLES
  501.  
  502.     SEE ALSO
  503.  
  504.     INTERNALS
  505.  
  506.     HISTORY
  507.     20 Dec 1992 b_noll created
  508.  
  509. ******************************************************************************/
  510.  
  511. void do_subbar (void)
  512. {
  513.     menuoff (currentmenu(), currentwindow());
  514.     subadd  (currentmenu(), GetArg(1), GetArg(2), BAR, NULL, NULL, 0);
  515.     menuon  (currentmenu(), currentwindow());
  516. } /* do_subbar */
  517.  
  518.  
  519.  
  520. /*****************************************************************************
  521.  
  522.     NAME
  523.     do_delitem
  524.  
  525.     PARAMETER
  526.     void
  527.  
  528.     RESULT
  529.     -/-
  530.  
  531.     RETURN
  532.     void
  533.  
  534.     DESCRIPTION
  535.     [X]DME command interface for
  536.  
  537.     NOTES
  538.  
  539.     BUGS
  540.  
  541.     EXAMPLES
  542.  
  543.     SEE ALSO
  544.  
  545.     INTERNALS
  546.  
  547.     HISTORY
  548.     20 Dec 1992 b_noll created
  549.  
  550. ******************************************************************************/
  551.  
  552. void do_delitem (void)
  553. {
  554.     menuoff (currentmenu(), currentwindow());
  555.     itemdel (currentmenu(), GetArg(1), GetArg(2));
  556.     menuon  (currentmenu(), currentwindow());
  557. } /* do_delitem */
  558.  
  559.  
  560.  
  561. /*****************************************************************************
  562.  
  563.     NAME
  564.     do_delitembar
  565.  
  566.     PARAMETER
  567.     void
  568.  
  569.     RESULT
  570.     -/-
  571.  
  572.     RETURN
  573.     void
  574.  
  575.     DESCRIPTION
  576.     [X]DME command interface for
  577.  
  578.     NOTES
  579.  
  580.     BUGS
  581.  
  582.     EXAMPLES
  583.  
  584.     SEE ALSO
  585.  
  586.     INTERNALS
  587.  
  588.     HISTORY
  589.     22 Dec 1992 b_noll created
  590.  
  591. ******************************************************************************/
  592.  
  593. void do_delitembar (void)
  594. {
  595.     menuoff (currentmenu(), currentwindow());
  596.     itemdel (currentmenu(), GetArg(1), BAR);
  597.     menuon  (currentmenu(), currentwindow());
  598. } /* do_delitembar */
  599.  
  600.  
  601.  
  602. /*****************************************************************************
  603.  
  604.     NAME
  605.     do_delsub
  606.  
  607.     PARAMETER
  608.     void
  609.  
  610.     RESULT
  611.     -/-
  612.  
  613.     RETURN
  614.     void
  615.  
  616.     DESCRIPTION
  617.     [X]DME command interface for
  618.  
  619.     NOTES
  620.  
  621.     BUGS
  622.  
  623.     EXAMPLES
  624.  
  625.     SEE ALSO
  626.  
  627.     INTERNALS
  628.  
  629.     HISTORY
  630.     20 Dec 1992 b_noll created
  631.  
  632. ******************************************************************************/
  633.  
  634. void do_delsub (void)
  635. {
  636.     menuoff (currentmenu(), currentwindow());
  637.     subdel  (currentmenu(), GetArg(1), GetArg(2),GetArg(3));
  638.     menuon  (currentmenu(), currentwindow());
  639. } /* do_del */
  640.  
  641.  
  642.  
  643. /*****************************************************************************
  644.  
  645.     NAME
  646.     do_delsubbar
  647.  
  648.     PARAMETER
  649.     void
  650.  
  651.     RESULT
  652.     -/-
  653.  
  654.     RETURN
  655.     void
  656.  
  657.     DESCRIPTION
  658.     [X]DME command interface for
  659.  
  660.     NOTES
  661.  
  662.     BUGS
  663.  
  664.     EXAMPLES
  665.  
  666.     SEE ALSO
  667.  
  668.     INTERNALS
  669.  
  670.     HISTORY
  671.     22 Dec 1992 b_noll created
  672.  
  673. ******************************************************************************/
  674.  
  675. void do_delsubbar (void)
  676. {
  677.     menuoff (currentmenu(), currentwindow());
  678.     subdel  (currentmenu(), GetArg(1), GetArg(2), BAR);
  679.     menuon  (currentmenu(), currentwindow());
  680. } /* do_delsubbar */
  681.  
  682.  
  683.  
  684. /*****************************************************************************
  685.  
  686.     NAME
  687.     do_menuclear
  688.  
  689.     PARAMETER
  690.     void
  691.  
  692.     RESULT
  693.     -/-
  694.  
  695.     RETURN
  696.     void
  697.  
  698.     DESCRIPTION
  699.     [X]DME command interface for
  700.  
  701.     NOTES
  702.  
  703.     BUGS
  704.  
  705.     EXAMPLES
  706.  
  707.     SEE ALSO
  708.  
  709.     INTERNALS
  710.  
  711.     HISTORY
  712.     20 Dec 1992 b_noll created
  713.  
  714. ******************************************************************************/
  715.  
  716. void do_menuclear (void)
  717. {
  718.     menuoff   (currentmenu(), currentwindow());
  719.     menuclear (currentmenu());
  720.     menuon    (currentmenu(), currentwindow());
  721. } /* do_menuclear */
  722.  
  723.  
  724.  
  725. /*****************************************************************************
  726.  
  727.     NAME
  728.     do_menuon
  729.  
  730.     PARAMETER
  731.     void
  732.  
  733.     RESULT
  734.     -/-
  735.  
  736.     RETURN
  737.     void
  738.  
  739.     DESCRIPTION
  740.     [X]DME command interface for
  741.  
  742.     NOTES
  743.  
  744.     BUGS
  745.  
  746.     EXAMPLES
  747.  
  748.     SEE ALSO
  749.  
  750.     INTERNALS
  751.  
  752.     HISTORY
  753.     20 Dec 1992 b_noll created
  754.  
  755. ******************************************************************************/
  756.  
  757. void do_menuon (void)
  758. {
  759.     menuon (currentmenu(), currentwindow());
  760. } /* do_menuon */
  761.  
  762.  
  763.  
  764. /*****************************************************************************
  765.  
  766.     NAME
  767.     do_menuoff
  768.  
  769.     PARAMETER
  770.     void
  771.  
  772.     RESULT
  773.     -/-
  774.  
  775.     RETURN
  776.     void
  777.  
  778.     DESCRIPTION
  779.     [X]DME command interface for
  780.  
  781.     NOTES
  782.  
  783.     BUGS
  784.  
  785.     EXAMPLES
  786.  
  787.     SEE ALSO
  788.  
  789.     INTERNALS
  790.  
  791.     HISTORY
  792.     20 Dec 1992 b_noll created
  793.  
  794. ******************************************************************************/
  795.  
  796. void do_menuoff (void)
  797. {
  798.     menuoff (currentmenu(), currentwindow());
  799. } /* do_menuoff */
  800.  
  801.  
  802.  
  803. /*****************************************************************************
  804.  
  805.     NAME
  806.     do_menusave
  807.  
  808.     PARAMETER
  809.     void
  810.  
  811.     RESULT
  812.     -/-
  813.  
  814.     RETURN
  815.     void
  816.  
  817.     DESCRIPTION
  818.     [X]DME command interface for
  819.  
  820.     NOTES
  821.  
  822.     BUGS
  823.  
  824.     EXAMPLES
  825.  
  826.     SEE ALSO
  827.  
  828.     INTERNALS
  829.  
  830.     HISTORY
  831.     20 Dec 1992 b_noll created
  832.  
  833. ******************************************************************************/
  834.  
  835. void do_menusave (void)
  836. {
  837.     menuoff   (currentmenu(), currentwindow());
  838.     menusave  (currentmenu(), GetArg(1));
  839.     menuon    (currentmenu(), currentwindow());
  840. } /* do_menusave */
  841.  
  842.  
  843.  
  844. /*****************************************************************************
  845.  
  846.     NAME
  847.     do_menuload
  848.  
  849.     PARAMETER
  850.     void
  851.  
  852.     RESULT
  853.     -/-
  854.  
  855.     RETURN
  856.     void
  857.  
  858.     DESCRIPTION
  859.     [X]DME command interface for
  860.  
  861.     NOTES
  862.  
  863.     BUGS
  864.  
  865.     EXAMPLES
  866.  
  867.     SEE ALSO
  868.  
  869.     INTERNALS
  870.  
  871.     HISTORY
  872.     20 Dec 1992 b_noll created
  873.  
  874. ******************************************************************************/
  875.  
  876. void do_menuload (void)
  877. {
  878.     menuoff   (currentmenu(), currentwindow());
  879.     menuload  (currentmenu(), GetArg(1));
  880.     menuon    (currentmenu(), currentwindow());
  881. } /* do_menuload */
  882.  
  883.  
  884.  
  885. /*****************************************************************************
  886.  
  887.     NAME
  888.     do_menutomacro
  889.  
  890.     PARAMETER
  891.     char * str
  892.  
  893.     RESULT
  894.     the command that is attached to the menu referred with str
  895.  
  896.     RETURN
  897.     char *
  898.  
  899.     DESCRIPTION
  900.     [X]DME vars interface for menu2macro
  901.  
  902.     NOTES
  903.     that function was added 'cause in vars.c we use a
  904.     table of all search-functions, and all the others
  905.     do have only 1 argument
  906.  
  907.     BUGS
  908.     never tested
  909.  
  910.     EXAMPLES
  911.  
  912.     SEE ALSO
  913.  
  914.     INTERNALS
  915.  
  916.     HISTORY
  917.     22 Jan 1993 b_noll created
  918.  
  919. ******************************************************************************/
  920.  
  921. char * menutomacro (char * str)
  922. {
  923.     return (menu2macro (currentmenu(), str));
  924. } /* menutomacro */
  925.  
  926.  
  927.  
  928. /*****************************************************************************
  929.  
  930.     NAME
  931.     do_getcheckitem
  932.  
  933.     PARAMETER
  934.     void
  935.  
  936.     RESULT
  937.     -/-
  938.  
  939.     RETURN
  940.     void
  941.  
  942.     DESCRIPTION
  943.     [X]DME vars interface for
  944.  
  945.     NOTES
  946.  
  947.     BUGS
  948.     never tested
  949.  
  950.     EXAMPLES
  951.  
  952.     SEE ALSO
  953.  
  954.     INTERNALS
  955.  
  956.     HISTORY
  957.     25 Jan 1993 b_noll created
  958.  
  959. ******************************************************************************/
  960.  
  961. void do_getcheckitem (void)
  962. {
  963.     int  v;
  964.     char vv[2] = "0";
  965.  
  966.     v = chkitemcheck (currentmenu(), GetArg(1), GetArg(2));
  967.  
  968.     if (v >= 0) {
  969.     vv[0] = v+48;
  970.     SetTypedVar (GetArg(3), vv, VAR_GV);
  971.     } else {
  972.     error ("%s:\n no check item of that name:\n %s-%s", CommandName(), GetArg(1), GetArg(2));
  973.     } /* if */
  974. } /* do_getcheckitem */
  975.  
  976.  
  977.  
  978. /*****************************************************************************
  979.  
  980.     NAME
  981.     do_getchecksub
  982.  
  983.     PARAMETER
  984.     void
  985.  
  986.     RESULT
  987.     -/-
  988.  
  989.     RETURN
  990.     void
  991.  
  992.     DESCRIPTION
  993.     [X]DME vars interface for
  994.  
  995.     NOTES
  996.  
  997.     BUGS
  998.     never tested
  999.  
  1000.     EXAMPLES
  1001.  
  1002.     SEE ALSO
  1003.  
  1004.     INTERNALS
  1005.  
  1006.     HISTORY
  1007.     25 Jan 1993 b_noll created
  1008.  
  1009. ******************************************************************************/
  1010.  
  1011. void do_getchecksub (void)
  1012. {
  1013.     int  v;
  1014.     char vv[2] = "0";
  1015.  
  1016.     v = chksubcheck (currentmenu(), GetArg(1), GetArg(2), GetArg(3));
  1017.  
  1018.     if (v >= 0) {
  1019.     vv[0] = v+48;
  1020.     SetTypedVar (GetArg(4), vv, VAR_GV);
  1021.     } else {
  1022.     error ("%s:\n no check sub item of that name:\n %s-%s-%s", CommandName(), GetArg(1), GetArg(2), GetArg(3));
  1023.     } /* if */
  1024. } /* do_getchecksub */
  1025.  
  1026.  
  1027.  
  1028. /*****************************************************************************
  1029.  
  1030.     NAME
  1031.     do_setcheckitem
  1032.  
  1033.     PARAMETER
  1034.     void
  1035.  
  1036.     RESULT
  1037.     -/-
  1038.  
  1039.     RETURN
  1040.     void
  1041.  
  1042.     DESCRIPTION
  1043.     [X]DME vars interface for
  1044.  
  1045.     NOTES
  1046.  
  1047.     BUGS
  1048.     never tested
  1049.     toggle wont work
  1050.  
  1051.     EXAMPLES
  1052.  
  1053.     SEE ALSO
  1054.  
  1055.     INTERNALS
  1056.  
  1057.     HISTORY
  1058.     25 Jan 1993 b_noll created
  1059.  
  1060. ******************************************************************************/
  1061.  
  1062. void do_setcheckitem (void)
  1063. {
  1064.     int v;
  1065.     v = setitemcheck (currentmenu(), GetArg(1), GetArg(2), test_arg(GetArg(3),1));
  1066.     if (v == RET_FAIL) {
  1067.     error ("%s:\n no check item of that name:\n %s-%s", CommandName(), GetArg(1), GetArg(2));
  1068.     } else {
  1069.     menu_strip (currentmenu(), Ep->win);
  1070.     } /* if */
  1071. } /* do_setcheckitem */
  1072.  
  1073.  
  1074.  
  1075. /*****************************************************************************
  1076.  
  1077.     NAME
  1078.     do_setchecksub
  1079.  
  1080.     PARAMETER
  1081.     void
  1082.  
  1083.     RESULT
  1084.     -/-
  1085.  
  1086.     RETURN
  1087.     void
  1088.  
  1089.     DESCRIPTION
  1090.     [X]DME vars interface for
  1091.  
  1092.     NOTES
  1093.  
  1094.     BUGS
  1095.     never tested
  1096.     toggle wont work
  1097.  
  1098.     EXAMPLES
  1099.  
  1100.     SEE ALSO
  1101.  
  1102.     INTERNALS
  1103.  
  1104.     HISTORY
  1105.     25 Jan 1993 b_noll created
  1106.  
  1107. ******************************************************************************/
  1108.  
  1109. void do_setchecksub (void)
  1110. {
  1111.     int v;
  1112.     v = setsubcheck (currentmenu(), GetArg(1), GetArg(2), GetArg(3), test_arg(GetArg(4),1));
  1113.     if (v == RET_FAIL) {
  1114.     error ("%s:\n no check sub item of that name:\n %s-%s-%s", CommandName(), GetArg(1), GetArg(2), GetArg(3));
  1115.     } else {
  1116.     menu_strip (currentmenu(), Ep->win);
  1117.     } /* if */
  1118. } /* do_setchecksub */
  1119.  
  1120.  
  1121. /*****************************************************************************
  1122.  
  1123.     NAME
  1124.     do_new_menustrip
  1125.  
  1126.     PARAMETER
  1127.     void
  1128.  
  1129.     RESULT
  1130.     -/-
  1131.  
  1132.     RETURN
  1133.     void
  1134.  
  1135.     DESCRIPTION
  1136.     command interface for keyaddes/qualifier
  1137.  
  1138.     NOTES
  1139.     <never tested>
  1140.  
  1141.     BUGS
  1142.     <none known>
  1143.  
  1144.     EXAMPLES
  1145.  
  1146.     SEE ALSO
  1147.  
  1148.     INTERNALS
  1149.  
  1150.     HISTORY
  1151.     28 Jan 1993  b_null created
  1152.  
  1153. ******************************************************************************/
  1154.  
  1155. void do_new_menustrip (void)
  1156. {
  1157.     MENUSTRIP * ms = new_menustrip (GetArg(1), 1);
  1158.  
  1159.     if (ms) {
  1160.     /* menuoff (currentmenu(), Ep->win); */
  1161.     Ep->menustrip = ms;
  1162.     menu_strip (currentmenu(), Ep->win);
  1163.     /* menuon  (currentmenu(), Ep->win); */
  1164.     } /* if */
  1165. } /* do_new_menustrip */
  1166.  
  1167.  
  1168.  
  1169. /*****************************************************************************
  1170.  
  1171.     NAME
  1172.     do_del_menustrip
  1173.  
  1174.     PARAMETER
  1175.     void
  1176.  
  1177.     RESULT
  1178.     -/-
  1179.  
  1180.     RETURN
  1181.     void
  1182.  
  1183.     DESCRIPTION
  1184.     command interface for keyaddes/qualifier
  1185.  
  1186.     NOTES
  1187.     <never tested>
  1188.     that function is highly dangerous!
  1189.  
  1190.  
  1191.     BUGS
  1192.     <none known>
  1193.  
  1194.     EXAMPLES
  1195.  
  1196.     SEE ALSO
  1197.  
  1198.     INTERNALS
  1199.  
  1200.     HISTORY
  1201.     28 Jan 1993  b_null created
  1202.  
  1203. ******************************************************************************/
  1204.  
  1205. void do_del_menustrip (void)
  1206. {
  1207.     MENUSTRIP * ms = currentmenu ();
  1208.     MENUSTRIP * ns;
  1209.     ED          * ep;
  1210.  
  1211.     menuoff (ms, Ep->win);          /* remove all strips */
  1212.  
  1213.     delete_menustrip (ms, 0);
  1214.     ns = get_menustrip (NULL);
  1215.  
  1216.     for (ep = GetHead (&DBase); ep; ep = GetSucc (ep)) {
  1217.     if (ep->menustrip == ms) {
  1218.         ep->menustrip = NULL; /* ns */
  1219.     } /* if */
  1220.     } /* for */
  1221.  
  1222.     menuoff (ns, Ep->win);          /* this is def_too != 0 since */
  1223.     menuon  (ns, Ep->win);          /* ns == get_menustrip(NULL)  */
  1224. } /* do_del_menustrip */
  1225.  
  1226.  
  1227.  
  1228. /*****************************************************************************
  1229.  
  1230.     NAME
  1231.     do_use_menustrip
  1232.  
  1233.     PARAMETER
  1234.     void
  1235.  
  1236.     RESULT
  1237.     -/-
  1238.  
  1239.     RETURN
  1240.     void
  1241.  
  1242.     DESCRIPTION
  1243.     command interface for keyaddes/qualifier
  1244.  
  1245.     NOTES
  1246.     <never tested>
  1247.  
  1248.     BUGS
  1249.     <none known>
  1250.  
  1251.     EXAMPLES
  1252.  
  1253.     SEE ALSO
  1254.  
  1255.     INTERNALS
  1256.  
  1257.     HISTORY
  1258.     28 Jan 1993  b_null created
  1259.  
  1260. ******************************************************************************/
  1261.  
  1262. void do_use_menustrip (void)
  1263. {
  1264.     MENUSTRIP * ms = get_menustrip (GetArg (1));
  1265.  
  1266.     if (ms) {
  1267.     Ep->menustrip = ms;
  1268.     menu_strip (ms, Ep->win);
  1269.     } /* if */
  1270. } /* do_use_menustrip */
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277. /******************************************************************************
  1278. *****  ENDE menucom.c
  1279. ******************************************************************************/
  1280.