home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / grafik / unicorn / ver5 / window.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-10-07  |  23.6 KB  |  839 lines

  1. /*  window.c
  2.  *
  3.  *  Demo program for uclib.lib Version 5.10
  4.  *
  5.  */
  6.  
  7. /*--------------------------------------------------------------------*/
  8. /*  This program in no way illustrates each of the over 300 functions */
  9. /*  contained in uclib.lib version 5.10.  It does however make an     */
  10. /*  attempt to illustrate some of what can be done with the library.  */
  11. /*--------------------------------------------------------------------*/
  12.  
  13. #include <stdio.h>       /* needed since NULL is used in uc_defs.h  */
  14. #ifdef MSC
  15. #include <malloc.h>
  16. #else
  17. #include <alloc.h>
  18. #endif
  19.  
  20. #include "uc_defs.h"       /* Assume the headers are in the current   */
  21. #include "uc_glob.h"       /* directory.                  */
  22. #include "uc_proto.h"
  23.  
  24. #include "wn_defs.h"
  25. #include "wn_glob.h"
  26. #include "wn_proto.h"
  27.  
  28. extern WINDOWPTR  err_wnd; /* Allow access to the system error window */
  29.  
  30. void main( void )       /* Unicorn Software programs are written   */
  31. {               /* using ANSI standard prototyping.          */
  32.    WINDOWPTR    wn_main;
  33.    WINDOWPTR    wn_sub;    /* sub window for the main screen window   */
  34.    WINDOWPTR    wn_1;
  35.    WINDOWPTR    wn_2;
  36.    WINDOWPTR    wn_3;
  37.    WINDOWPTR    wn_4;
  38.    WINDOWPTR    wn_5;
  39.    WINDOWPTR    wn_6;
  40.    WINDOWPTR    wn_7;
  41.    WINDOWPTR    wn_8;
  42.    WINDOWPTR    wn_9;
  43.    WINDOWPTR    wn_10;
  44.  
  45.    char     *str_save();
  46.  
  47.    char     err_str[ 256 ];  /* error message string          */
  48.    int        i;
  49.    int        count;
  50.  
  51.  
  52.    uc_init();             /* Inititalize various system values */
  53.    if ( mouse_exist )
  54.       m_flagdec();
  55.  
  56.    cur_off();              /* Turn off the cursor to avoid clutter */
  57.  
  58.    wn_main = wn_make( 0, 0, 25, 80 );  /* Define a window and size it */
  59.                   /* Set the window normal attribute      */
  60.    wn_wnclr( wn_main, mk_att( BLUE, BROWN + BRIGHT ) );
  61.                   /* Set the window border attribute      */
  62.    wn_bclr( wn_main, mk_att( BLUE, WHITE + BRIGHT ) );
  63.    wn_clear( wn_main );       /* Clear the window area              */
  64.  
  65.                   /* Set up a window title - a future     */
  66.                   /* enhancement will allow more than one */
  67.                   /* title to be placed in the window's   */
  68.                   /* border.  Position parameters will    */
  69.                   /* also be allowed such as CENTER etc.  */
  70.                   /* Also functions will be added to set  */
  71.                   /* up the title directly without going  */
  72.                   /* through this indirect process.       */
  73.  
  74.    wn_main->title = ( TITLEPTR ) malloc( sizeof( TITLE ) );
  75.  
  76.  
  77.    wn_main->title->title = ( char * ) malloc( 100 );
  78.  
  79.  
  80.    strcpy( wn_main->title->title,
  81. " Unicorn Software P.O. Box 3214 Kirkland, WA 98034-3214 (206) 823-4656" );
  82.    wn_main->title->position = 4;
  83.                     /* Set the title color          */
  84.    wn_main->clr->title = mk_att( WHITE, RED + BRIGHT );
  85.  
  86.                   /* Set the window's right & left margins*/
  87.    wn_margin( wn_main, 3 );
  88.  
  89.    wn_mkbdr( wn_main, BDR_DLNP ); /* make a border for the window     */
  90.  
  91.  
  92.  
  93.  
  94.    wn_sub = wn_make( 4, 5, 19, 72 );  /* Define a window and size it */
  95.                   /* Set the window normal attribute      */
  96.    wn_wnclr( wn_sub, mk_att( BLUE, BROWN + BRIGHT ) );
  97.                   /* Set the window border attribute      */
  98.    wn_bclr( wn_sub, mk_att( BLUE, WHITE + BRIGHT ) );
  99.    wn_clear( wn_sub );          /* Clear the window area              */
  100.  
  101.    wn_margin( wn_sub, 1 );
  102.  
  103.    wn_mkbdr( wn_sub, BDR_SLNP );  /* make a border for the window     */
  104.  
  105.  
  106.  
  107. /*--------------------------------------------------------------------*/
  108. /* At this point the window has been defined and all parameters for   */
  109. /* the basic window, the title and border are contained in structures.*/
  110. /* Next we will write some text to the window, even though it is not  */
  111. /* yet displayed on the screen, then the window will be displayed and */
  112. /* finally further text will be written to the displayed window.      */
  113. /*--------------------------------------------------------------------*/
  114.  
  115.                  /* the following function writes a single*/
  116.                  /* character to the window.          */
  117.    wn_pchar( wn_main, '\n' );
  118.  
  119.    for ( i = 0; i <= 25; i++ )
  120.       wn_pchar( wn_main, ' ' );
  121.  
  122.    wn_pchar( wn_main, 'U' );
  123.    wn_pchar( wn_main, 'n' );
  124.    wn_pchar( wn_main, 'i' );
  125.    wn_pchar( wn_main, 'c' );
  126.    wn_pchar( wn_main, 'o' );
  127.    wn_pchar( wn_main, 'r' );
  128.    wn_pchar( wn_main, 'n' );
  129.    wn_pchar( wn_main, ' ' );
  130.    wn_pchar( wn_main, 'L' );
  131.    wn_pchar( wn_main, 'i' );
  132.    wn_pchar( wn_main, 'b' );
  133.    wn_pchar( wn_main, 'r' );
  134.    wn_pchar( wn_main, 'a' );
  135.    wn_pchar( wn_main, 'r' );
  136.    wn_pchar( wn_main, 'y' );
  137.    wn_pchar( wn_main, ' ' );
  138.    wn_pchar( wn_main, '5' );
  139.    wn_pchar( wn_main, '.' );
  140.    wn_pchar( wn_main, '0' );
  141.    wn_pchar( wn_main, '0' );
  142.    wn_pchar( wn_main, '\n' );
  143.    wn_pchar( wn_main, '\n' );
  144.  
  145.  
  146.    wn_wnclr( wn_sub, mk_att( BLUE, WHITE ) );
  147.  
  148.    wn_printf( wn_sub,
  149.    "\nWelcome to version 5.10 of " );
  150.  
  151.    wn_wnclr( wn_sub, mk_att( BLUE, CYAN + BRIGHT ) );
  152.  
  153.    wn_printf( wn_sub,
  154.    "UCLIB.LIB" );
  155.  
  156.    wn_wnclr( wn_sub, mk_att( BLUE, WHITE ) );
  157.  
  158.    wn_printf( wn_sub,
  159.    ".  This all new version of\n" );
  160.  
  161.    wn_printf( wn_sub,
  162.    "the library contains many differences from past releases.  First\n" );
  163.  
  164.    wn_printf( wn_sub,
  165.    "and foremost the library is now entirely in C, gone are the \n" );
  166.  
  167.    wn_printf( wn_sub,
  168.    "assembler routines of past releases.  This should make it much\n" );
  169.  
  170.    wn_printf( wn_sub,
  171.    "easier for users to understand and work with the library source\n" );
  172.  
  173.    wn_printf( wn_sub,
  174.    "code.  An " );
  175.  
  176.    wn_wnclr( wn_sub, mk_att( BLUE, WHITE + BRIGHT ) );
  177.  
  178.    wn_printf( wn_sub,
  179.    "all new windowing package " );
  180.  
  181.    wn_wnclr( wn_sub, mk_att( BLUE, WHITE ) );
  182.  
  183.    wn_printf( wn_sub,
  184.    " is included as is the " );
  185.  
  186.    wn_wnclr( wn_sub, mk_att( BLUE, WHITE + BRIGHT ) );
  187.  
  188.    wn_printf( wn_sub,
  189.    "data\nentry system" );
  190.  
  191.    wn_wnclr( wn_sub, mk_att( BLUE, WHITE ) );
  192.  
  193.    wn_printf( wn_sub,
  194.    ".  The new windowing system allows you to write to\n" );
  195.  
  196.    wn_printf( wn_sub,
  197.    "a window whether or not it is currently displayed on the screen.\n" );
  198.  
  199.    wn_printf( wn_sub,
  200.    "The data entry system uses this windowing system for maximum user\n" );
  201.  
  202.    wn_printf( wn_sub,
  203.    "flexibility.  As this demo progresses it will stop at various points.\n" );
  204.  
  205.    wn_printf( wn_sub,
  206.    "When this occurs simply press a key to continue.                       \n" );
  207.  
  208.    wn_printf( wn_sub,
  209.    "          \n" );
  210.  
  211.    wn_dsply( wn_main );
  212.  
  213.    wn_dsply( wn_sub );     /* display the window now!!             */
  214.  
  215.  
  216.    gr_bckgnd( BLUE );      /* Set the border color              */
  217.  
  218.  
  219.    uc_key();   /* get a user key stroke and ignore the key returned   */
  220.  
  221.  
  222.    wn_printf( wn_sub,
  223.    "\nSee how simple that was!  Now in this section please note\n" );
  224.  
  225.    wn_printf( wn_sub,
  226.    "two important items, first the cursor has been turned off to\n" );
  227.  
  228.    wn_printf( wn_sub,
  229.    "avoid unsightly screen clutter and secondly the main text of\n" );
  230.  
  231.    wn_printf( wn_sub,
  232.    "this window will scroll as new lines are added.               \n" );
  233.  
  234.    uc_key();
  235.  
  236.    wn_printf( wn_sub,
  237.    "\nIn this next section additional windows will be placed on the\n" );
  238.  
  239.    wn_printf( wn_sub,
  240.    "screen.  They will be moved in all three directions, text will\n" );
  241.  
  242.    wn_printf( wn_sub,
  243.    "be written to them in addition to other suprises.             \n" );
  244.  
  245.  
  246.    uc_key();
  247.  
  248.  
  249.  
  250.    wn_1 = wn_make( 5, 5, 12, 40 );
  251.    wn_wnclr( wn_1, mk_att( RED, BROWN + BRIGHT ) );
  252.    wn_bclr( wn_1, mk_att( RED, WHITE + BRIGHT ) );
  253.    wn_clear( wn_1 );
  254.    wn_1->title = ( TITLEPTR ) malloc( sizeof( TITLE ) );
  255.    wn_1->title->title = ( char * ) malloc( 100 );
  256.    strcpy( wn_1->title->title, " Sub Window 1 " );
  257.    wn_1->title->position = 4;
  258.    wn_1->clr->title = mk_att( RED, WHITE + BRIGHT );
  259.    wn_margin( wn_1, 1 );
  260.    wn_mkbdr( wn_1, BDR_12LNP );
  261.  
  262.  
  263.    wn_dsply( wn_1 );
  264.  
  265.    wn_printf( wn_1, "This window is currently in the\n" );
  266.  
  267.    wn_printf( wn_1, "forefront and next another window\n" );
  268.  
  269.    wn_printf( wn_1, "will be placed on the screen which\n" );
  270.  
  271.    wn_printf( wn_1, "will partially obscure this one.\n" );
  272.  
  273.    uc_key();
  274.  
  275.  
  276.  
  277.  
  278.    wn_2 = wn_make( 7, 15, 12, 40 );
  279.    wn_wnclr( wn_2, mk_att( CYAN, RED ) );
  280.    wn_bclr( wn_2, mk_att( CYAN, RED ) );
  281.    wn_clear( wn_2 );
  282.    wn_2->title = ( TITLEPTR ) malloc( sizeof( TITLE ) );
  283.    wn_2->title->title = ( char * ) malloc( 100 );
  284.    strcpy( wn_2->title->title, " Sub Window 2 " );
  285.    wn_2->title->position = 4;
  286.    wn_2->clr->title = mk_att( CYAN, BROWN + BRIGHT );
  287.    wn_margin( wn_2, 3 );
  288.    wn_mkbdr( wn_2, BDR_21LNP );
  289.  
  290.  
  291.    wn_dsply( wn_2 );
  292.  
  293.    wn_printf( wn_2, "The full source code for this\n" );
  294.  
  295.    wn_printf( wn_2, "demo is in provided to help you\n" );
  296.  
  297.    wn_printf( wn_2, "in using the library.  It is \n" );
  298.  
  299.    wn_printf( wn_2, "impossible for this demo to \n" );
  300.  
  301.    wn_printf( wn_2, "illustrate all of the over 300\n" );
  302.  
  303.    wn_printf( wn_2, "functions contained in the \n" );
  304.  
  305.    wn_printf( wn_2, "library however it will give\n" );
  306.  
  307.    wn_printf( wn_2, "you an idea of what is \n" );
  308.  
  309.    wn_printf( wn_2, "possible.                   \n" );
  310.  
  311.  
  312.  
  313.    uc_key();
  314.  
  315.  
  316.    wn_front( wn_1 );
  317.  
  318.    wn_printf( wn_1, "\nThere is a reference guide\n" );
  319.  
  320.    wn_printf( wn_1, "provided to further aid you \n" );
  321.  
  322.    wn_printf( wn_1, "in using the library.  All\n" );
  323.  
  324.    wn_printf( wn_1, "registered users will be\n" );
  325.  
  326.    wn_printf( wn_1, "given the source code to all\n" );
  327.  
  328.    wn_printf( wn_1, "the author's test programs\n" );
  329.  
  330.    wn_printf( wn_1, "which should provide all the\n" );
  331.  
  332.    wn_printf( wn_1, "information needed to use\n" );
  333.  
  334.    wn_printf( wn_1, "the library efficiently. \n" );
  335.  
  336.    uc_key();
  337.  
  338.    wn_rposition( wn_1, 3, 15 );
  339.  
  340.    uc_key();
  341.  
  342.    wn_front( wn_2 );
  343.  
  344.    wn_printf( wn_2, "\nAs you may see windows may\n" );
  345.  
  346.    wn_printf( wn_2, "be moved in all three axis \n" );
  347.  
  348.    wn_printf( wn_2, "without much difficulty.  \n" );
  349.  
  350.    wn_printf( wn_2, "In addition it should be\n" );
  351.  
  352.    wn_printf( wn_2, "noted that most of the demos\n" );
  353.  
  354.    wn_printf( wn_2, "printing to windows is being\n" );
  355.  
  356.    wn_printf( wn_2, "done with a window oriented\n" );
  357.  
  358.    wn_printf( wn_2, "version of printf.\n" );
  359.  
  360.  
  361.    uc_key();
  362.  
  363.  
  364.    wn_3 = wn_make( 5, 10, 16, 60 );
  365.    wn_wnclr( wn_3, mk_att( MAGENTA, WHITE + BRIGHT ) );
  366.    wn_bclr( wn_3, mk_att( MAGENTA, BROWN + BRIGHT ) );
  367.    wn_clear( wn_3 );
  368.  
  369.    wn_3->title = ( TITLEPTR ) malloc( sizeof( TITLE ) );
  370.    wn_3->title->title = ( char * ) malloc( 100 );
  371.    strcpy( wn_3->title->title, " wn_printf " );
  372.    wn_3->clr->title = mk_att( MAGENTA, BLUE + BRIGHT );
  373.   /*
  374.    wn_3->title->title = str_save( " wn_printf " );
  375. */
  376.    wn_3->title->position = 24;
  377.    wn_margin( wn_3, 2 );
  378.    wn_mkbdr( wn_3, BDR_LNP );
  379.    wn_dsply( wn_3 );
  380.  
  381.    wn_printf( wn_3, "The window function part of the library contains\n" );
  382.    wn_printf( wn_3, "a window oriented version of printf that uses   \n" );
  383.    wn_printf( wn_3, "the current window attribute.  It is similar to \n" );
  384.    wn_printf( wn_3, "the general library color version of printf with\n" );
  385.    wn_printf( wn_3, "the exception of being able to specify a window.\n\n" );
  386.  
  387.    wn_printf( wn_3, "     Integers ----- %d, %d, %d\n",
  388.                      5, 67, 4567 );
  389.    wn_printf( wn_3, "     Floats ------- %f, %f, %.4f\n",
  390.                   1.234, 567.4567, 23.45678912 );
  391.  
  392.    wn_printf( wn_3, "     Strings ------ %s\n",
  393.                   "This is a test string" );
  394.  
  395.    wn_printf( wn_3, "     Doubles ------ %.15lf\n\n",
  396.                   123.123456789012345678 );
  397.  
  398.    wn_printf( wn_3, "The window printf function will accept all the\n" );
  399.    wn_printf( wn_3, "formatting parameters of the standard printf.\n" );
  400.  
  401.  
  402.    uc_key();
  403.  
  404.    wn_hide( wn_3 );
  405.  
  406.  
  407.  
  408.  
  409.    wn_4 = wn_make( 2, 1, 6, 38 );
  410.    wn_wnclr( wn_4, mk_att( GREEN, BROWN + BRIGHT ) );
  411.    wn_bclr( wn_4, mk_att( GREEN, RED ) );
  412.    wn_clear( wn_4 );
  413.    wn_4->title = ( TITLEPTR ) malloc( sizeof( TITLE ) );
  414.    wn_4->title->title = ( char * ) malloc( 100 );
  415.    strcpy( wn_4->title->title, " Multiple Scroll #1 " );
  416.    wn_4->title->position = 3;
  417.    wn_4->clr->title = mk_att( GREEN, BLACK );
  418.    wn_margin( wn_4, 1 );
  419.    wn_mkbdr( wn_4, BDR_DLNP );
  420.  
  421.  
  422.    wn_dsply( wn_4 );
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.    wn_5 = wn_make( 2, 41, 6, 38 );
  430.    wn_wnclr( wn_5, mk_att( MAGENTA, WHITE + BRIGHT ) );
  431.    wn_bclr( wn_5, mk_att( MAGENTA, RED ) );
  432.    wn_clear( wn_5 );
  433.    wn_5->title = ( TITLEPTR ) malloc( sizeof( TITLE ) );
  434.    wn_5->title->title = ( char * ) malloc( 100 );
  435.    strcpy( wn_5->title->title, " Multiple Scroll #2 " );
  436.    wn_5->title->position = 3;
  437.    wn_5->clr->title = mk_att( MAGENTA, BLACK );
  438.    wn_margin( wn_5, 1 );
  439.    wn_mkbdr( wn_5, BDR_LNP );
  440.  
  441.  
  442.    wn_dsply( wn_5 );
  443.  
  444.  
  445.  
  446.  
  447.    wn_6 = wn_make( 18, 1, 6, 38 );
  448.    wn_wnclr( wn_6, mk_att( RED, BROWN + BRIGHT ) );
  449.    wn_bclr( wn_6, mk_att( RED, BROWN + BRIGHT ) );
  450.    wn_clear( wn_6 );
  451.    wn_6->title = ( TITLEPTR ) malloc( sizeof( TITLE ) );
  452.    wn_6->title->title = ( char * ) malloc( 100 );
  453.    strcpy( wn_6->title->title, " Multiple Scroll #3 " );
  454.    wn_6->title->position = 3;
  455.    wn_6->clr->title = mk_att( RED, BLACK );
  456.    wn_margin( wn_6, 1 );
  457.    wn_mkbdr( wn_6, BDR_21LNP );
  458.  
  459.  
  460.    wn_dsply( wn_6 );
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.    wn_7 = wn_make( 18, 41, 6, 38 );
  468.    wn_wnclr( wn_7, mk_att( CYAN, BLUE + BRIGHT ) );
  469.    wn_bclr( wn_7, mk_att( CYAN, RED ) );
  470.    wn_clear( wn_7 );
  471.    wn_7->title = ( TITLEPTR ) malloc( sizeof( TITLE ) );
  472.    wn_7->title->title = ( char * ) malloc( 100 );
  473.    strcpy( wn_7->title->title, " Multiple Scroll #4 " );
  474.    wn_7->title->position = 3;
  475.    wn_7->clr->title = mk_att( CYAN, BLACK );
  476.    wn_margin( wn_7, 1 );
  477.    wn_mkbdr( wn_7, BDR_12LNP );
  478.  
  479.  
  480.    wn_dsply( wn_7 );
  481.  
  482.  
  483.  
  484.    wn_printf( wn_4, "Let's watch several windows\n" );
  485.    wn_printf( wn_5, "Let's watch several windows\n" );
  486.    wn_printf( wn_6, "Let's watch several windows\n" );
  487.    wn_printf( wn_7, "Let's watch several windows\n" );
  488.    wn_printf( wn_4, "at once all scrolling lines\n" );
  489.    wn_printf( wn_5, "at once all scrolling lines\n" );
  490.    wn_printf( wn_6, "at once all scrolling lines\n" );
  491.    wn_printf( wn_7, "at once all scrolling lines\n" );
  492.  
  493.    uc_key();
  494.  
  495.    wn_printf( wn_4, "in various parts of the screen.\n" );
  496.    wn_printf( wn_5, "in various parts of the screen.\n" );
  497.    wn_printf( wn_6, "in various parts of the screen.\n" );
  498.    wn_printf( wn_7, "in various parts of the screen.\n" );
  499.    wn_printf( wn_4, "While this doesn't accomplish\n" );
  500.    wn_printf( wn_5, "While this doesn't accomplish\n" );
  501.    wn_printf( wn_6, "While this doesn't accomplish\n" );
  502.    wn_printf( wn_7, "While this doesn't accomplish\n" );
  503.    wn_printf( wn_4, "of real use it does look\n" );
  504.    wn_printf( wn_5, "of real use it does look\n" );
  505.    wn_printf( wn_6, "of real use it does look\n" );
  506.    wn_printf( wn_7, "of real use it does look\n" );
  507.  
  508.    uc_key();
  509.  
  510.    wn_printf( wn_4, "pretty!  Perhaps you have a\n" );
  511.    wn_printf( wn_5, "pretty!  Perhaps you have a\n" );
  512.    wn_printf( wn_6, "pretty!  Perhaps you have a\n" );
  513.    wn_printf( wn_7, "pretty!  Perhaps you have a\n" );
  514.    wn_printf( wn_4, "use for this capability in\n" );
  515.    wn_printf( wn_6, "use for this capability in\n" );
  516.    wn_printf( wn_7, "use for this capability in\n" );
  517.    wn_printf( wn_5, "use for this capability in\n" );
  518.    wn_printf( wn_4, "your own application.  If\n" );
  519.    wn_printf( wn_5, "your own application.  If\n" );
  520.    wn_printf( wn_6, "your own application.  If\n" );
  521.    wn_printf( wn_7, "your own application.  If\n" );
  522.  
  523.    uc_key();
  524.  
  525.    wn_printf( wn_4, "you do at least it is\n" );
  526.    wn_printf( wn_5, "you do at least it is\n" );
  527.    wn_printf( wn_6, "you do at least it is\n" );
  528.    wn_printf( wn_7, "you do at least it is\n" );
  529.    wn_printf( wn_4, "possible to do. \n" );
  530.    wn_printf( wn_5, "possible to do. \n" );
  531.    wn_printf( wn_6, "possible to do. \n" );
  532.    wn_printf( wn_7, "possible to do. \n" );
  533.  
  534.    uc_key();
  535.  
  536.  
  537.    for( i = 0; i <= 20; i++ )
  538.    {
  539.       wn_printf( wn_4, "    Line #%d\n", i );
  540.       wn_printf( wn_5, "    Line #%d\n", i );
  541.       wn_printf( wn_6, "    Line #%d\n", i );
  542.       wn_printf( wn_7, "    Line #%d\n", i );
  543.    }
  544.  
  545.  
  546.  
  547.  
  548.    wn_printf( wn_4, "\n     " );
  549.    wn_printf( wn_5, "\n     " );
  550.    wn_printf( wn_6, "\n     " );
  551.    wn_printf( wn_7, "\n     " );
  552.  
  553.  
  554.    wn_wnclr( wn_4, mk_att( GREEN, BLUE + BRIGHT ) );
  555.    wn_wnclr( wn_5, mk_att( MAGENTA, BLUE + BRIGHT ) );
  556.    wn_wnclr( wn_6, mk_att( RED, BLUE + BRIGHT ) );
  557.    wn_wnclr( wn_7, mk_att( CYAN, BLUE + BRIGHT ) );
  558.  
  559.    wn_printf( wn_4, "Wasn't that fun" );
  560.    wn_printf( wn_5, "Wasn't that fun" );
  561.    wn_printf( wn_6, "Wasn't that fun" );
  562.    wn_printf( wn_7, "Wasn't that fun" );
  563.  
  564.    wn_wnclr( wn_4, mk_att( GREEN, MAGENTA + BRIGHT ) );
  565.    wn_wnclr( wn_5, mk_att( MAGENTA, GREEN + BRIGHT ) );
  566.    wn_wnclr( wn_6, mk_att( RED, WHITE + BRIGHT ) );
  567.    wn_wnclr( wn_7, mk_att( CYAN, BLUE + BRIGHT ) );
  568.  
  569.    wn_wnclr( wn_4, mk_att( GREEN, BROWN + BRIGHT ) );
  570.    wn_wnclr( wn_5, mk_att( MAGENTA, WHITE + BRIGHT ) );
  571.    wn_wnclr( wn_6, mk_att( RED, BROWN + BRIGHT ) );
  572.    wn_wnclr( wn_7, mk_att( CYAN, BLUE + BRIGHT ) );
  573.  
  574.  
  575.    wn_printf( wn_4, "\n  Note the atrribute change" );
  576.    wn_printf( wn_5, "\n  Note the atrribute change" );
  577.    wn_printf( wn_6, "\n  Note the atrribute change" );
  578.    wn_printf( wn_7, "\n  Note the atrribute change" );
  579.  
  580.  
  581.    uc_key();
  582.  
  583.    wn_hide( wn_4 );
  584.    wn_hide( wn_5 );
  585.    wn_hide( wn_6 );
  586.    wn_hide( wn_7 );
  587.  
  588.    uc_key();
  589.  
  590.  
  591.  
  592.  
  593.    wn_9 = wn_make( 5, 3, 18, 74 );
  594.    wn_wnclr( wn_9, mk_att( RED, BROWN + BRIGHT ) );
  595.    wn_bclr( wn_9, mk_att( RED, WHITE + BRIGHT ) );
  596.    wn_clear( wn_9 );
  597.    wn_9->title = ( TITLEPTR ) malloc( sizeof( TITLE ) );
  598.    wn_9->title->title = ( char * ) malloc( 100 );
  599.    strcpy( wn_9->title->title, " Unicorn Software " );
  600.    wn_9->title->position = 28;
  601.    wn_9->clr->title = mk_att( RED, CYAN );
  602.    wn_margin( wn_9, 3 );
  603.    wn_mkbdr( wn_9, BDR_LNP );
  604.  
  605.  
  606.    wn_dsply( wn_9 );
  607.  
  608.    wn_printf( wn_9,
  609.       "\nUnicorn Software has been supplying shareware for over two\n" );
  610.  
  611.    wn_printf( wn_9,
  612.       "years.  Our location has changed and may change again in the\n" );
  613.  
  614.    wn_printf( wn_9,
  615.       "future.  To avoid problems in users finding us we now use\n" );
  616.  
  617.    wn_printf( wn_9,
  618.       "a P.O. Box as a permanant location.  The current phone number\n" );
  619.  
  620.    wn_printf( wn_9,
  621.       "listed is the author's home phone which may also change in\n" );
  622.  
  623.    wn_printf( wn_9,
  624.       "the future.  The author also uses several Seattle, WA area\n" );
  625.  
  626.    wn_printf( wn_9,
  627.       "boards which are listed in the readme file.  While not\n" );
  628.  
  629.    wn_printf( wn_9,
  630.       "very active messages should reach the author on one of\n" );
  631.  
  632.    wn_printf( wn_9,
  633.       "these.  Also listed in the readme file is information\n" );
  634.  
  635.    wn_printf( wn_9,
  636.       "concerning where to find upgrades to this library.\n" );
  637.  
  638.    wn_printf( wn_9,
  639.       "We hope you find the library useful to you and if\n" );
  640.  
  641.    wn_printf( wn_9,
  642.       "so you are encouraged to register your copy." );
  643.  
  644.    wn_wnclr( wn_9, mk_att( RED, WHITE + BRIGHT ) );
  645.  
  646.    wn_printf( wn_9,
  647.       "  The\nthree disks of source code alone can be very educational.\n" );
  648.  
  649.  
  650.    uc_key();
  651.  
  652.    wn_hide( wn_9 );
  653.  
  654.  
  655.  
  656.    wn_8 = wn_make( 5, 3, 18, 74 );
  657.    wn_wnclr( wn_8, mk_att( WHITE, BLUE + BRIGHT ) );
  658.    wn_bclr( wn_8, mk_att( WHITE, RED ) );
  659.    wn_clear( wn_8 );
  660.    wn_8->title = ( TITLEPTR ) malloc( sizeof( TITLE ) );
  661.    wn_8->title->title = ( char * ) malloc( 100 );
  662.    strcpy( wn_8->title->title, " REGISTRATION " );
  663.    wn_8->title->position = 30;
  664.    wn_8->clr->title = mk_att( WHITE, BLACK );
  665.    wn_margin( wn_8, 3 );
  666.    wn_mkbdr( wn_8, BDR_21LNP );
  667.  
  668.  
  669.    wn_dsply( wn_8 );
  670.  
  671.    wn_printf( wn_8,
  672.       "Registration of this version of the library may be accomplished\n" );
  673.  
  674.  
  675.    wn_printf( wn_8,
  676.       "by filling out the registration form provided and sending it to\n" );
  677.  
  678.    wn_printf( wn_8,
  679.       "the below address.  This sets in motion a chain of events that\n" );
  680.  
  681.    wn_printf( wn_8,
  682.       "will result in the source code for the entire library appearing\n" );
  683.  
  684.    wn_printf( wn_8,
  685.       "mysteriously in your mailbox.  In addition you will receive the\n" );
  686.  
  687.    wn_printf( wn_8,
  688.       "source for the author's test programs which exercise the library\n" );
  689.  
  690.    wn_printf( wn_8,
  691.       "functions extensivly.  There are over 300 functions in the\n" );
  692.  
  693.    wn_printf( wn_8,
  694.       "library currently and there are plans for extensive additions\n" );
  695.  
  696.    wn_printf( wn_8,
  697.       "in future releases.\n\n" );
  698.  
  699.    wn_printf( wn_8, "                    Unicorn Software\n" );
  700.  
  701.    wn_printf( wn_8, "                    P.O. Box 3214   \n" );
  702.  
  703.    wn_printf( wn_8, "                    Kirkland, WA    \n" );
  704.  
  705.    wn_printf( wn_8, "                    98083-3214      \n" );
  706.  
  707.    wn_printf( wn_8, "                    (206) 823-4656  \n" );
  708.  
  709.  
  710.  
  711.  
  712.    uc_key();
  713.  
  714.  
  715.  
  716.  
  717.    wn_10 = wn_make( 5, 3, 18, 74 );
  718.    wn_wnclr( wn_10, mk_att( WHITE, BLUE + BRIGHT ) );
  719.    wn_bclr( wn_10, mk_att( WHITE, RED ) );
  720.    wn_clear( wn_10 );
  721.    wn_10->title = ( TITLEPTR ) malloc( sizeof( TITLE ) );
  722.    wn_10->title->title = ( char * ) malloc( 100 );
  723.    strcpy( wn_10->title->title, " The Future " );
  724.    wn_10->title->position = 31;
  725.    wn_10->clr->title = mk_att( WHITE, BLACK );
  726.    wn_margin( wn_10, 3 );
  727.    wn_mkbdr( wn_10, BDR_21LNP );
  728.  
  729.  
  730.    wn_dsply( wn_10 );
  731.  
  732.    wn_printf( wn_10,
  733.       "\n  The future holds many improvements and enhancements for the\n" );
  734.  
  735.    wn_printf( wn_10,
  736.       "current version of the Unicorn Library.  The window and data\n" );
  737.  
  738.    wn_printf( wn_10,
  739.       "entry portions in particular will have many additional functions\n" );
  740.  
  741.  
  742.    wn_printf( wn_10,
  743.       "added to improve user ability to " );
  744.  
  745.    wn_wnclr( wn_10, mk_att( WHITE, BROWN + BRIGHT ) );
  746.  
  747.  
  748.    wn_printf( wn_10,
  749.       "very easily" );
  750.  
  751.    wn_wnclr( wn_10, mk_att( WHITE, BLUE + BRIGHT ) );
  752.  
  753.    wn_printf( wn_10,
  754.       " program the\n" );
  755.  
  756.    wn_printf( wn_10,
  757.       "desired application.  Some of the enhancements under current\n" );
  758.  
  759.    wn_printf( wn_10,
  760.       "consideration, in the planning stage or currently being coded\n" );
  761.  
  762.    wn_printf( wn_10,
  763.       "include:\n\n" );
  764.  
  765.    wn_wnclr( wn_10, mk_att( WHITE, BROWN + BRIGHT ) );
  766.  
  767.    wn_printf( wn_10,
  768.       "\t\t1.  Menus, ( these will be added very soon )\n" );
  769.  
  770.  
  771.    wn_printf( wn_10,
  772.       "\t\t2.  Additional field data handling in the data entry\n" );
  773.  
  774.    wn_printf( wn_10,
  775.       "\t\t    portion of the library.  These will be higher level\n" );
  776.  
  777.    wn_printf( wn_10,
  778.       "\t\t    functions to allow quicker overall definitions \n" );
  779.  
  780.    wn_printf( wn_10,
  781.       "\t\t    while still leaving the lower level for manipulating\n" );
  782.  
  783.    wn_printf( wn_10,
  784.       "\t\t    details easily.\n" );
  785.  
  786.    uc_key();
  787.  
  788.  
  789.    wn_printf( wn_10,
  790.       "\t\t3.  The ability to scroll windows down, right and left\n" );
  791.  
  792.    wn_printf( wn_10,
  793.       "\t\t    in addition to the up scrolling seen in this demo.\n" );
  794.  
  795.    wn_printf( wn_10,
  796.       "\t\t4.  A much more comprehensive help system that will\n" );
  797.  
  798.    wn_printf( wn_10,
  799.       "\t\t    allow the use of a standard ASCII help file keyed\n" );
  800.  
  801.    wn_printf( wn_10,
  802.       "\t\t    from a passed help tag.  This will help in making\n" );
  803.  
  804.    wn_printf( wn_10,
  805.       "\t\t    a more robust context sensitive application.\n" );
  806.  
  807.    wn_printf( wn_10,
  808.       "\t\t5.  The possibility of graphics windows is being explored\n" );
  809.  
  810.    wn_printf( wn_10,
  811.       "\t\t6.  Additional sound functions.\n" );
  812.  
  813.  
  814.  
  815.  
  816.    uc_key();
  817.  
  818.  
  819.    wn_hide( wn_10 );
  820.  
  821.    uc_key();
  822.  
  823.  
  824.    cur_on();           /* Turn the cursor back on for the user    */
  825.  
  826.  
  827.  
  828.                /* Set the screen border color to black    */
  829.    gr_bckgnd( BLACK );
  830.  
  831.             /* Bring the window down & restore the screen */
  832.    wn_hide( wn_1 );
  833.    wn_hide( wn_2 );
  834.    wn_hide( wn_8 );
  835.    wn_hide( wn_sub );
  836.    wn_hide( wn_main );
  837.  
  838. }
  839.