home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / VISIONS.ZIP / DEMOVIS.C < prev    next >
Text File  |  1990-05-20  |  28KB  |  686 lines

  1. /*-------------------------- DEMOVIS.C -------------------------*/
  2. /*                                */
  3. /*  This file contains the main VISION LIBRARY DEMO software.    */
  4. /*                                */
  5. /*         Copyright 1990 Dan Vogel & David Bernazzani        */
  6. /*                                */
  7. /*   Date    Initials    Comments            */
  8. /*                                */
  9. /*  03/07/90    DCV        Initial Release 0.00.        */
  10. /*--------------------------------------------------------------*/
  11.  
  12. #include <stdio.h>
  13. #include <dos.h>
  14. #include <graph.h>
  15.  
  16. #include "USERMENU.H"
  17. #include "DEMOPROT.H"
  18.  
  19. static char *cnotice="VISIONS Copyright 1990 Dan Vogel & David Bernazzani";
  20.  
  21. /*--------------------------------------------------------------*/
  22.  
  23. #define    MAIN_DEMO_TOP_Y        (BYTE)2
  24. #define    MAIN_DEMO_TOP_X        (BYTE)2
  25. #define    MAIN_DEMO_HEIGHT    (BYTE)9
  26. #define    MAIN_DEMO_WIDTH        (BYTE)35
  27. #define    MAIN_DEMO_BK_COLOR    TEXT_BLUE
  28. #define    MAIN_DEMO_TXT_COLOR    TEXT_WHITE
  29. #define    MAIN_DEMO_HBK_COLOR    TEXT_WHITE
  30. #define    MAIN_DEMO_HTXT_COLOR    TEXT_BLUE
  31.  
  32. /*-----------------------------------------------------------*/
  33. /*  This is the main program for the VISIONS demonstration.  */
  34. /*   WARNING - Error checking has been removed for clarity.  */
  35. /*          This should not be a normal practice.            */
  36. /*-----------------------------------------------------------*/
  37. main()
  38. {
  39.    MENU_HEAD *new_menu;    /* Pointer to the menu to be created. */
  40.  
  41.    InitWindow();
  42.  
  43.    /*------------------------------------------------*/
  44.    /*  Display initial VISION logo and information.  */
  45.    /*------------------------------------------------*/
  46.    VISION_logo();
  47.    Share_Policy();
  48.  
  49.    /*-------------------------------------------------*/
  50.    /*  Now give the user a choice of demonstrations.  */
  51.    /*  First build the demonstration selection menu.  */
  52.    /*-------------------------------------------------*/
  53.    DefineMenu(&new_menu,MAIN_DEMO_TOP_Y,MAIN_DEMO_TOP_X,
  54.     MAIN_DEMO_HEIGHT,MAIN_DEMO_WIDTH,SINGLEBORDER,HOT_EXEC_ON,
  55.     MAIN_DEMO_BK_COLOR, MAIN_DEMO_TXT_COLOR, 
  56.     MAIN_DEMO_HBK_COLOR, MAIN_DEMO_HTXT_COLOR,
  57.     "VISIONS LIBRARY DEMONSTRATION");
  58.    AddToMenu(new_menu, "List Demonstration", 'L', 0, *List_Demo);
  59.    AddToMenu(new_menu, "Window Demonstration",    'W', 0,    *Window_Demo);
  60.    AddToMenu(new_menu, "Menu Demonstration", 'M', 0, *Menu_Demo);
  61.    AddToMenu(new_menu, "Form Demonstration",'F', 0, *Form_Demo);
  62.    AddToMenu(new_menu, "Shareware Policy",'S', 0, *Share_Policy);
  63.    AddToMenu(new_menu, "Exit VISIONS Demonstration",'E', 1, NULL);
  64.  
  65.    /*----------------------------------------------------------*/
  66.    /* Now automatically size and display the menu, and execute */
  67.    /* the menu routines based upon user selection.           */
  68.    /*----------------------------------------------------------*/
  69.    AutoDisplayMenu(new_menu);
  70.  
  71.    /*-------------------------------------------------*/
  72.    /* Release the memory used by the menu definition. */
  73.    /*-------------------------------------------------*/
  74.    DeleteMenu(new_menu);
  75.  
  76. exit:
  77.    ExitWindow();        /*Clear screen and reset mode */
  78.  
  79.    exit(0);
  80. }
  81.  
  82.  
  83.  
  84.  
  85. /*-------------------------------------------*/
  86. /*              VISION_logo                  */
  87. /* This is the VISIONS logo display routine. */
  88. /*-------------------------------------------*/
  89. int VISION_logo()
  90. {
  91.    WINDOW_HEAD *window_ptr;
  92.    int i;
  93.    char block[81];
  94.  
  95.    DefineWindow(&window_ptr,1,1,24,80,TEXT_BLUE,TEXT_BWHITE,
  96.     NULL, SINGLEBORDER, FALSE, FALSE, TRUE);
  97.    DisplayWindow(window_ptr);
  98.  
  99.    /*-----------------------------------------*/
  100.    /* Block out the logo in X's so its        */
  101.    /* legible, and then convert it to blocks. */
  102.    /*-----------------------------------------*/
  103.    strcpy(block," XX       XX   XXXXX      XXX     XXXXX      XXX      X   X      XXX");
  104.    for (i=0;block[i] != 0;i++)
  105.       if (block[i] == 'X')
  106.          block[i] = (char)219;
  107.    WindMesg(5,6,block);
  108.  
  109.    strcpy(block,"  XX     XX      X       X          X       X   X     XX  X     X");
  110.    for (i=0;block[i] != 0;i++)
  111.       if (block[i] == 'X')
  112.          block[i] = (char)219;
  113.    WindMesg(6,6,block);
  114.    strcpy(block,"   XX   XX       X        XX        X       X   X     X X X      XX");
  115.    for (i=0;block[i] != 0;i++)
  116.       if (block[i] == 'X')
  117.          block[i] = (char)219;
  118.    WindMesg(7,6,block);
  119.    strcpy(block,"    XX XX        X          X       X       X   X     X  XX        X");
  120.    for (i=0;block[i] != 0;i++)
  121.       if (block[i] == 'X')
  122.          block[i] = (char)219;
  123.    WindMesg(8,6,block);
  124.    strcpy(block,"     XXX       XXXXX     XXX      XXXXX      XXX      X   X     XXX");
  125.    for (i=0;block[i] != 0;i++)
  126.       if (block[i] == 'X')
  127.          block[i] = (char)219;
  128.    WindMesg(9,6,block);
  129.  
  130.    WindMesg(12,6,"                     Library Demonstration Program");
  131.    WindMesg(15,6,"                           Copyright 1990");
  132.    WindMesg(17,6,"                            by Dan Vogel");
  133.    WindMesg(19,6,"                        and David Bernazzani");
  134.    WindMesg(24,28,"Hit any key to continue.");
  135.  
  136.    GetKey();
  137.  
  138.    RemoveWindow(window_ptr);
  139.    DeleteWindow(window_ptr);
  140.  
  141.    return(0);
  142. }
  143.  
  144.  
  145.  
  146. /*--------------------------------------*/
  147. /*            Share_Policy              */
  148. /* This is the shareware policy display */
  149. /* window for the VISIONS librarys.     */
  150. /*--------------------------------------*/
  151. int Share_Policy()
  152. {
  153.    WINDOW_HEAD *window_ptr;
  154.  
  155.    DefineWindow(&window_ptr,1,1,24,80,TEXT_BLUE,TEXT_BWHITE,
  156.     NULL, SINGLEBORDER, FALSE, FALSE, TRUE);
  157.    DisplayWindow(window_ptr);
  158.  
  159.  
  160.    WindMesg(4,3,"                          VISIONS Library");
  161.    WindMesg(7,3,"  The VISIONS library is a programmer's toolkit consisting of a list module,");
  162.    WindMesg(8,3,"a windows module, a menus module, and a forms module.  Each module provides");
  163.    WindMesg(9,3,"the programmer with a set of routines for implementing the basic functions");
  164.    WindMesg(10,3,"associated with that module, whether it be pop up menus or form entry");
  165.    WindMesg(11,3,"screens.  The windows provided by this program are text windows only and");
  166.    WindMesg(12,3,"have been written for use with VGA, EGA, MCGA, CGA, or MGA video systems.");
  167.    WindMesg(13,3,"This program gives examples of library functions, provides an on-line set");
  168.    WindMesg(14,3,"of programmer's reference manuals for the library, and also allows the user");
  169.    WindMesg(15,3,"to view the source code that generates this demonstration.  The library was");
  170.    WindMesg(16,3,"compiled using Microsoft C 5.1 large model.  Compilation specific code has ");
  171.    WindMesg(17,3,"been separated into a single file making it easy to port the library, for ");
  172.    WindMesg(18,3,"those interested in purchasing the source rights.");
  173.    WindMesg(24,28,"Hit any key to continue.");
  174.  
  175.    GetKey();
  176.  
  177.  
  178.    WindMesg(7,3,"                                                                            ");
  179.    WindMesg(8,3,"  This demonstration program, both executable and source provided, may be   ");
  180.    WindMesg(9,3,"freely copied and distributed without charge.  The VISIONS library file     ");
  181.    WindMesg(10,3,"provided with this demonstration is a full and complete VISIONS library that");
  182.    WindMesg(11,3,"may be used only for home personal use.  A donation, suggested $25, to the  ");
  183.    WindMesg(12,3,"VISIONS developers would be appreciated.  Any use of the VISIONS library for");
  184.    WindMesg(13,3,"development of software to be sold must be registered with the developers.  ");
  185.    WindMesg(14,3,"Registration cost is $75 per user and entitles the user to royalty-free use ");
  186.    WindMesg(15,3,"of VISIONS as part of an executable program.  The executable program must   ");
  187.    WindMesg(16,3,"give credits to VISIONS and its developers in any logo screens or manuals.  ");
  188.    WindMesg(17,3,"   This library may not be sold or copied, except as free shareware in its  ");
  189.    WindMesg(18,3,"original state, without the express written consent of the developers.  The ");
  190.    WindMesg(19,3,"developers make no claims or warranties for the VISIONS library in any form.");
  191.    WindMesg(20,3,"                                                                            ");
  192.  
  193.    WindMesg(24,28,"Hit any key to continue.");
  194.  
  195.    GetKey();
  196.  
  197.    WindMesg(8,3,"   Source code for the VISIONS library is available for the prices listed   ");
  198.    WindMesg(9,3,"below.  Purchasing the VISIONS source code entitles the user to make his or ");
  199.    WindMesg(10,3,"her own modifications to the VISIONS library, but does not permit the user  ");
  200.    WindMesg(11,3,"to sell or distribute either the source or executable library code in       ");
  201.    WindMesg(12,3,"either its original or modified state.  The modified library may still be   ");
  202.    WindMesg(13,3,"used as part of a product (executable program) without royalty, although    ");
  203.    WindMesg(14,3,"VISIONS and its developers are to receive credits in the developed programs ");
  204.    WindMesg(15,3,"and their manuals.  Registration is still required when source code is      ");
  205.    WindMesg(16,3,"purchased, but the fee may be used as a credit for source code purchase.    ");
  206.    WindMesg(17,3,"   Site licensing can be discussed with the developers of VISIONS as needed ");
  207.    WindMesg(18,3,"for multiple development stations.                                          ");
  208.    WindMesg(19,3,"                                                                            ");
  209.    WindMesg(20,3,"                                                                            ");
  210.    WindMesg(24,28,"Hit any key to continue.");
  211.  
  212.    GetKey();
  213.  
  214.    WindMesg(2,3,"                      VISIONS Ordering Information                          ");
  215.    WindMesg(3,3,"                                                                            ");
  216.    WindMesg(4,3,"   Formats available:  3 1/2\" diskettes, 720Kb                              ");
  217.    WindMesg(5,3,"                       5 1/4\" diskettes, 360Kb and 1.2Mb                    ");
  218.    WindMesg(6,3,"   Prices:   VISIONS List library sources      $  45.00 (all sources include");
  219.    WindMesg(7,3,"             VISIONS Window library sources    $  45.00  separate compiler  ");
  220.    WindMesg(8,3,"             VISIONS Menu library sources      $  45.00  specific files.)   ");
  221.    WindMesg(9,3,"             VISIONS Form library sources      $  45.00                     ");
  222.    WindMesg(10,3,"             VISIONS package (all 4 modules)   $ 149.00                     ");
  223.    WindMesg(11,3,"   Please add sales tax as appropriate (5% in Massachusetts).               ");
  224.    WindMesg(12,3,"                                                                            ");
  225.    WindMesg(13,3,"   Send orders, requests, and comments to:                                  ");
  226.    WindMesg(14,3,"                                                                            ");
  227.    WindMesg(15,3,"                            Dan Vogel                                       ");
  228.    WindMesg(16,3,"                            5 Richard Road                                  ");
  229.    WindMesg(17,3,"                            Randolph, Mass.  02368                          ");
  230.    WindMesg(18,3,"                                                                            ");
  231.    WindMesg(19,3,"   The VISIONS form library demonstration may also be used to generate a    ");
  232.    WindMesg(20,3,"source code order form.                                                     ");
  233.    WindMesg(21,3,"   Comments and suggestions for library improvements are not only welcome,  ");
  234.    WindMesg(22,3,"but encouraged!  We will also try to answer questions, time permitting, if  ");
  235.    WindMesg(23,3,"a self-addressed stamped envelope is included.                              ");
  236.  
  237.    GetKey();
  238.  
  239.    RemoveWindow(window_ptr);
  240.    DeleteWindow(window_ptr);
  241.    return(0);
  242. }
  243.  
  244.  
  245.  
  246.  
  247.  
  248. /*-------------------------------------*/
  249. /* List demonstration selection menus. */
  250. /*-------------------------------------*/
  251.  
  252. #define  LIST_DEMO_TOP_Y                11
  253. #define  LIST_DEMO_TOP_X                10
  254. #define  LIST_DEMO_HEIGHT                7
  255. #define  LIST_DEMO_WIDTH                25
  256. #define  LIST_DEMO_BK_COLOR          TEXT_BLUE
  257. #define  LIST_DEMO_TXT_COLOR         TEXT_WHITE
  258. #define  LIST_DEMO_HBK_COLOR         TEXT_WHITE
  259. #define  LIST_DEMO_HTXT_COLOR        TEXT_BLUE
  260.  
  261.  
  262.  
  263. /*---------------------------------------------------*/
  264. /*                  List_Demo                        */
  265. /* This is the list demonstration menu.  The user    */
  266. /* may actually execute a demonstration, or view the */
  267. /* demonstration source code.                        */
  268. /*---------------------------------------------------*/
  269. int List_Demo()
  270. {
  271.    MENU_HEAD *new_menu;
  272.  
  273.    /*------------------------------------------------------*/
  274.    /*  First build the list demonstration selection menu.  */
  275.    /*------------------------------------------------------*/
  276.    DefineMenu(&new_menu, LIST_DEMO_TOP_Y, LIST_DEMO_TOP_X,
  277.         LIST_DEMO_HEIGHT, LIST_DEMO_WIDTH, SINGLEBORDER, HOT_EXEC_ON,
  278.         LIST_DEMO_BK_COLOR, LIST_DEMO_TXT_COLOR, 
  279.         LIST_DEMO_HBK_COLOR, LIST_DEMO_HTXT_COLOR,
  280.         "VISIONS LIST LIBRARY DEMONSTRATION");
  281.  
  282.    AddToMenu(new_menu, "Run List Demonstration", 'R', 0, *Run_List);
  283.    AddToMenu(new_menu, "Display List Demonstration Source",
  284.      'D', 0, *Display_List);
  285.    AddToMenu(new_menu, "View List Manual", 'V', 0, *View_List_Manual);
  286.    AddToMenu(new_menu, "Exit List Demonstration", 'E', 1, NULL);
  287.  
  288.    /*---------------------------------*/
  289.    /* Get and execute user selection. */
  290.    /*---------------------------------*/
  291.    AutoDisplayMenu(new_menu);
  292.  
  293.    /*---------------------------------*/
  294.    /* And return menu memory to heap. */
  295.    /*---------------------------------*/
  296.    DeleteMenu(new_menu);
  297.  
  298.    return(0);
  299. }
  300.  
  301.  
  302.  
  303.  
  304. #define  DISP_LIST_TOPY                  1
  305. #define  DISP_LIST_TOPX                  1
  306. #define  DISP_LIST_HEIGHT               24
  307. #define  DISP_LIST_WIDTH                80
  308. #define  DISP_LIST_BK_COLOR          TEXT_BLUE
  309. #define  DISP_LIST_TXT_COLOR         TEXT_WHITE
  310.  
  311.  
  312. /*--------------------------------------------------------------*/
  313. /*                       Display_List                           */
  314. /* This is the routine to display the list library source code. */
  315. /*--------------------------------------------------------------*/
  316. int Display_List()
  317. {
  318.    /*---------------------------------------------------------*/
  319.    /* Display the source code using the help window facility. */
  320.    /*---------------------------------------------------------*/
  321.    HelpWindow(DISP_LIST_TOPY, DISP_LIST_TOPX, 
  322.         DISP_LIST_HEIGHT, DISP_LIST_WIDTH,
  323.         DISP_LIST_BK_COLOR, DISP_LIST_TXT_COLOR,
  324.         SINGLEBORDER,"List Demonstration Source Code", "DEMOLIST.C");
  325.    return(0);
  326. }
  327.  
  328.  
  329.  
  330.  
  331. #define  VIEW_LIST_TOPY                1
  332. #define  VIEW_LIST_TOPX                1
  333. #define  VIEW_LIST_HEIGHT             24
  334. #define  VIEW_LIST_WIDTH              80
  335. #define  VIEW_LIST_BK_COLOR        TEXT_BLUE
  336. #define  VIEW_LIST_TXT_COLOR       TEXT_BWHITE
  337.  
  338.  
  339. /*-------------------------------------------------*/
  340. /*              View_List_Manual                   */
  341. /* This is the routine to display the list manual. */
  342. /*-------------------------------------------------*/
  343. int View_List_Manual()
  344. {
  345.    /*----------------------------------------------------*/
  346.    /* Display the manual using the help window facility. */
  347.    /*----------------------------------------------------*/
  348.    HelpWindow(VIEW_LIST_TOPY, VIEW_LIST_TOPX, 
  349.         VIEW_LIST_HEIGHT, VIEW_LIST_WIDTH,
  350.         VIEW_LIST_BK_COLOR, VIEW_LIST_TXT_COLOR,
  351.         SINGLEBORDER,"VISIONS List Manual", "VIS_LIST.TXT");
  352.    return(0);
  353. }
  354.  
  355.  
  356.  
  357.  
  358. /*---------------------------------------*/
  359. /* Window demonstration selection menus. */
  360. /*---------------------------------------*/
  361.  
  362. #define  WINDOW_DEMO_TOP_Y                11
  363. #define  WINDOW_DEMO_TOP_X                10
  364. #define  WINDOW_DEMO_HEIGHT                7
  365. #define  WINDOW_DEMO_WIDTH                25
  366. #define  WINDOW_DEMO_BK_COLOR        TEXT_BLUE
  367. #define  WINDOW_DEMO_TXT_COLOR       TEXT_WHITE
  368. #define  WINDOW_DEMO_HBK_COLOR       TEXT_WHITE
  369. #define  WINDOW_DEMO_HTXT_COLOR      TEXT_BLUE
  370.  
  371.  
  372.  
  373. /*-----------------------------------------------------*/
  374. /*                  Window_Demo                        */
  375. /* This is the window demonstration menu.  The user    */
  376. /* may actually execute a demonstration, or view the   */
  377. /* demonstration source code.                          */
  378. /*-----------------------------------------------------*/
  379. int Window_Demo()
  380. {
  381.    MENU_HEAD *new_menu;
  382.  
  383.    /*--------------------------------------------------------*/
  384.    /*  First build the window demonstration selection menu.  */
  385.    /*--------------------------------------------------------*/
  386.    DefineMenu(&new_menu, WINDOW_DEMO_TOP_Y, WINDOW_DEMO_TOP_X,
  387.         WINDOW_DEMO_HEIGHT, WINDOW_DEMO_WIDTH, SINGLEBORDER, HOT_EXEC_ON,
  388.         WINDOW_DEMO_BK_COLOR, WINDOW_DEMO_TXT_COLOR, 
  389.         WINDOW_DEMO_HBK_COLOR, WINDOW_DEMO_HTXT_COLOR,
  390.         "VISIONS WINDOW LIBRARY DEMONSTRATION");
  391.  
  392.    AddToMenu(new_menu, "Run Window Demonstration", 'R', 0, *Run_Window);
  393.    AddToMenu(new_menu, "Display Window Demonstration Source", 
  394.         'D', 0, *Display_Window);
  395.    AddToMenu(new_menu, "View Window Manual", 'V', 0, *View_Window_Manual);
  396.    AddToMenu(new_menu, "Exit Window Demonstration", 'E', 1, NULL);
  397.  
  398.    /*---------------------------------*/
  399.    /* Get and execute user selection. */
  400.    /*---------------------------------*/
  401.    AutoDisplayMenu(new_menu);
  402.  
  403.    /*---------------------------------*/
  404.    /* And return menu memory to heap. */
  405.    /*---------------------------------*/
  406.    DeleteMenu(new_menu);
  407.  
  408.    return(0);
  409. }
  410.  
  411.  
  412.  
  413.  
  414.  
  415. #define  DISP_WINDOW_TOPY                1
  416. #define  DISP_WINDOW_TOPX                1
  417. #define  DISP_WINDOW_HEIGHT             24
  418. #define  DISP_WINDOW_WIDTH              80
  419. #define  DISP_WINDOW_BK_COLOR        TEXT_BLUE
  420. #define  DISP_WINDOW_TXT_COLOR       TEXT_WHITE
  421.  
  422.  
  423. /*----------------------------------------------------------------*/
  424. /*                        Display_Window                          */
  425. /* This is the routine to display the window library source code. */
  426. /*----------------------------------------------------------------*/
  427. int Display_Window()
  428. {
  429.    /*---------------------------------------------------------*/
  430.    /* Display the source code using the help window facility. */
  431.    /*---------------------------------------------------------*/
  432.    HelpWindow(DISP_WINDOW_TOPY, DISP_WINDOW_TOPX, 
  433.         DISP_WINDOW_HEIGHT, DISP_WINDOW_WIDTH,
  434.         DISP_WINDOW_BK_COLOR, DISP_WINDOW_TXT_COLOR,
  435.         SINGLEBORDER,"Window Demonstration Source Code", "DEMOWIND.C");
  436.    return(0);
  437. }
  438.  
  439.  
  440.  
  441.  
  442.  
  443. #define  VIEW_WINDOW_TOPY                1
  444. #define  VIEW_WINDOW_TOPX                1
  445. #define  VIEW_WINDOW_HEIGHT             24
  446. #define  VIEW_WINDOW_WIDTH              80
  447. #define  VIEW_WINDOW_BK_COLOR        TEXT_BLUE
  448. #define  VIEW_WINDOW_TXT_COLOR       TEXT_BWHITE
  449.  
  450.  
  451. /*---------------------------------------------------*/
  452. /*               View_Window_Manual                  */
  453. /* This is the routine to display the window manual. */
  454. /*---------------------------------------------------*/
  455. int View_Window_Manual()
  456. {
  457.    /*----------------------------------------------------*/
  458.    /* Display the manual using the help window facility. */
  459.    /*----------------------------------------------------*/
  460.    HelpWindow(VIEW_WINDOW_TOPY, VIEW_WINDOW_TOPX, 
  461.         VIEW_WINDOW_HEIGHT, VIEW_WINDOW_WIDTH,
  462.         VIEW_WINDOW_BK_COLOR, VIEW_WINDOW_TXT_COLOR,
  463.         SINGLEBORDER,"VISIONS Window Manual", "VIS_WIND.TXT");
  464.    return(0);
  465. }
  466.  
  467.  
  468.  
  469.  
  470.  
  471. /*-------------------------------------*/
  472. /* Menu demonstration selection menus. */
  473. /*-------------------------------------*/
  474.  
  475. #define  MENU_DEMO_TOP_Y                11
  476. #define  MENU_DEMO_TOP_X                10
  477. #define  MENU_DEMO_HEIGHT                7
  478. #define  MENU_DEMO_WIDTH                25
  479. #define  MENU_DEMO_BK_COLOR         TEXT_BLUE
  480. #define  MENU_DEMO_TXT_COLOR        TEXT_WHITE
  481. #define  MENU_DEMO_HBK_COLOR        TEXT_WHITE
  482. #define  MENU_DEMO_HTXT_COLOR       TEXT_BLUE
  483.  
  484.  
  485.  
  486. /*---------------------------------------------------*/
  487. /*                  Menu_Demo                        */
  488. /* This is the menu demonstration menu.  The user    */
  489. /* may actually execute a demonstration, or view the */
  490. /* demonstration source code.                        */
  491. /*---------------------------------------------------*/
  492. int Menu_Demo()
  493. {
  494.    MENU_HEAD *new_menu;
  495.  
  496.    /*------------------------------------------------------*/
  497.    /*  First build the menu demonstration selection menu.  */
  498.    /*------------------------------------------------------*/
  499.    DefineMenu(&new_menu, MENU_DEMO_TOP_Y, MENU_DEMO_TOP_X,
  500.         MENU_DEMO_HEIGHT, MENU_DEMO_WIDTH, SINGLEBORDER, HOT_EXEC_ON,
  501.         MENU_DEMO_BK_COLOR, MENU_DEMO_TXT_COLOR, 
  502.         MENU_DEMO_HBK_COLOR, MENU_DEMO_HTXT_COLOR,
  503.         "VISIONS MENU LIBRARY DEMONSTRATION");
  504.  
  505.    AddToMenu(new_menu, "Run Menu Demonstration", 'R', 0, *Run_Menu);
  506.    AddToMenu(new_menu, "Display Menu Demonstration Source", 
  507.         'D', 0, *Display_Menu);
  508.    AddToMenu(new_menu, "View Menu Manual", 'V', 0, *View_Menu_Manual);
  509.    AddToMenu(new_menu, "Exit Menu Demonstration", 'E', 1, NULL);
  510.  
  511.    /*---------------------------------*/
  512.    /* Get and execute user selection. */
  513.    /*---------------------------------*/
  514.    AutoDisplayMenu(new_menu);
  515.  
  516.    /*---------------------------------*/
  517.    /* And return menu memory to heap. */
  518.    /*---------------------------------*/
  519.    DeleteMenu(new_menu);
  520.  
  521.    return(0);
  522. }
  523.  
  524.  
  525.  
  526.  
  527. #define  DISP_MENU_TOPY                1
  528. #define  DISP_MENU_TOPX                1
  529. #define  DISP_MENU_HEIGHT             24
  530. #define  DISP_MENU_WIDTH              80
  531. #define  DISP_MENU_BK_COLOR        TEXT_BLUE
  532. #define  DISP_MENU_TXT_COLOR       TEXT_WHITE
  533.  
  534.  
  535. /*--------------------------------------------------------------*/
  536. /*                      Display_Menu                            */
  537. /* This is the routine to display the menu library source code. */
  538. /*--------------------------------------------------------------*/
  539. int Display_Menu()
  540. {
  541.    /*---------------------------------------------------------*/
  542.    /* Display the source code using the help window facility. */
  543.    /*---------------------------------------------------------*/
  544.    HelpWindow(DISP_MENU_TOPY, DISP_MENU_TOPX, 
  545.         DISP_MENU_HEIGHT, DISP_MENU_WIDTH,
  546.         DISP_MENU_BK_COLOR, DISP_MENU_TXT_COLOR,
  547.         SINGLEBORDER,"Menu Demonstration Source Code", "DEMOMENU.C");
  548.    return(0);
  549. }
  550.  
  551.  
  552.  
  553. #define  VIEW_MENU_TOPY                1
  554. #define  VIEW_MENU_TOPX                1
  555. #define  VIEW_MENU_HEIGHT             24
  556. #define  VIEW_MENU_WIDTH              80
  557. #define  VIEW_MENU_BK_COLOR        TEXT_BLUE
  558. #define  VIEW_MENU_TXT_COLOR       TEXT_BWHITE
  559.  
  560.  
  561. /*-------------------------------------------------*/
  562. /*               View_Menu_Manual                  */
  563. /* This is the routine to display the menu manual. */
  564. /*-------------------------------------------------*/
  565. int View_Menu_Manual()
  566. {
  567.    /*----------------------------------------------------*/
  568.    /* Display the manual using the help window facility. */
  569.    /*----------------------------------------------------*/
  570.    HelpWindow(VIEW_MENU_TOPY, VIEW_MENU_TOPX, 
  571.         VIEW_MENU_HEIGHT, VIEW_MENU_WIDTH,
  572.         VIEW_MENU_BK_COLOR, VIEW_MENU_TXT_COLOR,
  573.         SINGLEBORDER,"VISIONS Menu Manual", "VIS_MENU.TXT");
  574.    return(0);
  575. }
  576.  
  577.  
  578.  
  579.  
  580. /*-------------------------------------*/
  581. /* Form demonstration selection menus. */
  582. /*-------------------------------------*/
  583.  
  584. #define  FORM_DEMO_TOP_Y                11
  585. #define  FORM_DEMO_TOP_X                10
  586. #define  FORM_DEMO_HEIGHT                7
  587. #define  FORM_DEMO_WIDTH                25
  588. #define  FORM_DEMO_BK_COLOR         TEXT_BLUE
  589. #define  FORM_DEMO_TXT_COLOR        TEXT_WHITE
  590. #define  FORM_DEMO_HBK_COLOR        TEXT_WHITE
  591. #define  FORM_DEMO_HTXT_COLOR       TEXT_BLUE
  592.  
  593.  
  594.  
  595. /*---------------------------------------------------*/
  596. /*                  Form_Demo                        */
  597. /* This is the form demonstration menu.  The user    */
  598. /* may actually execute a demonstration, or view the */
  599. /* demonstration source code.                        */
  600. /*---------------------------------------------------*/
  601. int Form_Demo()
  602. {
  603.    MENU_HEAD *new_menu;
  604.  
  605.    /*------------------------------------------------------*/
  606.    /*  First build the form demonstration selection menu.  */
  607.    /*------------------------------------------------------*/
  608.    DefineMenu(&new_menu, FORM_DEMO_TOP_Y, FORM_DEMO_TOP_X,
  609.         FORM_DEMO_HEIGHT, FORM_DEMO_WIDTH, SINGLEBORDER, HOT_EXEC_ON,
  610.         FORM_DEMO_BK_COLOR, FORM_DEMO_TXT_COLOR, 
  611.         FORM_DEMO_HBK_COLOR, FORM_DEMO_HTXT_COLOR,
  612.         "VISIONS FORM LIBRARY DEMONSTRATION");
  613.  
  614.    AddToMenu(new_menu, "Run Form Demonstration", 'R', 0, *Run_Form);
  615.    AddToMenu(new_menu, "Display Form Demonstration Source", 
  616.         'D', 0, *Display_Form);
  617.    AddToMenu(new_menu, "View Form Manual", 'V', 0, *View_Form_Manual);
  618.    AddToMenu(new_menu, "Exit Form Demonstration", 'E', 1, NULL);
  619.  
  620.    /*---------------------------------*/
  621.    /* Get and execute user selection. */
  622.    /*---------------------------------*/
  623.    AutoDisplayMenu(new_menu);
  624.  
  625.    /*---------------------------------*/
  626.    /* And return menu memory to heap. */
  627.    /*---------------------------------*/
  628.    DeleteMenu(new_menu);
  629.  
  630.    return(0);
  631. }
  632.  
  633.  
  634.  
  635.  
  636. #define  DISP_FORM_TOPY                1
  637. #define  DISP_FORM_TOPX                1
  638. #define  DISP_FORM_HEIGHT             24
  639. #define  DISP_FORM_WIDTH              80
  640. #define  DISP_FORM_BK_COLOR       TEXT_BLUE
  641. #define  DISP_FORM_TXT_COLOR      TEXT_WHITE
  642.  
  643.  
  644. /*--------------------------------------------------------------*/
  645. /*                       Display_Form                           */
  646. /* This is the routine to display the form library source code. */
  647. /*--------------------------------------------------------------*/
  648. int Display_Form()
  649. {
  650.    /*---------------------------------------------------------*/
  651.    /* Display the source code using the help window facility. */
  652.    /*---------------------------------------------------------*/
  653.    HelpWindow(DISP_FORM_TOPY, DISP_FORM_TOPX, 
  654.         DISP_FORM_HEIGHT, DISP_FORM_WIDTH,
  655.         DISP_FORM_BK_COLOR, DISP_FORM_TXT_COLOR,
  656.         SINGLEBORDER,"Form Demonstration Source Code", "DEMOFORM.C");
  657.    return(0);
  658. }
  659.  
  660.  
  661.  
  662. #define  VIEW_FORM_TOPY                1
  663. #define  VIEW_FORM_TOPX                1
  664. #define  VIEW_FORM_HEIGHT             24
  665. #define  VIEW_FORM_WIDTH              80
  666. #define  VIEW_FORM_BK_COLOR        TEXT_BLUE
  667. #define  VIEW_FORM_TXT_COLOR       TEXT_BWHITE
  668.  
  669.  
  670. /*-------------------------------------------------*/
  671. /*               View_Form_Manual                  */
  672. /* This is the routine to display the form manual. */
  673. /*-------------------------------------------------*/
  674. int View_Form_Manual()
  675. {
  676.    /*----------------------------------------------------*/
  677.    /* Display the manual using the help window facility. */
  678.    /*----------------------------------------------------*/
  679.    HelpWindow(VIEW_FORM_TOPY, VIEW_FORM_TOPX, 
  680.         VIEW_FORM_HEIGHT, VIEW_FORM_WIDTH,
  681.         VIEW_FORM_BK_COLOR, VIEW_FORM_TXT_COLOR,
  682.         SINGLEBORDER,"VISIONS Form Manual", "VIS_FORM.TXT");
  683.    return(0);
  684. }
  685.  
  686.