home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / window / mcwint20 / wtutor20.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-01-11  |  41.6 KB  |  1,234 lines

  1. #define USE_LOCAL
  2. #define TRUE           1
  3. #define FALSE          0
  4. #define ENTER          13
  5. #define ESCAPE         27
  6. #define RGTARROW       77
  7. #define LFTARROW       75
  8. #define HIDDEN_CURSOR  8192
  9.  
  10. #include <stdio.h>
  11. #include <conio.h>
  12. #include <alloc.h>
  13. #include <color.h>
  14. #include <w1.h>
  15. #include <windprot.h>
  16.  
  17. void         show_initial_screen(void);
  18. void         loop_the_loop(void);
  19. void         display_main_menu(void);
  20. void         display_window_menu(int *);
  21. void         display_misc_menu(int *);
  22. void         show_initwindow(int);
  23. void         show_makewindow(int);
  24. void         show_borders(void);
  25. void         show_removewindow(int);
  26. void         show_titlewindow(int);
  27. void         show_scrollwindow(int);
  28. void         show_specialeffects(int);
  29. void         show_maxwndw(int);
  30. void         show_qwik21(int);
  31. void         show_programming(int);
  32. void         show_ending(void);
  33. void         show_getstring(int);
  34. void         show_getinteger(int);
  35. void         show_getmenu(int);
  36. void         show_wsound(int);
  37. void         show_wsleep(int);
  38. void         show_introduction(int);
  39. void         show_autodemo(void);
  40. int          m_special(int,int*);
  41. void         main(void);
  42.  
  43. int s_row[14] = {2,2,2,2,2,8,14,20,20,20,20,20,14,8};
  44. int s_col[14] = {6,21,36,51,66,66,66,66,51,36,21,6,6,6};
  45. int n_rows    = 5;
  46. int n_cols    = 10;
  47. int auto_menu = 0;                    /* auto menu flag */
  48. int m_item    = 0;
  49.  
  50.     char *stra[33] = {
  51.         " WINDOWS and QUICK WRITE UTILITIES FOR C ",
  52.         "               Version 2.0               ",
  53.         "      (C) 87,88 Michael G. Mlachak       ",
  54.         "      (C) 87,88 Brian L. Cassista        ",
  55.         "   Fast - Small - Easy   ",
  56.         "        C H E A P        ",
  57.         "                         ",
  58.         " Supports many modes and ",
  59.         "      many monitors      ",
  60.         " To register a copy send $55 to the       ",
  61.         " above address. Registration includes     ",
  62.         " complete source code and printed manual. ",
  63.         " Libraries are available for Turbo-C,     ",
  64.         " Microsoft 4.0 and 5.0. All memory models ",
  65.         " are supported. If you do not wish to     ",
  66.         " become a registered user libraries for a ",
  67.         " specific model and compiler can be       ",
  68.         " obtained for $10 each. A printed bound   ",
  69.         " manual can also be obtained for $10.     ",
  70.         " Michael G. Mlachak   ",
  71.         " 4318 Stewart Court   ",
  72.         " East Chicago, IN.    ",
  73.         "              46312   ",
  74.         " WORK: (312)-407-5343 ",
  75.         " HOME: (219)-397-8952 ",
  76.         " CIS : 76327,1410     ",
  77.         " Brian L. Cassista    ",
  78.         " 165 South Floyd Lane ",
  79.         " Chicago Hts, IL.     ",
  80.         "              60411   ",
  81.         " WORK: (312)-407-5358 ",
  82.         " HOME: (312)-756-3567 "
  83.     };
  84.  
  85.     char *strb[2] = {
  86.        " Windows are as easy as 1, 2, 3....... ",
  87.        " The rest of this DEMO is menu driven. ",
  88.     };
  89.  
  90.     char *main_menu[10] = {
  91.        "General",
  92.        "Windows",
  93.        "Screen",
  94.        "Misc.",
  95.        "Auto Demo",
  96.        "Exit Demo",
  97.        " MC-WINDOWS (TURBO 1.0 DEMO)═════════════ <- -> - Select   Enter-Accept ",
  98.        " ",
  99.        ""
  100.     };
  101.  
  102.     char *strc[8] = {
  103.       "initwindow",
  104.       " ",
  105.       "FORMAT:   void initwindow (int windowattribute,",
  106.       "                           int clear_screen)",
  107.       "Initwindow initializes  several variables required  by  the",
  108.       "windowing package,  as well as selecting the foreground and",
  109.       "background colors of the initial screen display. Initwindow",
  110.       "must be called before using any of the other functions.    "};
  111.  
  112.     char *strd[17] = {
  113.       "makewindow",
  114.       " ",
  115.       "FORMAT:  void makewindow (int row,col,rows,cols,wattr,battr,",
  116.       "                                            BORDERS brdrsel);",
  117.       " ",
  118.       "Makewindow puts a new blank window on the display.  The window starts",
  119.       "at the upper left corner (row,col)  and extends for a number of  rows",
  120.       "and columns (rows,cols).   If a border exists, the actual  dimensions",
  121.       "of the TURBO C window will be 2 less than indicated in the makewindow",
  122.       "statement.  The border can be one of the following: (SEE w1.h)",
  123.       " ",
  124.       "   nobrdr     - just window       evensolidbrdr - evenly solid",
  125.       "   blankbrdr  - blank spaces      thinsolidbrdr - thin solid line",
  126.       "   singlebrdr - single line       lhatchbrdr - light hatch",
  127.       "   doublebrdr - double line       mhatchbrdr - medium hatch",
  128.       "   mixedbrdr  - single/double     hhatchbrdr - heavy hatch",
  129.       "   solidbrdr  - solid             userbrdr   - user defined border"};
  130.  
  131.     char *stre[18] = {
  132.       "removewindow",
  133.       "FORMAT:   void removewindow(void);",
  134.       " ",
  135.       "Removewindow removes the last window",
  136.       "remaining  on  the screen  from  the",
  137.       "makewindow function.",
  138.       "remove_windows",
  139.       "FORMAT:   void remove_windows(int);",
  140.       " ",
  141.       "Remove_windows removes the number of",
  142.       "windows specified. It checks to see ",
  143.       "if there are that amount to remove. ",
  144.       "remove_all_windows",
  145.       "FORMAT: void remove_all_windows(void);",
  146.       " ",
  147.       "Remove_all_windows removes all of   ",
  148.       "the currently displayed windows from",
  149.       "the makewindow function."};
  150.  
  151.     char *strf[2] = {
  152.       "See if your BIOS gives you flicker",
  153.       "when your screen rolls down next ..."};
  154.  
  155.     char *strg[19] = {
  156.       " ",
  157.       "    scrollwindow",
  158.       " ",
  159.       " ",
  160.       "FORMAT:  void scrollwindow (byte rowbegin,rowend byte; DIRTYPE dir);",
  161.       "",
  162.       "The BIOS scroll that was used for this call may have worked just fine",
  163.       "for this window.  However, if  your screen just had some bad flicker ",
  164.       "as it was scrolling down, your BIOS is not flicker-free.  To keep the",
  165.       "display flicker-free,  to work on other  video pages  or an EGA, then",
  166.       "you will need this function.  The upward  scroll, used scrollwindow, ",
  167.       "so no flicker was seen then.  It also scrolls partial windows.",
  168.       " ",
  169.       "The direction of the scroll can be any of the following:(SEE w1.h)",
  170.       " ",
  171.       "    'up'   - to scroll up",
  172.       "    'down' - to scroll down",
  173.       " ",
  174.       " "};
  175.  
  176.     char *strh[7] = {
  177.       "titlewindow",
  178.       "FORMAT: void titlewindow(justify,title,attr);",
  179.       "        enum DIRTYPE justify; char title[80]",
  180.       "        int attr                            ",
  181.       "Titlewindow places a title in the top border",
  182.       "of the current window.  Justify permits left,",
  183.       "center or right justification of the title."};
  184.  
  185.     char *stri[17] = {
  186.       "There are now two special effects that can",
  187.       "enhance the window display:",
  188.       "   zoomeffect   - emulates the MACINTOSH.",
  189.       "   shadoweffect - places a left or right",
  190.       "              shadow underneath the menu.",
  191.       "These global variables can be placed anywhere",
  192.       "in your program.  zoomeffect is INT while",
  193.       "shadoweffect is of DIRTYPE.",
  194.       "CGA:",
  195.       "The CGA is self-regulating and controls the",
  196.       "zoom rate.",
  197.       "MDA and EGA:",
  198.       "These video cards are quite fast and need a",
  199.       "delay for the effect.  A default value of 11",
  200.       "milliseconds is used in a global INT",
  201.       "named 'zoomdelay' and shouldn't need any",
  202.       "adjustment."};
  203.  
  204.     char *strj[5] = {
  205.       " The maximum  number  of windows that",
  206.       " may be on the screen at any one time",
  207.       " is   specified   by   the   constant",
  208.       " \"MAXWNDW\".The compiled library uses",
  209.       " this value so do NOT change it......"};
  210.  
  211.     char *strk[9] = {
  212.       " In addition to windows, there are 13 powerful",
  213.       " Qwik-Write screen functions  you can use:",
  214.       "      qwritelv   qattr      qpage",
  215.       "      qwrite     qattrc     qwritepage",
  216.       "      qwritec    gotorc     cursorchange",
  217.       "      qfillc     qstore               ",
  218.       "      qfill      qrestore                ",
  219.       " In MCWINM20.ARC, compile and run QDEMO20.C to",
  220.       " see all of these features."};
  221.  
  222.     char *strl[21] = {
  223.       " The functions are used as follows:",
  224.       "",
  225.       "  ....Your include files....",
  226.       "  #include <w1.h> ",
  227.       "  #include <windprot.h> ",
  228.       "  #include <color.h> ",
  229.       "  ...Your variables and functions...",
  230.       "  main(argc,argv)",
  231.       "    {",
  232.       "    initwindow (windowattribute,clear_screen);",
  233.       "    makewindow (row,col,rows,cols,wattr,battr,",
  234.       "                                     brdrsel);",
  235.       "    titlewindow (justify,'the window title',",
  236.       "                                 attribute);",
  237.       "    removewindow();",
  238.       "    }",
  239.       "  end.",
  240.       " ",
  241.       " { Use one removewindow for each makewindow. }",
  242.       " { IMPORTANT: Remember to link in the proper }",
  243.       " {            T1xWIN20.lib library .         }"};
  244.  
  245.     char *strm[7] = {
  246.       "   If you have any questions or comments, please write to,   ",
  247.       "   or drop a note (CIS:)                                     ",
  248.       "              (SOURCE CODE AVAILABLE for $25)                ",
  249.       "     Michael G. Mlachak               Brian L. Cassista      ",
  250.       "     4318 Stewart Court.              165 South Floyd Lane   ",
  251.       "     East Chicago, IN 46312           Chicago Heights, IL    ",
  252.       "     CIS - 76327,1410                          60411         "};
  253.  
  254.     char *strn[9] = {
  255.       "get_string",
  256.       "FORMAT:  char *get_string(default_string, row, col, attr,",
  257.       "                          max_str_length, caps_lock,",
  258.       "                          char_types, mask_string, term_str,",
  259.       "                          pad_char, &term_char);",
  260.       " ",
  261.       "Get_string allows you to get string input from the user",
  262.       "with total control of how it appears and terminates as",
  263.       "well as various validity checks."};
  264.  
  265.     char *stro[10] = {
  266.       "get_integer",
  267.       "FORMAT:  int get_integer(default_integer, row, col, attr,",
  268.       "                          min_int_val, max_int_val",
  269.       "                          prompt_string, term_str,",
  270.       "                          &term_char);",
  271.       " ",
  272.       "Get_integer allows you to get integer input, as would a",
  273.       "calculator (push integers left), from the user with",
  274.       "total control of how it appears and terminates as well",
  275.       "as various validity checks."};
  276.  
  277.     char *strp[14] = {
  278.       "get_menu",
  279.       "FORMAT:  int get_menu(row, col, rows, cols, attr, inverse_attr,",
  280.       "                       brdr_attr, display_items, term_string",
  281.       "                       spacing, force_vertical, border_type,",
  282.       "                       title_pos, &last_item, clear_window,",
  283.       "                       special_function);",
  284.       " ",
  285.       "Get_menu allows you build a menuing system. It displays",
  286.       "items to the screen in vertical or horizontal fashion",
  287.       "allowing cursor movement to each item. The window depth",
  288.       "is dynamically built based on the number of items and ",
  289.       "the number of columns to be displayed.",
  290.       " ",
  291.       "*** THE MENUS FOR THIS DEMO ARE DONE WITH GET_MENU() ***"};
  292.  
  293.     char *strq[6] = {
  294.       "wsound",
  295.       "FORMAT:  void wsound(freq, duration);",
  296.       "              unsigned freq, duration",
  297.       " ",
  298.       "Turns the speaker on at the given ",
  299.       "frequency for the specified duration."};
  300.  
  301.     char *strr[8] = {
  302.       "wsleep",
  303.       "FORMAT:  unsigned wsleep(period);",
  304.       "              unsigned period",
  305.       " ",
  306.       "Suspends a process for the number of",
  307.       "timer ticks specified.",
  308.       " ",
  309.       "*** USED THROUGH OUT THIS DEMO ***"};
  310.  
  311.     char *intro[16] = {
  312.       " ",
  313.       "The windowing functions in  the file  T1SWIN20.LIB",
  314.       "are  a  set of copyrighted  routines  that  allow ",
  315.       "Turbo C to create incredibly  fast multi-level    ",
  316.       "windows.   Created  under  the  shareware concept,",
  317.       "T1SWIN20.LIB makes use of the quick screen writing",
  318.       "utilities  of Jim H. LeMay -- which were converted",
  319.       "from Turbo Pascal inline to external assembly. The",
  320.       "windows may  be  of any  size  (from 2x2 to screen",
  321.       "limits)  and  color  and  may  have one of several",
  322.       "different  border  styles and colors including  no",
  323.       "border.  They  also   work   in any   column  mode",
  324.       "40/80/etc.  These routines automatically configure",
  325.       "to your video card and  video  mode. All of  these",
  326.       "routines were converted from Turbo Pascal to Turbo",
  327.       "C, (SMALL MODEL) with the authors permission.     "};
  328.  
  329.     char *window_menu[11] = {
  330.       "initwindow()   ",
  331.       "makewindow()   ",
  332.       "scrollwindow() ",
  333.       "removewindow() ",
  334.       "titlewindow()  ",
  335.       "special effects",
  336.       "window limits  ",
  337.       "sample call    ",
  338.       "╤══════════════════╤",
  339.       "   - select ",
  340.       ""};
  341.  
  342.     char *misc_menu[8] = {
  343.       "get_string()   ",
  344.       "get_integer()  ",
  345.       "get_menu()     ",
  346.       "wsound()       ",
  347.       "wsleep()       ",
  348.       "╤══════════════════╤",
  349.       "   - select ",
  350.       ""};
  351.  
  352. void main(void) {
  353.    oldcursor = cursorchange(HIDDEN_CURSOR);
  354.    show_initial_screen();
  355.    loop_the_loop();
  356.    display_main_menu();
  357.    oldcursor = cursorchange(oldcursor);
  358. }  /* main() */
  359.  
  360.  
  361. void show_initial_screen(void) {
  362.    int          loop,
  363.                 norm_attr, brdr_attr, hilt_attr;
  364.  
  365.    if (qseg == 0xB800) {
  366.       norm_attr = wiattr(BLUE, CYAN);
  367.       brdr_attr = wiattr(WHITE, BLUE);
  368.       hilt_attr = wiattr(CYAN, BLUE);
  369.    }
  370.    else {
  371.       norm_attr = wiattr(BLACK, LIGHTGRAY);
  372.       brdr_attr = wiattr(WHITE, LIGHTGRAY);
  373.       hilt_attr = wiattr(WHITE, BLACK);
  374.    }
  375.    initwindow(norm_attr,TRUE);
  376.    zoomeffect   = TRUE;
  377.    shadoweffect = bottomright;
  378.    makewindow(1, 19, 6, 44, hilt_attr, brdr_attr, mixedbrdr);
  379.    for (loop = 0; loop < 4; loop++)
  380.       window_write(-1, stra[loop]);
  381.    shadoweffect = bottomright;
  382.    makewindow(8, 19, 16, 44, hilt_attr, brdr_attr, doublebrdr);
  383.    active_window_row +=4;
  384.    for (loop = 9; loop < 19; loop++)
  385.       window_write(-1, stra[loop]);
  386.    shadoweffect = nodir;
  387.    makewindow(6, 26, 7, 28, hilt_attr, brdr_attr, singlebrdr);
  388.    for (loop = 4; loop < 9; loop++)
  389.       window_write(-1, stra[loop]);
  390.    makewindow(4, 55, 9, 24, hilt_attr, brdr_attr, singlebrdr);
  391.    for (loop = 19; loop < 26; loop++)
  392.       window_write(-1, stra[loop]);
  393.    makewindow(4, 1, 9, 24, hilt_attr, brdr_attr, singlebrdr);
  394.    for (loop = 26; loop < 32; loop++)
  395.       window_write(-1, stra[loop]);
  396.    wsleep(250);
  397.    remove_windows(5);
  398. } /* show_initial_screen */
  399.  
  400. void loop_the_loop(void) {
  401.    int          loop,
  402.                 norm_attr, brdr_attr;
  403.  
  404.    if (qseg == 0xB800) {
  405.       norm_attr = wiattr(MAGENTA, CYAN);
  406.       brdr_attr = wiattr(CYAN, RED);
  407.    }
  408.    else {
  409.       norm_attr = wiattr(WHITE, BLACK);
  410.       brdr_attr = wiattr(WHITE, LIGHTGRAY);
  411.    }
  412.    for(loop = 0; loop <= 13; loop++) {
  413.       makewindow(s_row[loop], s_col[loop], n_rows, n_cols,
  414.                  norm_attr, brdr_attr, mixedbrdr);
  415.       window_printf(-1, "1-WINDOW\n2-WINDOW\n3-WINDOW");
  416.    }
  417.    remove_windows(14);
  418.    for(loop = 13; loop >= 0; loop--) {
  419.       makewindow(s_row[loop], s_col[loop], n_rows, n_cols,
  420.                  norm_attr, brdr_attr, mixedbrdr);
  421.       window_printf(-1, "1-WINDOW\n2-WINDOW\n3-WINDOW");
  422.    }
  423.    remove_windows(14);
  424.    for(loop = 0; loop < 14; loop++) {
  425.       makewindow(s_row[loop], s_col[loop], n_rows, n_cols,
  426.                  norm_attr, brdr_attr, mixedbrdr);
  427.       window_printf(-1,"1-WINDOW\n2-WINDOW\n3-WINDOW");
  428.    }
  429.    makewindow(7, 16, 13, 50, norm_attr, brdr_attr, singlebrdr);
  430.    makewindow(9, 18, 9, 46,  norm_attr, brdr_attr, solidbrdr);
  431.    makewindow(11, 20, 5, 42,  norm_attr, brdr_attr, mhatchbrdr);
  432.    for (loop = 0; loop < 2; loop ++)
  433.       window_write(-1, strb[loop]);
  434.    wsleep(150);
  435.    remove_windows(17);
  436. }  /* loop_the_loop */
  437.  
  438. void display_main_menu(void) {
  439.    int          m_item = 0,
  440.                 norm_attr, hilt_attr, brdr_attr,
  441.                 done = FALSE;
  442.    char         *m_tstring;
  443.  
  444.    if (qseg == 0xB800) {
  445.       norm_attr = wiattr(YELLOW, BLUE);
  446.       hilt_attr = wiattr(WHITE, RED);
  447.       brdr_attr = wiattr(WHITE, BLUE);
  448.    }
  449.    else {
  450.       norm_attr = wiattr(WHITE, BLACK);
  451.       hilt_attr = wiattr(BLACK, LIGHTGRAY);
  452.       brdr_attr = wiattr(WHITE, BLACK);
  453.    }
  454.    zoomeffect = FALSE;
  455.    m_tstring = (char *)calloc(1, (2 * sizeof(char)));
  456.    qfill(1, 1, 25, 80, hilt_attr, (unsigned char)' ');
  457.    do {
  458.       if (get_menu(1, 1, 3, 80, norm_attr, hilt_attr, brdr_attr,
  459.                    main_menu, m_tstring, 3, FALSE, doublebrdr,
  460.                    topleft, &m_item, FALSE, m_special) == ESCAPE) {
  461.          done = FALSE;
  462.          removewindow();
  463.       }
  464.       else {
  465.          switch (m_item) {
  466.             case 0  : /* General */
  467.                show_introduction(FALSE);
  468.                removewindow();
  469.             break;
  470.             case 1  : /* Windows */
  471.                display_window_menu(&m_item);
  472.                removewindow();
  473.             break;
  474.             case 2  : /* Screen */
  475.                shadoweffect = bottomright;
  476.                zoomeffect   = TRUE;
  477.                show_qwik21(FALSE);
  478.                while (getch() != ENTER);
  479.                removewindow();
  480.                shadoweffect = nodir;
  481.                zoomeffect   = FALSE;
  482.             break;
  483.             case 3  : /* Misc. */
  484.                display_misc_menu(&m_item);
  485.                removewindow();
  486.             break;
  487.             case 4  : /* Auto Demo */
  488.                show_autodemo();
  489.                remove_all_windows();
  490.                zoomeffect   = FALSE;
  491.                shadoweffect = nodir;
  492.             break;
  493.             case 5  : /* Exit Demo */
  494.                shadoweffect = bottomright;
  495.                zoomeffect   = TRUE;
  496.                show_ending();
  497.                wsleep(150);
  498.                removewindow();
  499.                shadoweffect = nodir;
  500.                zoomeffect   = FALSE;
  501.                done = TRUE;
  502.                remove_all_windows();
  503.             break;
  504.             default :
  505.             break;
  506.          } /* switch (m_item) */
  507.       }
  508.    } while(!done);
  509.    free(m_tstring);
  510. } /* display_main_menu() */
  511.  
  512. void         show_introduction(int auto_demo) {
  513.    int         index,
  514.                norm_attr, brdr_attr;
  515.  
  516.    if (qseg == 0xB800) {
  517.       norm_attr = wiattr(BLACK, GREEN);
  518.       brdr_attr = wiattr(LIGHTGREEN, GREEN);
  519.    }
  520.    else {
  521.       norm_attr = wiattr(BLACK, LIGHTGRAY);
  522.       brdr_attr = wiattr(WHITE, LIGHTGRAY);
  523.    }
  524.    shadoweffect = bottomright;
  525.    zoomeffect = TRUE;
  526.    makewindow(4, 1, 19, 52, norm_attr, brdr_attr, mixedbrdr);
  527.    for (index = 0; index <= 15; index++)
  528.       window_write(-1, intro[index]);
  529.    if (!auto_demo)
  530.       titlewindow(bottomcenter, " Enter - Returns to main menu ", -1);
  531.    shadoweffect = nodir;
  532.    if (!auto_demo) {
  533.       while ( getch() != ENTER );
  534.       removewindow();
  535.    }
  536.    zoomeffect = FALSE;
  537. }  /* show_introduction() */
  538.  
  539. void         display_window_menu(int *main_menu_item) {
  540.    int         done=FALSE,
  541.                w_tchar,
  542.                norm_attr, hilt_attr, brdr_attr,
  543.                w_item = 0;
  544.    char        w_tstring[3];
  545.  
  546.    if (qseg == 0xB800) {
  547.       norm_attr = wiattr(YELLOW, BLUE);
  548.       hilt_attr = wiattr(LIGHTBLUE, RED);
  549.       brdr_attr = wiattr(WHITE, BLUE);
  550.    }
  551.    else {
  552.       norm_attr = wiattr(LIGHTGRAY, BLACK);
  553.       hilt_attr = wiattr(WHITE, BLACK);
  554.       brdr_attr = wiattr(WHITE, BLACK);
  555.    }
  556.    sprintf(w_tstring,"%c%c", RGTARROW, LFTARROW);
  557.    do {
  558.       shadoweffect = bottomright;
  559.       w_tchar = get_menu(3, 13, 10, 20, norm_attr, hilt_attr, brdr_attr,
  560.                    window_menu, w_tstring, 0, TRUE, mixedbrdr,
  561.                    topcenter, &w_item, TRUE, m_special);
  562.       if ( (w_tchar != ESCAPE)&&(w_tchar != RGTARROW)&&(w_tchar != LFTARROW) ) {
  563.          switch (w_item) {
  564.             case 0  :  /* initwindow() */
  565.                show_initwindow(FALSE);
  566.                while (getch() != ENTER);
  567.                removewindow();
  568.             break;
  569.             case 1  :  /* makewindow() */
  570.                show_makewindow(FALSE);
  571.                while (getch() != ENTER);
  572.                makewindow(18, 22, 4, 45, norm_attr, brdr_attr, mixedbrdr);
  573.                window_write(-1, "Here are some sample window borders. To");
  574.                window_write(-1, "see how they are removed see removewindow.");
  575.                shadoweffect = nodir;
  576.                show_borders();
  577.                wsleep(150);
  578.                remove_windows(10);
  579.                shadoweffect = bottomright;
  580.                remove_windows(2);
  581.             break;
  582.             case 2  :  /* scrollwindow() */
  583.                show_scrollwindow(FALSE);
  584.                while (getch() != ENTER);
  585.                removewindow();
  586.             break;
  587.             case 3  :  /* removewindow() */
  588.                shadoweffect = nodir;
  589.                show_removewindow(FALSE);
  590.                while (getch() != ENTER);
  591.                removewindow();
  592.                makewindow(18, 22, 3, 35, norm_attr, brdr_attr, mixedbrdr);
  593.                window_write(-1, "Here are some sample windows.");
  594.                show_borders();
  595.                wsleep(150);
  596.                makewindow(21, 12, 3, 40, norm_attr, brdr_attr, mixedbrdr);
  597.                window_write(-1, "Don't blink they might disappear.");
  598.                wsleep(150);
  599.                remove_windows(15);
  600.                shadoweffect = bottomright;
  601.             break;
  602.             case 4  :  /* titlewindow() */
  603.                show_titlewindow(FALSE);
  604.                while (getch() != ENTER);
  605.                removewindow();
  606.             break;
  607.             case 5 :  /* special effects */
  608.               shadoweffect = nodir;
  609.               show_specialeffects(FALSE);
  610.               while(getch() != ENTER);
  611.               remove_windows(3);
  612.               shadoweffect = bottomright;
  613.             break;
  614.             case 6 :  /* window limits */
  615.                show_maxwndw(FALSE);
  616.                while (getch() != ENTER);
  617.                removewindow();
  618.             break;
  619.             case 7 :  /* sample call */
  620.                show_programming(FALSE);
  621.                while (getch() != ENTER);
  622.                removewindow();
  623.             break;
  624.             default :
  625.             break;
  626.          }  /* switch(w_item) */
  627.       }
  628.       else {
  629.          if (w_tchar ==  RGTARROW)
  630.             (*main_menu_item)++;
  631.          else
  632.             if (w_tchar ==  LFTARROW)
  633.                (*main_menu_item)--;
  634.          done = TRUE;
  635.       }
  636.    } while(!done);
  637.    shadoweffect = nodir;
  638. }  /* display_window_menu() */
  639.  
  640. void         display_misc_menu(int *main_menu_item) {
  641.    int         done=FALSE,
  642.                term_char,
  643.                default_int=123,
  644.                norm_attr, hilt_attr, brdr_attr, spec_attr,
  645.                msc_tchar,
  646.                msc_item = 0;
  647.    char        msc_tstring[3],
  648.                *default_str, *term_str;
  649.  
  650.    if (qseg == 0xB800) {
  651.       norm_attr = wiattr(YELLOW, BLUE);
  652.       hilt_attr = wiattr(LIGHTBLUE, RED);
  653.       brdr_attr = wiattr(WHITE, BLUE);
  654.       spec_attr = wiattr(GREEN, RED);
  655.    }
  656.    else {
  657.       norm_attr = wiattr(LIGHTGRAY, BLACK);
  658.       hilt_attr = wiattr(WHITE, BLACK);
  659.       brdr_attr = wiattr(WHITE, BLACK);
  660.       spec_attr = wiattr(WHITE, LIGHTGRAY);
  661.    }
  662.    sprintf(msc_tstring,"%c%c", RGTARROW, LFTARROW);
  663.    do {
  664.       shadoweffect = bottomright;
  665.       msc_tchar = get_menu(3, 32, 7, 20, norm_attr, hilt_attr, brdr_attr,
  666.                    misc_menu, msc_tstring, 0, TRUE, mixedbrdr,
  667.                    topcenter, &msc_item, TRUE, m_special);
  668.       if ( (msc_tchar != ESCAPE)&&(msc_tchar != RGTARROW)&&(msc_tchar != LFTARROW) ) {
  669.          switch (msc_item) {
  670.             case 0  :  /* get_string() */
  671.                show_getstring(FALSE);
  672.                while (getch() != ENTER);
  673.                default_str  = (char *)calloc(1, (25 * sizeof(char)));
  674.                term_str     = (char *)calloc(1, sizeof(char));
  675.                makewindow(5, 5, 5, 30, hilt_attr, brdr_attr, mhatchbrdr);
  676.                titlewindow(topcenter, " Enter your name : ", -1);
  677.                get_string(default_str, 7, 7, spec_attr, 25, TRUE,
  678.                            3, TRUE, term_str, (char)'_', &term_char);
  679.                titlewindow(bottomcenter, " You just used get_string ", -1);
  680.                wsleep(150);
  681.                remove_windows(2);
  682.                free(default_str);
  683.                free(term_str);
  684.             break;
  685.             case 1  :  /* get_integer() */
  686.                show_getinteger(FALSE);
  687.                while (getch() != ENTER);
  688.                term_str = (char *)calloc(1, sizeof(char));
  689.                makewindow(15, 35, 3, 31, hilt_attr, brdr_attr, thinsolidbrdr);
  690.                get_integer(default_int, 16, 37, spec_attr, 0, 32000,
  691.                             "Enter an integer : ", term_str, &term_char);
  692.                titlewindow(bottomcenter, " You just used get_integer ", -1);
  693.                wsleep(150);
  694.                remove_windows(2);
  695.                free(term_str);
  696.             break;
  697.             case 2  :  /* get_menu() */
  698.                show_getmenu(FALSE);
  699.                while (getch() != ENTER);
  700.                removewindow();
  701.             break;
  702.             case 3  :  /* wsound() */
  703.                show_wsound(FALSE);
  704.                while (getch() != ENTER);
  705.                removewindow();
  706.             break;
  707.             case 4  :  /* wsleep() */
  708.                show_wsleep(FALSE);
  709.                while (getch() != ENTER);
  710.                removewindow();
  711.             break;
  712.             default :
  713.             break;
  714.          }  /* switch(msc_item) */
  715.       }
  716.       else {
  717.          if (msc_tchar ==  RGTARROW)
  718.             (*main_menu_item)++;
  719.          else
  720.             if (msc_tchar ==  LFTARROW)
  721.                (*main_menu_item)--;
  722.          done = TRUE;
  723.       }
  724.    } while(!done);
  725.    shadoweffect = nodir;
  726. }  /* display_misc_menu() */
  727.  
  728. void       show_autodemo(void) {
  729.    int     default_int=123, spec_attr, hilt_attr, brdr_attr, term_char;
  730.    char   *default_str, *term_str;
  731.  
  732.    if (qseg == 0xB800) {
  733.       hilt_attr = wiattr(LIGHTBLUE, RED);
  734.       brdr_attr = wiattr(WHITE, BLUE);
  735.       spec_attr = wiattr(GREEN, RED);
  736.    }
  737.    else {
  738.       hilt_attr = wiattr(WHITE, BLACK);
  739.       brdr_attr = wiattr(WHITE, BLACK);
  740.       spec_attr = wiattr(WHITE, LIGHTGRAY);
  741.    }
  742.    show_introduction(TRUE);
  743.    wsleep(250);
  744.  
  745.    show_initwindow(TRUE);
  746.    wsleep(150);
  747.  
  748.    show_makewindow(TRUE);
  749.    wsleep(250);
  750.    shadoweffect = nodir;
  751.    show_borders();
  752.    wsleep(100);
  753.  
  754.    show_removewindow(TRUE);
  755.    wsleep(200);
  756.    remove_windows(13);
  757.    shadoweffect = bottomright;
  758.  
  759.    show_scrollwindow(TRUE);
  760.    wsleep(200);
  761.  
  762.    show_titlewindow(TRUE);
  763.    wsleep(150);
  764.  
  765.    shadoweffect = nodir;
  766.    show_specialeffects(TRUE);
  767.    wsleep(200);
  768.    shadoweffect = bottomright;
  769.  
  770.    show_maxwndw(TRUE);
  771.    wsleep(150);
  772.  
  773.    zoomeffect = TRUE;
  774.    show_qwik21(TRUE);
  775.    wsleep(150);
  776.    zoomeffect = FALSE;
  777.  
  778.    show_programming(TRUE);
  779.    wsleep(150);
  780.  
  781.    show_getstring(TRUE);
  782.    wsleep(150);
  783.    default_str  = (char *)calloc(1, (25 * sizeof(char)));
  784.    term_str     = (char *)calloc(1, sizeof(char));
  785.    makewindow(5, 5, 5, 30, hilt_attr, brdr_attr, mhatchbrdr);
  786.    titlewindow(topcenter, " Enter your name : ", -1);
  787.    get_string(default_str, 7, 7, spec_attr, 25, TRUE,
  788.                3, TRUE, term_str, (char)'_', &term_char);
  789.    titlewindow(bottomcenter, " You just used get_string ", -1);
  790.    wsleep(150);
  791.    free(default_str);
  792.  
  793.    show_getinteger(TRUE);
  794.    wsleep(150);
  795.    term_str = (char *)calloc(1, sizeof(char));
  796.    makewindow(15, 35, 3, 31, hilt_attr, brdr_attr, thinsolidbrdr);
  797.    get_integer(default_int, 16, 37, spec_attr, 0, 32000,
  798.                 "Enter an integer : ", term_str, &term_char);
  799.    titlewindow(bottomcenter, " You just used get_integer ", -1);
  800.    wsleep(150);
  801.    free(term_str);
  802.  
  803.    show_getmenu(TRUE);
  804.    wsleep(175);
  805.  
  806.    show_wsound(TRUE);
  807.    wsleep(100);
  808.  
  809.    show_wsleep(TRUE);
  810.    wsleep(100);
  811. }  /* show_autodemo() */
  812.  
  813. void         show_scrollwindow(int auto_demo) {
  814.    int         index,
  815.                norm_attr, spec_attr;
  816.  
  817.    if (qseg == 0xB800) {
  818.       norm_attr = wiattr(BLACK, BROWN);
  819.       spec_attr = wiattr(LIGHTMAGENTA, BLUE);
  820.    }
  821.    else {
  822.       norm_attr = wiattr(BLACK, LIGHTGRAY);
  823.       spec_attr = wiattr(WHITE, LIGHTGRAY);
  824.    }
  825.    /*  -- ScrollWindow description --  */
  826.      if (!auto_demo) {
  827.         show_makewindow(FALSE);
  828.         titlewindow(clearbottom, "", -1);
  829.      }
  830.      zoomeffect = TRUE;
  831.      shadoweffect = bottomright;
  832.      makewindow(11, 22, 4, 40, norm_attr, norm_attr, mixedbrdr);
  833.      for (index = 0; index <= 1; index++ )
  834.        window_write(-1, strf[index]);
  835.      wsleep(100);
  836.      removewindow();
  837.      shadoweffect = nodir;
  838.  
  839.      gotorc(active_window_row, active_window_col);
  840.      for (index = 0; index <= 18; index++)
  841.         window_bios_scroll(8,5,76,22,spec_attr);
  842.  
  843.      for (index = 0; index <= 18; index++) {
  844.         scrollwindow(1, 19, up);
  845.         qwrite(active_window_row + 18, active_window_col, -1, strg[index]);
  846.      }
  847.      if (!auto_demo)
  848.         titlewindow(bottomcenter, " Enter - Returns to sub menu ", -1);
  849.      zoomeffect = FALSE;
  850. }  /* show_scrollwindow() */
  851.  
  852. void         show_makewindow(int auto_demo) {
  853.    int         index,
  854.                norm_attr, brdr_attr, spec_attr, spc1_attr, spc2_attr;
  855.  
  856.    if (qseg == 0xB800) {
  857.       norm_attr = wiattr(LIGHTMAGENTA, BLUE);
  858.       brdr_attr = wiattr(LIGHTMAGENTA, BLUE);
  859.       spec_attr = wiattr(YELLOW, RED);
  860.       spc1_attr = wiattr(LIGHTRED, BLUE);
  861.       spc2_attr = wiattr(YELLOW, BLUE);
  862.    }
  863.    else {
  864.       norm_attr = wiattr(BLACK, LIGHTGRAY);
  865.       brdr_attr = wiattr(WHITE, LIGHTGRAY);
  866.       spec_attr = norm_attr;
  867.       spc1_attr = norm_attr;
  868.       spc2_attr = norm_attr;
  869.    }
  870.    zoomeffect = TRUE;
  871.    makewindow(4, 7, 21, 71, norm_attr, brdr_attr, solidbrdr);
  872.    window_write(spec_attr, strd[0]);
  873.    for (index = 1; index <= 3; index++ )
  874.      window_write(spc1_attr, strd[index]);
  875.    for (index = 4; index <= 16; index++ )
  876.      window_write(spc2_attr, strd[index]);
  877.    if (!auto_demo)
  878.       titlewindow(bottomcenter, " Enter - Returns to sub menu ", -1);
  879.    zoomeffect = FALSE;
  880. }  /* show_makewindow() */
  881.  
  882. void         show_borders(void) {
  883.    int         index,
  884.                norm_attr, brdr_attr;
  885.  
  886.    if (qseg == 0xB800) {
  887.       norm_attr = wiattr(YELLOW, GREEN);
  888.       brdr_attr = wiattr(YELLOW, GREEN);
  889.    }
  890.    else {
  891.       norm_attr = wiattr(LIGHTGRAY, BLACK);
  892.       brdr_attr = wiattr(WHITE, BLACK);
  893.    }
  894.    /*  -- Show different borders --  */
  895.    for (index = 1; index <= 5; index++)
  896.      makewindow(2 + 2 * index, 13 + 3 * index, 5, 10, norm_attr,
  897.                 brdr_attr, (enum BORDERS)index);
  898.    for (index = 6; index < 11; index++)
  899.      makewindow(24 - 2 * index, 24 + 3 * index, 5, 10,
  900.                 norm_attr, brdr_attr, (enum BORDERS)index);
  901. }  /* show_borders() */
  902.  
  903. void         show_initwindow(int auto_demo) {
  904.    int         index,
  905.                norm_attr, spec_attr, spc1_attr, spc2_attr;
  906.  
  907.    if (qseg == 0xB800) {
  908.       norm_attr = wiattr(YELLOW, RED);
  909.       spec_attr = wiattr(BLUE, MAGENTA);
  910.       spc1_attr = wiattr(CYAN, RED);
  911.       spc2_attr = wiattr(WHITE, RED);
  912.    }
  913.    else {
  914.       norm_attr = wiattr(BLACK, LIGHTGRAY);
  915.       spec_attr = norm_attr;
  916.       spc1_attr = norm_attr;
  917.       spc2_attr = norm_attr;
  918.    }
  919.    zoomeffect = TRUE;
  920.    makewindow(11, 15, 12, 63, norm_attr, norm_attr, singlebrdr);
  921.    window_write(spec_attr, strc[0]);
  922.    for (index = 1; index <= 3; index++ )
  923.      window_write(spc1_attr, strc[index]);
  924.    for (index = 4; index <= 7; index++ )
  925.      window_write(spc2_attr, strc[index]);
  926.    if (!auto_demo)
  927.       titlewindow(bottomcenter, " Enter - Returns to sub menu ", -1);
  928.    zoomeffect = FALSE;
  929. }  /* show_initwindow() */
  930.  
  931. void         show_removewindow(int auto_demo) {
  932.    int         index,
  933.                norm_attr, spec_attr, spc1_attr, spc2_attr;
  934.  
  935.    if (qseg == 0xB800) {
  936.       norm_attr = wiattr(BLACK, BROWN);
  937.       spec_attr = wiattr(WHITE, MAGENTA);
  938.       spc1_attr = wiattr(YELLOW, BROWN);
  939.       spc2_attr = wiattr(WHITE, BROWN);
  940.    }
  941.    else {
  942.       norm_attr = wiattr(BLACK, LIGHTGRAY);
  943.       spec_attr = norm_attr;
  944.       spc1_attr = norm_attr;
  945.       spc2_attr = norm_attr;
  946.    }
  947.    zoomeffect = TRUE;
  948.    makewindow(4, 1, 8, 40, norm_attr, norm_attr, doublebrdr);
  949.    window_write(spec_attr, stre[0]);
  950.    window_write(spc1_attr, stre[1]);
  951.    for (index = 2; index <= 5; index++ )
  952.      window_write(spc2_attr, stre[index]);
  953.    makewindow(8, 42, 8, 38, norm_attr, norm_attr, doublebrdr);
  954.    window_write(spec_attr, stre[6]);
  955.    window_write(spc1_attr, stre[7]);
  956.    for (index = 8; index <= 11; index++ )
  957.      window_write(spc2_attr, stre[index]);
  958.    makewindow(13, 1, 8, 40, norm_attr, norm_attr, doublebrdr);
  959.    window_write(spec_attr, stre[12]);
  960.    window_write(spc1_attr, stre[13]);
  961.    for (index = 14; index <= 17; index++ )
  962.      window_write(spc2_attr, stre[index]);
  963.    if (!auto_demo) {
  964.       makewindow(19, 45, 3, 31, norm_attr, norm_attr, hhatchbrdr);
  965.       window_write(spec_attr, "Enter - Returns to sub menu");
  966.    }
  967.    zoomeffect = FALSE;
  968. }  /* show_removewindow() */
  969.  
  970. void         show_titlewindow(int auto_demo) {
  971.    int         index,
  972.                norm_attr, spec_attr, spc1_attr, spc2_attr;
  973.  
  974.    if (qseg == 0xB800) {
  975.       norm_attr = wiattr(RED, LIGHTGRAY);
  976.       spec_attr = wiattr(LIGHTGREEN, BLUE);
  977.       spc1_attr = wiattr(BLACK, LIGHTGRAY);
  978.       spc2_attr = wiattr(GREEN, LIGHTGRAY);
  979.    }
  980.    else {
  981.       norm_attr = wiattr(BLACK, LIGHTGRAY);
  982.       spec_attr = norm_attr;
  983.       spc1_attr = norm_attr;
  984.       spc2_attr = norm_attr;
  985.    }
  986.    zoomeffect = TRUE;
  987.    makewindow(11, 16, 10, 49, norm_attr, norm_attr, mhatchbrdr);
  988.    window_write(spec_attr, strh[0]);
  989.    window_write(spc1_attr, strh[1]);
  990.    window_write(spc1_attr, strh[2]);
  991.    for (index = 3; index <= 6; index++ )
  992.      window_write(spc2_attr, strh[index]);
  993.    if (!auto_demo)
  994.       titlewindow(bottomcenter, " Enter - Returns to sub menu ", -1);
  995.    zoomeffect = FALSE;
  996. }  /* show_titlewindow() */
  997.  
  998. void         show_specialeffects(int auto_demo) {
  999.    int         index,
  1000.                norm_attr, brdr_attr, spec_attr;
  1001.  
  1002.    if (qseg == 0xB800) {
  1003.       norm_attr = wiattr(BLACK, GREEN);
  1004.       brdr_attr = wiattr(WHITE, GREEN);
  1005.       spec_attr = wiattr(LIGHTRED, CYAN);
  1006.    }
  1007.    else {
  1008.       norm_attr = wiattr(BLACK, LIGHTGRAY);
  1009.       brdr_attr = wiattr(WHITE, LIGHTGRAY);
  1010.       spec_attr = wiattr(LIGHTGRAY, BLACK);
  1011.    }
  1012.    /*  -- Special effects description --  */
  1013.    zoomeffect = TRUE;
  1014.    makewindow(4, 1, 10, 49, norm_attr, brdr_attr, doublebrdr);
  1015.    titlewindow(topcenter, " Special Effects ", -1);
  1016.    active_window_col++;
  1017.    for (index = 0; index <= 7; index++)
  1018.       window_write(-1, stri[index]);
  1019.  
  1020.    makewindow(14, 25, 11, 49, norm_attr, brdr_attr, doublebrdr);
  1021.    titlewindow(topcenter, " Special Effects Cont. ... ", -1);
  1022.    active_window_col++;
  1023.    for (index = 8; index <= 16; index++)
  1024.       if ( (index != 8) && (index != 11) )
  1025.          window_write(-1, stri[index]);
  1026.       else
  1027.          window_write(brdr_attr, stri[index]);
  1028.    if (!auto_demo) {
  1029.       makewindow(8, 51, 3, 29, spec_attr, spec_attr, hhatchbrdr);
  1030.       window_write(-1, "Enter - Returns to sub menu");
  1031.    }
  1032.    zoomeffect = FALSE;
  1033. } /* show_specialeffects() */
  1034.  
  1035. void         show_maxwndw(int auto_demo) {
  1036.    int          index,
  1037.                 norm_attr;
  1038.  
  1039.    if (qseg == 0xB800)
  1040.       norm_attr = wiattr(BLACK, BROWN);
  1041.    else
  1042.       norm_attr = wiattr(BLACK, LIGHTGRAY);
  1043.    /*  -- MaxWndw constant --  */
  1044.    makewindow(17, 9, 7, 40, norm_attr, norm_attr, singlebrdr);
  1045.    titlewindow(topcenter, " WINDOW LIMITS ", -1);
  1046.    if (!auto_demo)
  1047.       titlewindow(bottomcenter, " Enter - Returns to sub menu ", -1);
  1048.    for (index = 0; index <= 4; index++)
  1049.       window_write(-1, strj[index]);
  1050. } /* show_maxwndw() */
  1051.  
  1052. void         show_qwik21(int auto_demo) {
  1053.    int         index,
  1054.                norm_attr, spec_attr;
  1055.  
  1056.    if (qseg == 0xB800) {
  1057.       norm_attr = wiattr(YELLOW, RED);
  1058.       spec_attr = wiattr(WHITE, RED);
  1059.    }
  1060.    else {
  1061.       norm_attr = wiattr(BLACK, LIGHTGRAY);
  1062.       spec_attr = wiattr(WHITE, LIGHTGRAY);
  1063.    }
  1064.    /*  -- QWIK21.INC procedures --  */
  1065.    makewindow(8, 20, 13, 51, norm_attr, norm_attr, evensolidbrdr);
  1066.    titlewindow(topcenter, " Utility Functions ", -1);
  1067.    if (!auto_demo)
  1068.       titlewindow(bottomcenter, " Enter - returns to main menu ", -1);
  1069.    active_window_row++;
  1070.    for (index = 0; index <= 8; index++)
  1071.       if ( (index > 1) && (index < 7) )
  1072.          window_write(spec_attr, strk[index]);
  1073.       else
  1074.          window_write(-1, strk[index]);
  1075. } /* show_qwik21() */
  1076.  
  1077. void         show_programming(int auto_demo) {
  1078.    int         index,
  1079.                norm_attr;
  1080.  
  1081.    if (qseg == 0xB800)
  1082.       norm_attr = wiattr(YELLOW, MAGENTA);
  1083.    else
  1084.       norm_attr = wiattr(WHITE, LIGHTGRAY);
  1085.    /*  -- Programming for WINDOW33.INC --  */
  1086.    zoomeffect = TRUE;
  1087.    makewindow(1, 25, 24, 50, norm_attr, norm_attr, mhatchbrdr);
  1088.    titlewindow(topcenter, " Sample ", -1);
  1089.    if (!auto_demo)
  1090.       titlewindow(bottomcenter, " Enter - returns to sub menu ", -1);
  1091.    for (index = 0; index <= 20; index++)
  1092.       window_write(-1, strl[index]);
  1093.    zoomeffect = FALSE;
  1094. } /* show_programming() */
  1095.  
  1096. void         show_ending(void) {
  1097.    int         index,
  1098.                norm_attr, spec_attr;
  1099.  
  1100.    if (qseg == 0xB800) {
  1101.       norm_attr = wiattr(BLACK, BROWN);
  1102.       spec_attr = wiattr(WHITE, BROWN);
  1103.    }
  1104.    else {
  1105.       norm_attr = wiattr(BLACK, LIGHTGRAY);
  1106.       spec_attr = wiattr(WHITE, LIGHTGRAY);
  1107.    }
  1108.    /*  -- Editor for WINDOW33.INC --  */
  1109.    makewindow(8, 10, 11, 65, norm_attr, norm_attr, hhatchbrdr);
  1110.    titlewindow(topcenter, " Thats All Folks !! ", -1);
  1111.    active_window_col++;
  1112.    active_window_row++;
  1113.    for (index = 0; index <= 6; index++)
  1114.       window_write(spec_attr, strm[index]);
  1115. }  /* show_editor */
  1116.  
  1117. void       show_getstring(int auto_demo) {
  1118.    int         index,
  1119.                norm_attr, spec_attr;
  1120.  
  1121.    if (qseg == 0xB800) {
  1122.       norm_attr = wiattr(LIGHTBLUE, MAGENTA);
  1123.       spec_attr = wiattr(YELLOW, RED);
  1124.    }
  1125.    else {
  1126.       norm_attr = wiattr(WHITE, BLACK);
  1127.       spec_attr = wiattr(WHITE, LIGHTGRAY);
  1128.    }
  1129.    zoomeffect = TRUE;
  1130.    makewindow(9, 7, 11, 65, norm_attr, norm_attr, mixedbrdr);
  1131.    titlewindow(topcenter, " GET_STRING ", spec_attr);
  1132.    if (!auto_demo)
  1133.       titlewindow(bottomcenter, " Enter - returns to sub menu ", -1);
  1134.    active_window_col++;
  1135.    for (index = 0; index <= 8; index++)
  1136.       window_write(-1, strn[index]);
  1137.    zoomeffect = FALSE;
  1138. }  /* show_getstring() */
  1139.  
  1140. void       show_getinteger(int auto_demo) {
  1141.    int         index,
  1142.                norm_attr;
  1143.  
  1144.    if (qseg == 0xB800)
  1145.       norm_attr = wiattr(YELLOW, BLUE);
  1146.    else
  1147.       norm_attr = wiattr(WHITE, LIGHTGRAY);
  1148.    zoomeffect = TRUE;
  1149.    makewindow(4, 3, 12, 61, norm_attr, norm_attr, lhatchbrdr);
  1150.    titlewindow(topcenter, " GET_INTEGER ", -1);
  1151.    if (!auto_demo)
  1152.       titlewindow(bottomcenter, " Enter - returns to sub menu ", -1);
  1153.    active_window_col++;
  1154.    for (index = 0; index <= 9; index++)
  1155.       window_write(-1, stro[index]);
  1156.    zoomeffect = FALSE;
  1157. }  /* show_getinteger() */
  1158.  
  1159. void       show_getmenu(int auto_demo) {
  1160.    int         index,
  1161.                norm_attr, brdr_attr;
  1162.  
  1163.    if (qseg == 0xB800) {
  1164.       norm_attr = wiattr(YELLOW, GREEN);
  1165.       brdr_attr = wiattr(WHITE, GREEN);
  1166.    }
  1167.    else {
  1168.       norm_attr = wiattr(WHITE, LIGHTGRAY);
  1169.       brdr_attr = wiattr(WHITE, BLACK);
  1170.    }
  1171.    zoomeffect = TRUE;
  1172.    makewindow(6, 5, 16, 68, norm_attr, brdr_attr, singlebrdr);
  1173.    titlewindow(topcenter, " GET_MENU ", -1);
  1174.    if (!auto_demo)
  1175.       titlewindow(bottomcenter, " Enter - returns to sub menu ", -1);
  1176.    active_window_col++;
  1177.    for (index = 0; index <= 12; index++)
  1178.       window_write(-1, strp[index]);
  1179.    window_write(brdr_attr, strp[index]);
  1180.    zoomeffect = FALSE;
  1181. }  /* show_getmenu() */
  1182.  
  1183. void       show_wsound(int auto_demo) {
  1184.    int         index,
  1185.                norm_attr;
  1186.  
  1187.    if (qseg == 0xB800)
  1188.       norm_attr = wiattr(LIGHTRED, CYAN);
  1189.    else
  1190.       norm_attr = wiattr(LIGHTGRAY, BLACK);
  1191.    zoomeffect = TRUE;
  1192.    makewindow(6, 12, 8, 45, norm_attr, norm_attr, doublebrdr);
  1193.    titlewindow(topcenter, " WSOUND ", -1);
  1194.    if (!auto_demo)
  1195.       titlewindow(bottomcenter, " Enter - returns to sub menu ", -1);
  1196.    active_window_col++;
  1197.    for (index = 0; index <= 5; index++)
  1198.       window_write(-1, strq[index]);
  1199.    zoomeffect = FALSE;
  1200. }  /* show_wsound() */
  1201.  
  1202. void       show_wsleep(int auto_demo) {
  1203.    int         index,
  1204.                norm_attr, spec_attr;
  1205.  
  1206.    if (qseg == 0xB800)  {
  1207.       norm_attr = wiattr(WHITE, RED);
  1208.       spec_attr = wiattr(YELLOW, RED);
  1209.    }
  1210.    else {
  1211.       norm_attr = wiattr(LIGHTGRAY, BLACK);
  1212.       spec_attr = wiattr(WHITE, BLACK);
  1213.    }
  1214.    zoomeffect = TRUE;
  1215.    makewindow(5, 20, 10, 40, norm_attr, norm_attr, doublebrdr);
  1216.    titlewindow(topcenter, " WSLEEP ", -1);
  1217.    if (!auto_demo)
  1218.       titlewindow(bottomcenter, " Enter - returns to sub menu ", -1);
  1219.    active_window_col++;
  1220.    for (index = 0; index <= 6; index++)
  1221.       window_write(-1, strr[index]);
  1222.    window_write(spec_attr, strr[index]);
  1223.    zoomeffect = FALSE;
  1224. }  /* show_wsleep() */
  1225.  
  1226. int m_special(int chr, int *finished) {
  1227.    if ( (chr == RGTARROW) || (chr == LFTARROW) )
  1228.       *finished = TRUE;
  1229.    else
  1230.       *finished = FALSE;
  1231.    return(chr);
  1232. } /* m_special() */
  1233.  
  1234.