This is README file for class TERMINAL

  (for CIM 3.33 port for Win 95/NT under GNU-C 2.8.1 Mingw32)
  (implemeted by Petr Novak 1999)

General:
========

Class Terminal (the interface) was portet from PC-simula.
The implentation has been extended in some functionality (see below).

* Terminal is already composed in the cim library,
  thus the declaration should be only:

    external class terminal;
    ------------------------

* Window size could be (25,80) or (50,80) (in the 'open' method)

* Known differences between runtime on 95 and NT:
  - 'outimage' on NT does not set the current attribute to the end of the line
  - Auto wrap (off) at end of line does not work at 95.

* To see the functionality of Terminal compile and run exaples:
    ttest.sim            /*  my debugging program. Shows some fctions        */
    keyin.sim            /*  for testing the method KeyIn (keyboard & mouse) */

* You can allways look in the source of interfaces for more information:
    terminal.sim, keyboard.ins

* National character set:
    If you have enabled your national set for dos window
      your program will write characters using your national character set.
    On NT: it will read national characters (when national keyboard set)

Additional functionality (methods and atributes)
================================================

* Mouse events:
  - init the mouse by: setMouse (true);
  - you can read mouse events using the same: 'inchar', 'ifchar'
  - your programs without mouse handling will work the same way !!!
  - you can recognise a mouse event: 'wasMouse'  /* recommended  !!! */
    or simple by lastKey.fkey
  - See 'keyboard.ins' for lastKey format and constants !!!
  - The actual mouse position is in lastKey.x, lastKey.y
  - Do observations with keyin.sim

* Keyboard events
  - The main info you get from lastKey.map (as in PC-Simula)
  - Function-keys are not coded together with controll keys:
    * 'fKey' will contain the pressed key
    * 'c0', 'c1' actual state of controll keys (see constants in keyboard.ins)
  - Do observations with keyin.sim

* Editing:
  - Procedures for deeding preprint text were added. This procedures are:
      editText, editInt, editReal, editFrac
 
  - If user make mistake in format of input word (e.g. wrong integer),
    the message on the last line appears. You can disable it by setting:
      silentDeedit := true;

    When user puts wrong word:
      the method 'lastError' will return some error text.
    Otherwise (if success)
      lastError will return 'notext'

  - Default mode is overwrite. You can change it by:
      setInsert (true);         /* this will change the cursor size too */
      or pressing the <Insert> key when editing

* Cursor methods: 'showCursor', 'hideCursor'

* Actual window size: 'maxx', 'maxy' 

* Suspending your program for 'n' milliseconds:  sleep (n);

* Processing characters with ascii < 32:
  - if you set: printAll (false)   /* this is default */
      then all input and output characters are processed
      (like 13 == cr, 7 == beep, ...)
  - if you set: printAll (true)
      then all character (0-255) are printed (see ttest.sim)

* Test of set bit: isSet     /* e.g. isSet (lastKey.c0, SHIFT_PRESSED) */
    This function is very usefull for testing controll keys or mouse buttons.
    Constants are defined in 'keyboard.ins' 

* Clear input buffer: 'flushInput'
    Usefull before editing or waiting for user key/mouse hit.

* Listen of key release too: listenReleaseKeys (true)  /* try keyin.sim */
    Then the lastKey.c2 will be set to '!1!' for key release (otherwise '!0!')

* Listen for all keys (controll keys included): listenControllKeys (true)
    I suggest to do some observations with the example 'keyin.sim'

* If you want to make an atribute from atribute code (0-255) use: attributeCode

New methods declarations:
=========================

  New methods in "terminal.sim":

    boolean silentDeedit;
    text procedure lastError;
    short integer procedure maxx; 
    short integer procedure maxy; 
    text procedure edittext(t, w); name t; short integer w; text t;
    integer procedure editint(t, w); text t; short integer w;
    long real procedure editreal(t, w); text t; short integer w;
    integer procedure editfrac(t, w); text t; short integer w;
    ref(Attributes) procedure attributeCode (a); short integer a;
    procedure showCursor;
    procedure hideCursor;
    procedure sleep (ms); integer ms;
    procedure printAll (enable); boolean enable;
    boolean procedure isSet (character attribute, integer bit);

  These methods are public (why not):

    short integer procedure wAND(i,j); short integer i,j; ;
    short integer procedure wOR(i,j); short integer i,j; ;
    short integer procedure wSHL(i,j); short integer i,j; ;
    short integer procedure wSHR(i,j); short integer i,j; ;

  New functionality in "keyboard.ins":

    procedure flushInput;;
    procedure listenControllKeys (enable); boolean enable;
    procedure listenReleaseKeys (enable); boolean enable;
    procedure setInsert (on); boolean on;
    procedure setMouse (on); boolean on;

---------------------------------------------------------------------------
