home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / diverses / him / mmdemo2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-12-01  |  17.6 KB  |  516 lines

  1. /***************** Program Source Module ***********************/
  2. #ifdef AUTOPDOC
  3.  
  4. MODULE:     mmdemo2.c
  5.  
  6. DESCRIPTION:
  7.  
  8. HIM Menu Manager Demo (Lightbar flavor)
  9.  
  10. TABLE OF CONTENTS:
  11.  
  12. #endif
  13. /*
  14.  *
  15.  *   Copyright 1988  Allsoft (tm)
  16.  *   100 Calle Playa Del Sol NE
  17.  *   Albuquerque, NM  87109
  18.  *
  19.  *   ALL RIGHTS RESERVED.
  20.  *
  21.  *   Unauthorized distribution, adaptation or use may be 
  22.  *   subject to civil and criminal penalties.
  23.  *
  24.  */
  25. /********** Filled by Polytron Version Control System **********
  26.  
  27. $Author:   james borders  $
  28.  
  29. $Date:   01 Dec 1988 12:18:12  $
  30.  
  31. $Revision:   1.0  $
  32.  
  33. $Log:   D:/C/FMLIB/MM/VCS/MMDEMO2.C  $
  34.  * 
  35.  *    Rev 1.0   01 Dec 1988 12:18:12   james borders
  36.  * Initial revision.
  37.  
  38. ****************************************************************/
  39.  
  40. /*** Include Files ***/
  41.  
  42. #include "stdio.h"
  43. #include "stdlib.h"
  44. #ifdef MSC
  45. #include "malloc.h"
  46. #endif
  47. #ifdef TURBOC
  48. #include "alloc.h"
  49. #endif
  50. #include "process.h"
  51. #include "dos.h"
  52. #include "lm.h"
  53. #include "wn.h"
  54. #include "km.h"
  55. #include "mm.h"
  56.  
  57. /*** Typedefs ***/
  58.  
  59. /*** Constants ***/
  60.  
  61. /*** Global Vars ***/
  62.  
  63. int   mm;            /* main menu */
  64. int   mmw,mmr,mmc,mmm,mmf,mmp,mmg,mmd,mms,mmq;  /* second level */
  65. int   mmwg;                                     /* only 1 3rd level for demo*/
  66.  
  67. /*
  68.    Use the menu variable names as the actual menu names to keep things
  69.    consistent.
  70. */
  71.  
  72. /* routines called as action functions */
  73.  
  74. int nomorelevelsmsg();
  75. int yesnojumptodos();
  76. int yesnoquit();
  77. int jumptodos();
  78. int quit();
  79. int filetoretrieve();
  80. int noaction();
  81.  
  82. main(argc,argv)
  83. /*****/
  84. int  argc;
  85. char *argv[];
  86. {
  87. int code,mnum,mel,count;
  88. int kbhit(),getch();
  89. char *cfs;
  90. char buf[80];
  91.  
  92. lminit((char *(*)())malloc,free,0);              /* init list manager */
  93. wninit(0,0,NULL,0,(char *(*)())malloc,free);     /* window manager using memory */
  94. kminit(kbhit,getch);                /* keyboard manager */
  95. mminit(kmgetch,NULL);               /* menu manager */
  96.  
  97. vpsvmode(vpgvmode());               /* clear the screen */
  98.  
  99. if (buildmenus() || explain()){
  100.    fprintf(stderr,"\nMMDEMO2 -- Error creating menus.  Check memory.");
  101.    }
  102. else{
  103.    mmpromenu(mm,MMPROCESS,1);
  104.    }
  105. mmdestroy(-1);
  106. exit(0);
  107. }
  108.  
  109. explain()
  110. /********/
  111. {
  112. int wnum;
  113.  
  114. wnum = wncreate(14,0,80,10,WNBLUE,WNCYAN,WNBLUE,WNBLACK);
  115. if (wnum < 0)
  116.    return(-1);
  117. wnttitle(wnum,"[ MMDEMO (2)  LIGHTBAR Version 1.0 ]");
  118. wnprintf(wnum,"\nThe HIM Menu Manager makes it easy to include sophisticated menus in your");
  119. wnprintf(wnum,"\nprograms.  The three available menu types are: POPUP, PULL-DOWN, and");
  120. wnprintf(wnum,"\nLIGHTBAR (Lotus-style).  The first 2 levels of the standard Lotus 1-2-3");
  121. wnprintf(wnum,"\nmenus are illustrated here in a LIGHTBAR (Lotus) form.");
  122. return(0);
  123. }
  124.  
  125.  
  126. buildmenus()
  127. /***********/
  128. {
  129. if (createmenus() || createelements())
  130.    return(-1);
  131. return(0);
  132. }
  133.  
  134. createmenus()
  135. /***********/
  136. {
  137.  
  138. /* first create the top level menu */
  139.  
  140. mmscparms(WNBLACK,WNWHITE,          /* back/fore */
  141.           WNBLACK,WNWHITE,          /* border back/fore */
  142.           WNBLACK,WNWHITE,          /* read only back/fore */
  143.           WNBLACK,WNWHITE,          /* mark character back/fore */
  144.           WNCYAN,WNBLACK,           /* hightlight back/fore */
  145.           WNBLACK,WNWHITE,          /* title colors */
  146.           ' ','\0');                /* mark character, no mark key */
  147.  
  148. mm = mmcreate("mm",MMLIGHTBAR,0,0,80,2,MMABSRCWH,"","",NULL,0,0,0,noaction,NULL);
  149.  
  150. /* now the second level */
  151.  
  152. mmscparms(WNBLACK, WNWHITE,         /* back/fore */
  153.           WNBLACK, WNWHITE,         /* border back/fore */
  154.           WNBLACK, WNWHITE,         /* read only back/fore */
  155.           WNBLACK, WNWHITE,         /* mark character back/fore */
  156.           WNCYAN, WNBLACK,          /* hightlight back/fore */
  157.           WNBLACK, WNWHITE,         /* title colors */
  158.           ' ','\0');                /* mark character, no mark key */
  159.  
  160. mmw = mmcreate("mmw",MMLIGHTBAR,0,0,80,2,MMABSRCWH,"","",NULL,0,0,0,MMACTIONNULL,NULL);
  161. mmr = mmcreate("mmr",MMLIGHTBAR,0,0,80,2,MMABSRCWH,"","",NULL,0,0,0,nomorelevelsmsg,NULL);
  162. mmc = mmcreate("mmc",MMLIGHTBAR,0,0,80,2,MMABSRCWH,"","",NULL,0,0,0,nomorelevelsmsg,NULL);
  163. mmm = mmcreate("mmm",MMLIGHTBAR,0,0,80,2,MMABSRCWH,"","",NULL,0,0,0,nomorelevelsmsg,NULL);
  164. mmf = mmcreate("mmf",MMLIGHTBAR,0,0,80,2,MMABSRCWH,"","",NULL,0,0,0,nomorelevelsmsg,NULL);
  165. mmp = mmcreate("mmp",MMLIGHTBAR,0,0,80,2,MMABSRCWH,"","",NULL,0,0,0,nomorelevelsmsg,NULL);
  166. mmg = mmcreate("mmg",MMLIGHTBAR,0,0,80,2,MMABSRCWH,"","",NULL,0,0,0,nomorelevelsmsg,NULL);
  167. mmd = mmcreate("mmd",MMLIGHTBAR,0,0,80,2,MMABSRCWH,"","",NULL,0,0,0,nomorelevelsmsg,NULL);
  168. mms = mmcreate("mms",MMLIGHTBAR,0,0,80,2,MMABSRCWH,"","",NULL,0,0,0,nomorelevelsmsg,NULL);
  169. mmq = mmcreate("mmq",MMLIGHTBAR,0,0,80,2,MMABSRCWH,"","",NULL,0,0,0,nomorelevelsmsg,NULL);
  170.  
  171.  
  172. /* now the 3rd level */
  173.  
  174. mmscparms(WNBLACK,   WNWHITE,       /* back/fore */
  175.           WNBLACK,   WNWHITE,       /* border back/fore */
  176.           WNBLACK,   WNWHITE,       /* read only back/fore */
  177.           WNBLACK,   WNWHITE,       /* mark character back/fore */
  178.           WNCYAN,    WNBLACK,       /* hightlight back/fore */
  179.           WNBLACK,   WNWHITE,       /* title colors */
  180.           ' ','\0');                /* mark character, no mark key */
  181.  
  182. mmwg = mmcreate("mmwg",MMLIGHTBAR,0,0,80,2,MMABSRCWH,"","",NULL,0,0,0,nomorelevelsmsg,NULL);
  183.  
  184. if ((mm|mmw|mmr|mmc|mmm|mmf|mmp|mmg|mmd|mms|mmq|mmwg) < 0)
  185.    return(-1);
  186.  
  187. return(0);
  188. };
  189.  
  190. createelements()
  191. /***************/
  192. {
  193. int mel;
  194. char buf[80];
  195.  
  196. /* main menu (mm) */
  197.  
  198. sprintf(buf,"~*,%d~W~*,*~orksheet",WNRED);
  199. mmamel(mm,"",buf,"Global, Insert, Delete, Column, Erase, Titles, Window, Status, Page",
  200.              "mmw",1,0,MMNOCASE | 'w',MMACTIONNULL,NULL);
  201. sprintf(buf,"~*,%d~R~*,*~ange",WNRED);
  202. mmamel(mm,"",buf,"Format, Label, Erase, Name, Justify, Protect, Unprotect, Input, Value, Transpose",
  203.              "mmr",1,0,MMNOCASE | 'r',MMACTIONNULL,NULL);
  204. sprintf(buf,"~*,%d~C~*,*~opy",WNRED);
  205. mmamel(mm,"",buf,"Copy a cell or range of cells",
  206.              "mmc",1,0,MMNOCASE | 'c',MMACTIONNULL,NULL);
  207. sprintf(buf,"~*,%d~M~*,*~ove",WNRED);
  208. mmamel(mm,"",buf,"Move a cell or range of cells",
  209.              "mmm",1,0,MMNOCASE | 'm',MMACTIONNULL,NULL);
  210. sprintf(buf,"~*,%d~F~*,*~ile",WNRED);
  211. mmamel(mm,"",buf,"Retrieve, Save, Combine, Xtract, Erase, List, Import, Directory",
  212.              "mmf",1,0,MMNOCASE | 'f',MMACTIONNULL,NULL);
  213. sprintf(buf,"~*,%d~P~*,*~rint",WNRED);
  214. mmamel(mm,"",buf,"Oputput a range to the printer or a print file",
  215.              "mmp",1,0,MMNOCASE | 'p',MMACTIONNULL,NULL);
  216. sprintf(buf,"~*,%d~G~*,*~raph",WNRED);
  217. mmamel(mm,"",buf,"Create a graph",
  218.              "mmg",1,0,MMNOCASE | 'g',MMACTIONNULL,NULL);
  219. sprintf(buf,"~*,%d~D~*,*~ata",WNRED);
  220. mmamel(mm,"",buf,"Fill, Table, Sort, Query, Distribution, Matrix, Regression, Parse",
  221.              "mmd",1,0,MMNOCASE | 'd',MMACTIONNULL,NULL);
  222. sprintf(buf,"~*,%d~S~*,*~ystem",WNRED);
  223. mmamel(mm,"",buf,"Invoke the DOS Command Interpreter",
  224.              "mms",1,0,MMNOCASE | 's',MMACTIONNULL,NULL);
  225. sprintf(buf,"~*,%d~Q~*,*~uit",WNRED);
  226. mmamel(mm,"",buf,"End 1-2-3 session (Have you saved your work ?)",
  227.              "mmq",1,0,MMNOCASE | 'q',MMACTIONNULL,NULL);
  228.  
  229.  
  230. /* worksheet level 2 menu (mmw) */
  231. /*
  232. The first item "global" is the only one that will call a 3rd level menu.  All
  233. other items will fall back to their menu action routine which will tell the
  234. user that there are no more levels
  235. */
  236.  
  237. mmamel(mmw,"","Global","Set worksheet settings",
  238.              "mmwg",0,0,MMNOCASE | 'g',MMACTIONNULL,NULL);
  239. mmamel(mmw,"","Insert","Insert blank column(s) or row(s)",
  240.              "",0,0,MMNOCASE | 'i',nomorelevelsmsg,NULL);
  241. mmamel(mmw,"","Delete","Delete entire column(s) or row(s)",
  242.              "",0,0,MMNOCASE | 'd',nomorelevelsmsg,NULL);
  243. mmamel(mmw,"","Column","Set display characteristics of the current column",
  244.              "",0,0,MMNOCASE | 'c',nomorelevelsmsg,NULL);
  245. mmamel(mmw,"","Erase","Erase the entire worksheet",
  246.              "",0,0,MMNOCASE | 'e',nomorelevelsmsg,NULL);
  247. mmamel(mmw,"","Titles","Set horizontal or vertical titles",
  248.              "",0,0,MMNOCASE | 't',nomorelevelsmsg,NULL);
  249. mmamel(mmw,"","Window","Set split screen and synchronized scrolling",
  250.              "",0,0,MMNOCASE | 'w',nomorelevelsmsg,NULL);
  251. mmamel(mmw,"","Status","Display worksheet settings",
  252.              "",0,0,MMNOCASE | 's',nomorelevelsmsg,NULL);
  253. mmamel(mmw,"","Page","Insert a page-break above the cell pointer",
  254.              "",0,0,MMNOCASE | 'p',nomorelevelsmsg,NULL);
  255.  
  256. /* range level 2 menu (mmr) */
  257.  
  258. mmamel(mmr,"","Format","Format a cell or range of cells",
  259.              "",0,0,MMNOCASE | 'f',MMACTIONNULL,NULL);
  260. mmamel(mmr,"","Label","Align a label or range of labels (Left, Right, or Center)",
  261.              "",0,0,MMNOCASE | 'l',MMACTIONNULL,NULL);
  262. mmamel(mmr,"","Erase","Erase a cell or range of cells",
  263.              "",0,0,MMNOCASE | 'e',MMACTIONNULL,NULL);
  264. mmamel(mmr,"","Name","Create, delete, or modify range names",
  265.              "",0,0,MMNOCASE | 'n',MMACTIONNULL,NULL);
  266. mmamel(mmr,"","Justify","Adjust width of a column of labels",
  267.              "",0,0,MMNOCASE | 'j',MMACTIONNULL,NULL);
  268. mmamel(mmr,"","Protect","Disallow changes to a range if protection is enabled",
  269.              "",0,0,MMNOCASE | 'p',MMACTIONNULL,NULL);
  270. mmamel(mmr,"","Unprotect","Allow changes to a range",
  271.              "",0,0,MMNOCASE | 'u',MMACTIONNULL,NULL);
  272. mmamel(mmr,"","Input","Enter data into the unprotected cells in a range",
  273.              "",0,0,MMNOCASE | 'i',MMACTIONNULL,NULL);
  274. mmamel(mmr,"","Value","Copy range, converting formulas to values",
  275.              "",0,0,MMNOCASE | 'v',MMACTIONNULL,NULL);
  276. mmamel(mmr,"","Transpose","Copy range, switching columns and rows",
  277.              "",0,0,MMNOCASE | 't',MMACTIONNULL,NULL);
  278.  
  279.  
  280. /* copy level 2 menu (mmc) */
  281.  
  282. mmamel(mmc,"","From","Range of cells to copy from",
  283.              "",0,0,MMNOCASE | 'f',MMACTIONNULL,NULL);
  284. mmamel(mmc,"","To","Range of cells to copy to",
  285.              "",0,1,MMNOCASE | 't',MMACTIONNULL,NULL);
  286.  
  287. /* move level 2 menu (mmm) */
  288.  
  289. mmamel(mmm,"","From","Range of cells to move from",
  290.              "",0,0,MMNOCASE | 'f',MMACTIONNULL,NULL);
  291.  
  292. mmamel(mmm,"","To","Range of cells to move to",
  293.              "",0,1,MMNOCASE | 't',MMACTIONNULL,NULL);
  294.  
  295.  
  296. /* file level 2 menu (mmf) */
  297.  
  298. mmamel(mmf,"","Retrieve","Erase the current worksheet and display the selected worksheet",
  299.              "",0,0,MMNOCASE | 'r',filetoretrieve,NULL);
  300. mmamel(mmf,"","Save","Store the entire worksheet in a worksheet file",
  301.              "",0,0,MMNOCASE | 's',MMACTIONNULL,NULL);
  302. mmamel(mmf,"","Combine","Incorporate all or part of a worksheet file into the worksheet",
  303.              "",0,0,MMNOCASE | 'c',MMACTIONNULL,NULL);
  304. mmamel(mmf,"","Xtract","Store a cell range in a worksheet file",
  305.              "",0,0,MMNOCASE | 'x',MMACTIONNULL,NULL);
  306. mmamel(mmf,"","Erase","Erase a worksheet, print, or graph file",
  307.              "",0,0,MMNOCASE | 'e',MMACTIONNULL,NULL);
  308. mmamel(mmf,"","List","Display names of 1-2-3 files in current directory",
  309.              "",0,0,MMNOCASE | 'l',MMACTIONNULL,NULL);
  310. mmamel(mmf,"","Import","Read text or numbers from a print file into the worksheet",
  311.              "",0,0,MMNOCASE | 'i',MMACTIONNULL,NULL);
  312. mmamel(mmf,"","Directory","Display and/or set the current directory",
  313.              "",0,0,MMNOCASE | 'd',MMACTIONNULL,NULL);
  314.  
  315. /* print level 2 menu (mmp) */
  316.  
  317. mmamel(mmp,"","Printer","Send print output directly to printer",
  318.              "",0,0,MMNOCASE | 'p',MMACTIONNULL,NULL);
  319. mmamel(mmp,"","File","Send print output to file",
  320.              "",0,0,MMNOCASE | 'f',MMACTIONNULL,NULL);
  321.  
  322. /* graph level 2 menu (mmg) */
  323.  
  324. mmamel(mmg,"","Type","Set graph type",
  325.              "",0,0,MMNOCASE | 't',MMACTIONNULL,NULL);
  326. mmamel(mmg,"","X","Set X-Range",
  327.              "",0,0,MMNOCASE | 'x',MMACTIONNULL,NULL);
  328. mmamel(mmg,"","A","Set first data range",
  329.              "",0,0,MMNOCASE | 'a',MMACTIONNULL,NULL);
  330. mmamel(mmg,"","B","Set second data range",
  331.              "",0,0,MMNOCASE | 'b',MMACTIONNULL,NULL);
  332. mmamel(mmg,"","C","Set third data range",
  333.              "",0,0,MMNOCASE | 'c',MMACTIONNULL,NULL);
  334. mmamel(mmg,"","D","Set fourth data range",
  335.              "",0,0,MMNOCASE | 'd',MMACTIONNULL,NULL);
  336. mmamel(mmg,"","E","Set fifth data range",
  337.              "",0,0,MMNOCASE | 'e',MMACTIONNULL,NULL);
  338. mmamel(mmg,"","F","Set sixth data range",
  339.              "",0,0,MMNOCASE | 'f',MMACTIONNULL,NULL);
  340. mmamel(mmg,"","Reset","Cancel graph settings",
  341.              "",0,0,MMNOCASE | 'r',MMACTIONNULL,NULL);
  342. mmamel(mmg,"","View","View the current graph",
  343.              "",0,0,MMNOCASE | 'v',MMACTIONNULL,NULL);
  344. mmamel(mmg,"","Save","Save the current graph in a file for later printing",
  345.              "",0,0,MMNOCASE | 's',MMACTIONNULL,NULL);
  346. mmamel(mmg,"","Options","Legend, Format, Titles, Grid, Scale, Color, B&W, Data-Labels",
  347.              "",0,0,MMNOCASE | 'o',MMACTIONNULL,NULL);
  348. mmamel(mmg,"","Name","Use, Create, Delete, or Reset named graphs",
  349.              "",0,0,MMNOCASE | 'n',MMACTIONNULL,NULL);
  350. mmamel(mmg,"","Quit","Return to READY mode",
  351.              "",0,0,MMNOCASE | 'q',MMACTIONNULL,NULL);
  352.  
  353.  
  354. /* data level 2 menu (mmd) */
  355.  
  356. mmamel(mmd,"","Fill","Fill a range with numbers",
  357.              "",0,0,MMNOCASE | 'f',MMACTIONNULL,NULL);
  358. mmamel(mmd,"","Table","Create a table of values",
  359.              "",0,0,MMNOCASE | 't',MMACTIONNULL,NULL);
  360. mmamel(mmd,"","Sort","Sort data records",
  361.              "",0,0,MMNOCASE | 's',MMACTIONNULL,NULL);
  362. mmamel(mmd,"","Query","Find all data records satisfying given criteria",
  363.              "",0,0,MMNOCASE | 'q',MMACTIONNULL,NULL);
  364. mmamel(mmd,"","Distribution","Calculate frequency distribution of a range",
  365.              "",0,0,MMNOCASE | 'd',MMACTIONNULL,NULL);
  366. mmamel(mmd,"","Matrix","Perform matrix operations",
  367.              "",0,0,MMNOCASE | 'm',MMACTIONNULL,NULL);
  368. mmamel(mmd,"","Regression","Calculate linear regressions",
  369.              "",0,0,MMNOCASE | 'r',MMACTIONNULL,NULL);
  370. mmamel(mmd,"","Parse","Parse a column of labels into a range",
  371.              "",0,0,MMNOCASE | 'p',MMACTIONNULL,NULL);
  372.  
  373.  
  374. /* system level 2 menu (mms) */
  375.  
  376. mmamel(mms,"","No","Do not jump to DOS",
  377.              "",0,0,MMNOCASE | 'n',noaction,NULL);
  378. mmamel(mms,"","Yes","Jump to DOS",
  379.              "",0,0,MMNOCASE | 'y',jumptodos,NULL);
  380.  
  381.  
  382. /* quit level 2 menu (mmq) */
  383.  
  384. mmamel(mmq,"","No","Do not end 1-2-3 session; return to READY mode",
  385.              "",0,0,MMNOCASE | 'n',noaction,NULL);
  386. mmamel(mmq,"","Yes","End 1-2-3 session (Remember to save your worksheet first)",
  387.              "",0,0,MMNOCASE | 'y',quit,NULL);
  388.  
  389. /* worksheet-global level 3 menu (mmwg) */
  390.  
  391. mmamel(mmwg,"","Format","Set global format",
  392.              "",0,0,MMNOCASE | 'f',MMACTIONNULL,NULL);
  393. mmamel(mmwg,"","Label-prefix","Set global label alignment prefix (Left, Right, Center)",
  394.              "",0,0,MMNOCASE | 'l',MMACTIONNULL,NULL);
  395. mmamel(mmwg,"","Column-Width","Set global column width",
  396.              "",0,0,MMNOCASE | 'c',MMACTIONNULL,NULL);
  397. mmamel(mmwg,"","Recalculation","Natural, Columnwise, Rowwise, Automatic, Manual, Iteration",
  398.              "",0,0,MMNOCASE | 'r',MMACTIONNULL,NULL);
  399. mmamel(mmwg,"","Protection","Turn protection on or off",
  400.              "",0,0,MMNOCASE | 'p',MMACTIONNULL,NULL);
  401. mmamel(mmwg,"","Default","Define default disk and printer settings",
  402.              "",0,0,MMNOCASE | 'd',MMACTIONNULL,NULL);
  403.  
  404. mel = mmamel(mmwg,"","Zero","turn zero suppression on or off",
  405.              "",0,0,MMNOCASE | 'z',MMACTIONNULL,NULL);
  406.  
  407. /*
  408.    if the last element took then all the others probably did too.
  409. */
  410.  
  411. if (mel < 0){
  412.    return(-1);
  413.    }
  414. return(0);
  415. };
  416.  
  417. /***** action routines *****/
  418.  
  419. nomorelevelsmsg(mnum,mel,hotkey)
  420. /***************/
  421. int mnum,mel,hotkey;
  422. {
  423. int wnum;
  424.  
  425. if (mel == -1){
  426.    if (strcmp(mmgmname(mnum),"mm") == 0) /* at main already */
  427.       return(-1);
  428.    else
  429.       return(0);
  430.    };
  431. wnum = wncreate(19,0,40,6,WNBLACK,WNCYAN,WNBLACK,WNCYAN);
  432. wnprintf(wnum,"No more levels defined for this demo.");
  433. wnprintf(wnum,"\nESCAPE backs out of a menu.");
  434. wnprintf(wnum,"\n<Hit a key...>");
  435. kmgetch();
  436. wndestroy(wnum);
  437. return(-1);
  438. }
  439.  
  440. yesnojumptodos(mnum,mel,hotkey)
  441. /*****************************/
  442. int mnum,mel,hotkey;
  443. {
  444. if (hotkey)    /* don't ask user, just do it */
  445.    jumptodos(mnum,mel,hotkey);
  446. else
  447.    mmpromenu(mms,MMPROCESS,1);
  448. return(-1);
  449.  
  450. }
  451.  
  452. yesnoquit(mnum,mel,hotkey)
  453. /*****************************/
  454. int mnum,mel,hotkey;
  455. {
  456. if (hotkey)   /* don't ask user, just do it */
  457.    quit(mnum,mel,hotkey);
  458. else
  459.    mmpromenu(mmq,MMPROCESS,1);
  460. return(-1);
  461. }
  462.  
  463.  
  464. jumptodos(mnum,mel,hotkey)
  465. /***************/
  466. int mnum,mel,hotkey;
  467. {
  468. int wnum;
  469. int wsave,wscroll,wcmode,ul,ur,ll,lr,vti,vbi,hli,hri,ic,vc,hc;
  470.  
  471. wngcparms(&wsave,&wscroll,&wcmode,&ul,&ur,&ll,
  472.           &lr,&vti,&vbi,&hli,&hri,&ic,&vc,&hc);
  473. wnscparms(wsave,wscroll,wcmode,           /* create window wo/border */
  474.           ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ');
  475. wnum = wncreate(0,0,wngscols(),wngsrows(),WNBLACK,WNBLACK,WNBLACK,WNBLACK);
  476. if (wnum > 0){
  477.    spawnl(P_WAIT,getenv("COMSPEC"),NULL);
  478.    wndestroy(wnum);
  479.    }
  480. wnscparms(wsave,wscroll,wcmode,ul,ur,ll,lr,vti,vbi,hli,hri,ic,vc,hc);
  481. return(0);
  482. }
  483.  
  484. quit(mnum,mel,hotkey)
  485. /************/
  486. int mnum,mel,hotkey;
  487. {
  488. mmdestroy(-1);    /* will NOT take down menus... */
  489. wndestroy(-1);    /* get rid of the windows */
  490. exit(0);
  491. }
  492.  
  493. noaction(mnum,mel,hotkey)
  494. /***************/
  495. int mnum,mel,hotkey;
  496. {
  497. if (mel == -1){
  498.    if (strcmp(mmgmname(mnum),"mm") == 0) /* at main already */
  499.       return(-1);
  500.    else
  501.       return(0);
  502.    };
  503.  
  504. return(0);
  505. };
  506.  
  507. filetoretrieve(mnum,mel,hotkey)
  508. /*****************************/
  509. int mnum,mel,hotkey;
  510. {
  511. char buf[80];
  512.  
  513. mminput(mnum,"File to Retrieve? ",WNCHARSTR,buf,12,0,NULL,WNACTIONNULL);
  514. return(0);
  515. }
  516.