home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / beehive / utilitys / swdemo15.arc / CDEMODAT.C next >
Text File  |  1991-08-11  |  4KB  |  129 lines

  1. /***********************************************************************
  2.  
  3. File: CDEMODAT.C
  4.  
  5. Use:  SWIND Demo Window 0 menu file
  6.       Eugene Nolan
  7.       Copyright 1989, All rights reserved
  8.  
  9.    In "C", a \XXX is the representation of the octal value of XXX
  10.  
  11.    So    \033 = 1Bh = ESCape
  12.     \377 = FFh
  13.     etc, etc
  14.  
  15.     and "C" also has the constants
  16.  
  17.     \n = Newline         = 0Ah
  18.     \r = Carriage return = 0Dh
  19.  
  20.    In this file, the following sequences are for:
  21.  
  22.     \033G\XXX\YYY    is the string  1Bh,'G',X,Y = virtual term position
  23.                              the cursor command
  24.     \033F\XXX    is the string  1Bh,'F',X   = virtual term set
  25.                              attributes command
  26.  
  27.    Note: \376 is a flag to the demo code that this byte of info
  28.      is really a 00h, but "C" uses 00h to terminate it's strings,
  29.      so a flag is required.
  30.  
  31. *************************************************************************/
  32.  
  33. static char *pnt;
  34.  
  35.         /**** Window 0 main menu  ****/
  36.  
  37. char *menu[]= {
  38.     "\033G\034\376\033F\007\377",
  39.     "SWIND Windowing Library\033F\376\377",
  40.     "\033G\042\001\377",
  41.     "Eugene Nolan\n\r\377",
  42.     "  Control Commands\033G\062\002Cursor Commands\n\r\377",
  43.     "\033F\007Esc-1\033F\376  1 on Top\n\r\377",
  44.     "\033F\007Esc-2\033F\376  2 on Top\n\r\377",
  45.     "\033F\007Esc-3\033F\376  3 on Top\n\r\377",
  46.     "\033F\007Esc-4\033F\376  1 hide\n\r\377",
  47.     "\033F\007Esc-5\033F\376  2 hide\n\r\377",
  48.     "\033F\007Esc-6\033F\376  3 hide\n\r\377",
  49.     "\033F\007Esc-Esc-Esc\033F\376 Quit\r\377",
  50.     "\n\r\377",
  51.     "\033F\007Esc-D\033F\376  Move -X\n\r\377",
  52.     "\033F\007Esc-E\033F\376  Move +X\n\r\377",
  53.     "\033F\007Esc-F\033F\376  Move -Y\n\r\377",
  54.     "\033F\007Esc-G\033F\376  Move +Y\n\r\377",
  55.     "\033F\007Esc-H\033F\376  Size -XY\n\r\377",
  56.     "\033F\007Esc-I\033F\376  Size +XY\n\r\n\r\377",
  57.     "\033F\007Esc-J\033F\376  Tog  Wrap\n\r\377",
  58.     "\033F\007Esc-K\033F\376  Tog  Inside\n\r\377",
  59.     "\033F\007Esc-L\033F\376  Tog  Bord\n\r\377",
  60.     "\033F\007Esc-M\033F\376  Tog  AutoNL\n\r\377",
  61.     "\033F\007Esc-N\033F\376  Random XY\377",
  62.     "\033G\022\003\033F\007Esc-7\033F\376\377",
  63.     "  1 Unhide\377",
  64.     "\033G\022\004\033F\007Esc-8\033F\376\377",
  65.     "  2 Unhide\377",
  66.     "\033G\022\005\033F\007Esc-9\033F\376\377",
  67.     "  3 Unhide\377",
  68.     "\033G\022\006\033F\007Esc-A\033F\376\377",
  69.     "  1 Active\377",
  70.     "\033G\022\007\033F\007Esc-B\033F\376\377",
  71.     "  2 Active\377",
  72.     "\033G\022\010\033F\007Esc-C\033F\376\377",
  73.     "  3 Active\377",
  74.     "\033G\046\003On Top\377",
  75.     "\033G\046\004Active\377",
  76.     "\033G\060\003\033F\007^W\033F\376\377",
  77.     "\033G\060\004\033F\007^E\033F\376\377",
  78.     "\033G\060\005/\\\377",
  79.     "\033G\056\006\033F\007^S\033F\376  \377",
  80.     "\033F\007^D\033F\376\377",
  81.     "\033G\060\007\\/\377",
  82.     "\033G\060\010\033F\007^X\033F\376\377",
  83.     "\033G\060\011\033F\007^Z\033F\376\377",
  84.     "\033G\070\003\033F\007^Y\033F\376    DelLin\377",
  85.     "\033G\070\004\033F\007^Q^Y\033F\376  DelEol\377",
  86.     "\033G\070\005\033F\007^Q^H\033F\376  DelBol\377",
  87.     "\033G\070\006\033F\007^Q^B\033F\376  TogBold\377",
  88.     "\033G\070\007\033F\007^Q^U\033F\376  InsLin\377",
  89.     "\033G\070\010\033F\007^Q^A\033F\376  ClrWin\377"
  90. };
  91.  
  92. int msize ={ sizeof(menu)/sizeof(pnt) };    /* msize=# of elements
  93.                            in array menu */
  94.  
  95.  
  96. char selpos[] = "\033G\044\004\376";        /* Cursor position in W0
  97.                            to say which window
  98.                            is currently selected */
  99. char toppos[] = "\033G\044\003\376";        /* Cursor position in W0
  100.                            to say which window
  101.                            is on top */
  102.  
  103.                         /* Virtual terminal codes */
  104. char curup[] = "\033K";                
  105. char curdw[] = "\033L";
  106. char curlf[] = "\033J";
  107. char currt[] = "\033I";
  108. char revlf[] = "\033H";
  109. char inslin[] = "\033A";
  110. char dellin[] = "\033B";
  111. char erabol[] = "\033D";
  112. char eraeol[] = "\033C";
  113. char erawin[] = "\033E";
  114. char boldon[] = "\033F\007";
  115. char boldof[] = "\033F";
  116. char clrwin[] = "\033E";
  117.  
  118. char ishidn[] = "\033G\044\007\033F\007Hidden\377";  /* demo message in window 0
  119.                             to say window hidden */
  120. char ishid1[] = "\033G\044\007\033F\376      \377";
  121.  
  122.                              /* Demo message to say
  123.                             only unhide or quit
  124.                             is valid */
  125. char isnon[] =
  126. "\033G\044\007\033F\007Unhide\033G\046\010Or\033G\045\011Quit\033F\376\377";
  127. char isnon1[] =
  128.     "\033G\044\007      \033G\046\010  \033G\045\011    \377";
  129.