home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / beehive / utilitys / windom2.arc / WDEMO.MOD < prev    next >
Text File  |  1990-07-21  |  5KB  |  192 lines

  1. MODULE S9200;
  2.  
  3. FROM Windows IMPORT
  4.   wiOpen, wiShow, wiWriteln, wiClose, wiErase,
  5.   wiGethl, wiSethl, wiHlup , wiHldown, wst, y;
  6.  
  7. FROM TermAtt IMPORT
  8.   CursorOn, CursorOff;
  9.  
  10. FROM Terminal IMPORT
  11.   GotoXY, ClearScreen, ReadChar,
  12.   WriteString, WriteLn;
  13.  
  14. CONST
  15.   delay = 40000;
  16.   
  17. VAR
  18.   t1,t2,t3,t4,t5,t6,t7,t8,t9: wst;
  19.   ch: CHAR;
  20.   i: CARDINAL;
  21.  
  22. BEGIN
  23.   CursorOff;
  24.   ClearScreen;
  25.   t1 := "This is the windows demonstration program.";
  26.   t2 := "The program is written in the Z80 version";
  27.   t3 := "of Turbo Modula 2, release I.0.";
  28.   t4 := "Written by Bob Catiller for:";
  29.   t5 := "           Emerson Computer Power";
  30.   wiOpen(1,10,5,46,7,4);
  31.   wiShow(1);
  32.   wiWriteln(1,t1);
  33.   wiWriteln(1,t2);
  34.   wiWriteln(1,t3);
  35.   wiWriteln(1,t4);
  36.   wiWriteln(1,t5);
  37.   FOR i := 1 TO delay DO
  38.   END;(* FOR *)
  39.   wiErase(1);
  40.   wiClose(1);
  41.   t1 := "Up to 10 windows may be opened at one time.";
  42.   t2 := "Memory used by windows is dynamically";
  43.   t3 := "allocated as windows are opened.";
  44.   wiOpen(1,10,5,47,5,4);
  45.   wiShow(1);
  46.   wiWriteln(1,t1);
  47.   wiWriteln(1,t2);
  48.   wiWriteln(1,t3);
  49.   FOR i := 1 TO delay DO
  50.   END;(* FOR *)
  51.   wiErase(1);
  52.   wiClose(1);
  53.   t1 := "Memory space is de-allocated after a window";
  54.   t2 := "is closed. Text may be written to a window,";
  55.   t3 := "and a line of text may be highlighted. The";
  56.   t4 := "highlighting may be moved, and the current";
  57.   t5 := "row position of the highlighting may be";
  58.   t6 := "read from the window. The window routines";
  59.   t7 := "provide for building pop-up/pull-down menus";
  60.   t8 := "with selection of highlighted items.";
  61.   wiOpen(1,10,5,47,10,4);
  62.   wiShow(1);
  63.   wiWriteln(1,t1);
  64.   wiWriteln(1,t2);
  65.   wiWriteln(1,t3);
  66.   wiWriteln(1,t4);
  67.   wiWriteln(1,t5);
  68.   wiWriteln(1,t6);
  69.   wiWriteln(1,t7);
  70.   wiWriteln(1,t8);
  71.   GotoXY(0,0);
  72.   WriteString("Press any key to Continue.");
  73.   ReadChar(ch);
  74.   wiErase(1);
  75.   wiClose(1);
  76.   ClearScreen;
  77.   t1 := "Line 1 ";
  78.   t2 := "Line 2 ";
  79.   t3 := "Line 3 ";
  80.   t4 := "Line 4 ";
  81.   t5 := "Line 5 ";
  82.   t6 := "Line 6 ";
  83.   t7 := "Line 7 ";
  84.   t8 := "Line 8 ";
  85.   t9 := "Line 9 ";
  86.   wiOpen(1,5,10,10,10,1);
  87.   wiShow(1);
  88.   t1 := "Line 1 ";
  89.   t2 := "Line 2 ";
  90.   t3 := "Line 3 ";
  91.   t4 := "Line 4 ";
  92.   t5 := "Line 5 ";
  93.   t6 := "Line 6 ";
  94.   t7 := "Line 7 ";
  95.   t8 := "Line 8 ";
  96.   t9 := "Line 9 ";
  97.   wiOpen(1,5,10,10,10,1);
  98.   wiShow(1);
  99.   wiOpen(2,8,7,20,11,2);
  100.   wiShow(2);
  101.   wiOpen(3,11,6,20,11,3);
  102.   wiShow(3);
  103.   wiOpen(4,14,9,20,11,4);
  104.   wiShow(4);
  105.   wiOpen(5,17,11,20,11,5);
  106.   wiShow(5);
  107.   wiOpen(6,20,12,20,11,6);
  108.   wiShow(6);
  109.   wiOpen(7,40,1,20,11,7);
  110.   wiShow(7);
  111.   wiOpen(8,45,3,20,11,8);
  112.   wiShow(8);
  113.   wiOpen(9,50,6,20,11,9);
  114.   wiShow(9);
  115.   wiOpen(0,55,9,20,11,10);
  116.   wiShow(0);
  117.   wiWriteln(0,t1);
  118.   wiWriteln(0,t2);
  119.   wiWriteln(0,t3);
  120.   wiWriteln(0,t4);
  121.   wiWriteln(0,t5);
  122.   wiWriteln(0,t6);
  123.   wiWriteln(0,t7);
  124.   wiWriteln(0,t8);
  125.   wiWriteln(0,t9);
  126.   wiSethl(0,1);
  127.   GotoXY(0,0);
  128.   WriteString("These are the ten window types.");
  129.   WriteLn;
  130.   WriteString("Cursor up key moves highlighting up.");
  131.   WriteLn;
  132.   WriteString("Cusor down key moves highlighting down.");
  133.   WriteLn;
  134.   WriteString("Carriage return key to continue.");
  135.   ch := CHR(0);
  136.   WHILE ch <> CHR(13) DO
  137.     ReadChar(ch);
  138.     IF (ch = CHR(10)) OR (ch = " ") THEN (* Cur down key *)
  139.       wiHldown(0);
  140.     ELSIF ch = CHR(11) THEN (* Cur up key *)
  141.       wiHlup(0);
  142.     END;(* IF *)
  143.   END;(* WHILE *)
  144.   GotoXY(0,23);
  145.   wiGethl(0);(* Sets y to highlighted row *)
  146.   CASE y OF
  147.     | 1 : WriteString("Line 1 was selected.")
  148.     | 2 : WriteString("Line 2 was selected.")
  149.     | 3 : WriteString("Line 3 was selected.")
  150.     | 4 : WriteString("Line 4 was selected.")
  151.     | 5 : WriteString("Line 5 was selected.")
  152.     | 6 : WriteString("Line 6 was selected.")
  153.     | 7 : WriteString("Line 7 was selected.")
  154.     | 8 : WriteString("Line 8 was selected.")
  155.     | 9 : WriteString("Line 9 was selected.")
  156.   END;(* CASE *)
  157.   GotoXY(40,23);
  158.   WriteString("Press any Key to continue.");
  159.   ReadChar(ch);
  160.   wiErase(0);
  161.   wiClose(0);
  162.   wiShow(9);
  163.   wiErase(9);
  164.   wiClose(9);
  165.   wiShow(8);
  166.   wiErase(8);
  167.   wiClose(8);
  168.   wiShow(7);
  169.   wiErase(7);
  170.   wiClose(7);
  171.   wiShow(6);
  172.   wiErase(6);
  173.   wiClose(6);
  174.   wiShow(5);
  175.   wiErase(5);
  176.   wiClose(5);
  177.   wiShow(4);
  178.   wiErase(4);
  179.   wiClose(4);
  180.   wiShow(3);
  181.   wiErase(3);
  182.   wiClose(3);
  183.   wiShow(2);
  184.   wiErase(2);
  185.   wiClose(2);
  186.   wiShow(1);
  187.   wiErase(1);
  188.   wiClose(1);
  189.   ClearScreen;
  190.   CursorOn;
  191. END S9200.
  192.