home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / languages / obrn-a_1.5_lib.lha / oberon-a / source2.lha / Source / 3rdParty / TextFieldGadget.mod < prev    next >
Encoding:
Text File  |  1995-01-24  |  3.5 KB  |  136 lines

  1. (***************************************************************************
  2.  
  3.      $RCSfile: TextFieldGadget.mod $
  4.   Description: Interface to triton.library
  5.  
  6.    Created by: Helmuth Ritzer
  7.     $Revision: 2.0 $
  8.       $Author: hr $
  9.         $Date: 1995/01/21 16:15:40 $
  10.  
  11.   Copyright © 1994 Mark Thomas
  12.   Translated for Oberon-A by Helmuth Ritzer, June 1994
  13.   Minor modifications for Oberon-A Release 1.4 by Frank Copeland.
  14.   Adapted to V2.0 by Helmuth Ritzer, Jan 1995
  15.  
  16. ***************************************************************************)
  17.  
  18. <* STANDARD- *> <* INITIALISE- *> <* MAIN- *>
  19.  
  20. MODULE [2] TextFieldGadget;
  21.  
  22. <*$ CaseChk-  IndexChk- LongVars+ NilChk-  *>
  23. <*$ RangeChk- StackChk- TypeChk-  OvflChk- *>
  24.  
  25. IMPORT SYS := SYSTEM, Kernel, E := Exec, I := Intuition, U := Utility;
  26.  
  27.  
  28. CONST
  29.   tagBase           = U.user + 04000000H;
  30.  
  31.   (* V1.0 *)
  32.   text *          = tagBase + 1;
  33.   insertText *    = tagBase + 2;
  34.   textFont *      = tagBase + 3;
  35.   delimiters *    = tagBase + 4;
  36.   top *           = tagBase + 5;
  37.   blockCursor *   = tagBase + 6;
  38.   size *          = tagBase + 7;
  39.   visible *       = tagBase + 8;
  40.   lines *         = tagBase + 9;
  41.   noGhost *       = tagBase + 10;
  42.   maxSize *       = tagBase + 11;
  43.   border *        = tagBase + 12;
  44.   textAttr *      = tagBase + 13;
  45.   fontStyle *     = tagBase + 14;
  46.   up *            = tagBase + 15;
  47.   down *          = tagBase + 16;
  48.   alignment *     = tagBase + 17;
  49.   vCenter *       = tagBase + 18;
  50.   ruledPaper *    = tagBase + 19;
  51.   paperPen *      = tagBase + 20;
  52.   inkPen *        = tagBase + 21;
  53.   linePen *       = tagBase + 22;
  54.   userAlign *     = tagBase + 23;
  55.   spacing *       = tagBase + 24;
  56.   clipStream *    = tagBase + 25;
  57.   clipStream2 *   = tagBase + 26;
  58.   blinkRate *     = tagBase + 27;
  59.   inverted *      = tagBase + 28;
  60.   partial *       = tagBase + 29;
  61.   cursorPos *     = tagBase + 30;
  62.  
  63.   (* V2.0 *)
  64.   readOnly *      = tagBase + 31;
  65.   modified *      = tagBase + 32;
  66.   acceptChars *   = tagBase + 33;
  67.   rejectChars *   = tagBase + 34;
  68.   passCommand *   = tagBase + 35;
  69.   lineLength *    = tagBase + 36;
  70.   maxSizeBeep *   = tagBase + 37;
  71.   deleteText *    = tagBase + 38;
  72.   selectSize *    = tagBase + 39;
  73.   copy *          = tagBase + 40;
  74.   copyAll *       = tagBase + 41;
  75.   cut *           = tagBase + 42;
  76.   paste *         = tagBase + 43;
  77.   erase *         = tagBase + 44;
  78.   undo  *         = tagBase + 45;
  79.  
  80. (*
  81.  * TEXTFIELD_Border
  82.  *
  83.  * See docs for width and height sizes these borders are
  84.  *)
  85.  
  86.   borderNone *        = 0;
  87.   borderBevel *       = 1;
  88.   borderDoubleBevel * = 2;
  89.  
  90. (*
  91.  * TEXTFIELD_Alignment
  92.  *)
  93.  
  94.   alignLeft *         = 0;
  95.   alignCenter *       = 1;
  96.   alignRight *        = 2;
  97.  
  98.  
  99. TYPE
  100.   TextFieldBasePtr * = POINTER TO TextFieldBase;
  101.   TextFieldBase * = RECORD (E.Library) END;
  102.  
  103. CONST
  104.   name * = "gadgets/textfield.gadget";
  105.  
  106.  
  107. VAR
  108.   base * : TextFieldBasePtr;
  109.   textFieldClass * : I.IClassPtr; (* Use this for NewObject() calls *)
  110.  
  111. PROCEDURE GetClass* [base,-30] ()
  112.   : I.IClassPtr;
  113.  
  114. (*-- Library Base variable --------------------------------------------*)
  115.  
  116. <*$LongVars-*>
  117.  
  118. PROCEDURE* [0] CloseLib (VAR rc : LONGINT);
  119.   BEGIN
  120.     IF base # NIL THEN E.CloseLibrary (base) END;
  121.   END CloseLib;
  122.  
  123. PROCEDURE [0] OpenLib * (mustOpen : BOOLEAN);
  124.   BEGIN
  125.     IF base = NIL THEN
  126.       base := SYS.VAL(TextFieldBasePtr, E.OpenLibrary (name, 0));
  127.       IF base # NIL THEN Kernel.SetCleanup (CloseLib); textFieldClass := GetClass();
  128.       ELSIF mustOpen THEN HALT (100)
  129.       END
  130.     END
  131.   END OpenLib;
  132.  
  133. BEGIN
  134.   base := NIL; textFieldClass := NIL;
  135. END TextFieldGadget.
  136.