home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / files / dev / obero / oberon-a / source / fpe / tooldlgtpl.mod < prev   
Text File  |  1994-08-08  |  6KB  |  261 lines

  1. (***************************************************************************
  2.  
  3.      $RCSfile: ToolDlgTpl.mod $
  4.   Description: Defines and implements the IntuiSup template for the tool
  5.                editor dialog.
  6.  
  7.    Created by: fjc (Frank Copeland)
  8.     $Revision: 1.6 $
  9.       $Author: fjc $
  10.         $Date: 1994/08/08 16:13:59 $
  11.  
  12.   Copyright © 1993-1994, Frank Copeland.
  13.   This file is part of FPE.
  14.   See FPE.doc for conditions of use and distribution.
  15.  
  16.   Log entries are at the end of the file.
  17.  
  18. ***************************************************************************)
  19.  
  20. MODULE ToolDlgTpl;
  21.  
  22. (*
  23. ** $C= CaseChk       $I= IndexChk  $L= LongAdr   $N- NilChk
  24. ** $P= PortableCode  $R= RangeChk  $S= StackChk  $T= TypeChk
  25. ** $V= OvflChk       $Z= ZeroVars
  26. **
  27. ** Compiler NIL checking is replaced by ASSERTs at the appropriate places.
  28. *)
  29.  
  30. IMPORT
  31.   E := Exec, G := Graphics, I := Intuition, ISup := IntuiSup, Data,
  32.   SYS := SYSTEM;
  33.  
  34.  
  35. (*------------------------------------*)
  36. (* Project Information *)
  37.  
  38. CONST
  39.  
  40.   LeftEdge * = 0;
  41.   TopEdge * = 0;
  42.   Width * = 465;
  43.  
  44. VAR
  45.   Height * : INTEGER;
  46.  
  47.  
  48. (*------------------------------------*)
  49. (* Gadget data *)
  50.  
  51. CONST
  52.  
  53.   NumGadgetDatas * = 11;
  54.  
  55. TYPE
  56.  
  57.   GadgetDataPtr * = POINTER TO GadgetData;
  58.  
  59.   GadgetData * = RECORD
  60.     g0 *  : ISup.InputData;
  61.     g1 *  : ISup.InputData;
  62.     g2 *  : ISup.InputData;
  63.     g3 *  : ISup.CheckData;
  64.     g4 *  : ISup.CheckData;
  65.     g6 *  : ISup.InputData;
  66.     g8 *  : ISup.InputData;
  67.     g9 *  : ISup.ButtonData;
  68.     g10 * : ISup.ButtonData;
  69.     dataEnd : LONGINT;
  70.   END; (* GadgetData *)
  71.  
  72.  
  73. (*------------------------------------*)
  74. (* Template data structure *)
  75.  
  76. TYPE
  77.  
  78.   Template * = RECORD
  79.     GadgetData * : GadgetDataPtr;
  80.   END; (* Template *)
  81.  
  82.  
  83. (*------------------------------------*)
  84. (* Local procedures *)
  85.  
  86.  
  87. (*------------------------------------*)
  88. (* Font data *)
  89.  
  90.  
  91. (*------------------------------------*)
  92. PROCEDURE TextHeight () : INTEGER;
  93.  
  94.   VAR scr : I.Screen;
  95.  
  96. BEGIN (* TextHeight *)
  97.   IF I.base.GetScreenData (scr, SIZE (I.Screen), {I.wbenchScreen}, NIL) THEN
  98.     RETURN scr.font.ySize
  99.   ELSE
  100.     RETURN 8
  101.   END
  102. END TextHeight;
  103.  
  104.  
  105. (*------------------------------------*)
  106. (* Gadget data *)
  107.  
  108. (*------------------------------------*)
  109. PROCEDURE InitGadgetData (gd : GadgetDataPtr);
  110.  
  111.   VAR textHeight : INTEGER;
  112.  
  113. BEGIN (* InitGadgetData *)
  114.   ASSERT (gd # NIL, 137);
  115.   textHeight := TextHeight ();
  116.  
  117.   gd.g0.type := ISup.string;
  118.   gd.g0.flags := {ISup.gdTextLeft, ISup.gdInputAutoActivate};
  119.   gd.g0.leftEdge := 128;
  120.   gd.g0.topEdge := textHeight + 7;
  121.   gd.g0.width := 115;
  122.   gd.g0.height := textHeight + 6;
  123.   gd.g0.text := SYS.ADR("Button");
  124.   gd.g0.textAttr := NIL;
  125.   gd.g0.len := Data.ButtonChars;
  126.   gd.g0.activateNext := 1;
  127.   gd.g0.activatePrev := 6;
  128.  
  129.   gd.g1.type := ISup.string;
  130.   gd.g1.flags := {ISup.gdTextLeft, ISup.gdInputAutoActivate};
  131.   gd.g1.leftEdge := 128;
  132.   gd.g1.topEdge := (2 * textHeight) + 16;
  133.   gd.g1.width := 325;
  134.   gd.g1.height := textHeight + 6;
  135.   gd.g1.text := SYS.ADR("Command");
  136.   gd.g1.textAttr := NIL;
  137.   gd.g1.len := Data.PathChars;
  138.   gd.g1.activateNext := 2;
  139.   gd.g1.activatePrev := 0;
  140.  
  141.   gd.g2.type := ISup.string;
  142.   gd.g2.flags := {ISup.gdTextLeft, ISup.gdInputAutoActivate};
  143.   gd.g2.leftEdge := 128;
  144.   gd.g2.topEdge := (3 * textHeight) + 25;
  145.   gd.g2.width := 325;
  146.   gd.g2.height := textHeight + 6;
  147.   gd.g2.text := SYS.ADR("Arguments");
  148.   gd.g2.textAttr := NIL;
  149.   gd.g2.len := Data.PathChars;
  150.   gd.g2.activateNext := 5;
  151.   gd.g2.activatePrev := 1;
  152.  
  153.   gd.g3.type := ISup.check;
  154.   gd.g3.flags := {ISup.gdTextRight};
  155.   gd.g3.leftEdge := 298;
  156.   gd.g3.topEdge := textHeight + 8;
  157.   gd.g3.width := 27;
  158.   gd.g3.height := textHeight + 3;
  159.   gd.g3.text := SYS.ADR("Active ?");
  160.   gd.g3.textAttr := NIL;
  161.  
  162.   gd.g4.type := ISup.check;
  163.   gd.g4.leftEdge := 13;
  164.   gd.g4.topEdge := (4 * textHeight) + 35;
  165.   gd.g4.width := 27;
  166.   gd.g4.height := textHeight + 3;
  167.  
  168.   gd.g6.type := ISup.string;
  169.   gd.g6.flags := {ISup.gdTextLeft, ISup.gdInputAutoActivate};
  170.   gd.g6.leftEdge := 128;
  171.   gd.g6.topEdge := (4 * textHeight) + 34;
  172.   gd.g6.width := 325;
  173.   gd.g6.height := textHeight + 6;
  174.   gd.g6.text := SYS.ADR("Console");
  175.   gd.g6.textAttr := NIL;
  176.   gd.g6.len := Data.ConsoleChars;
  177.   gd.g6.activateNext := 6;
  178.   gd.g6.activatePrev := 2;
  179.  
  180.   gd.g8.type := ISup.integer;
  181.   gd.g8.flags := {ISup.gdTextLeft, ISup.gdInputAutoActivate};
  182.   gd.g8.leftEdge := 128;
  183.   gd.g8.topEdge := (5 * textHeight) + 43;
  184.   gd.g8.width := 75;
  185.   gd.g8.height := textHeight + 6;
  186.   gd.g8.text := SYS.ADR("Stack");
  187.   gd.g8.textAttr := NIL;
  188.   gd.g8.len := 5;
  189.   gd.g8.activateNext := 0;
  190.   gd.g8.activatePrev := 5;
  191.   gd.g8.default := SYS.VAL (E.APTR, 4000);
  192.  
  193.   gd.g9.type := ISup.button;
  194.   gd.g9.leftEdge := 248;
  195.   gd.g9.topEdge := (6 * textHeight) + 52;
  196.   gd.g9.width := 100;
  197.   gd.g9.height := textHeight + 6;
  198.   gd.g9.text := SYS.ADR("Accept");
  199.   gd.g9.textAttr := NIL;
  200.  
  201.   gd.g10.type := ISup.button;
  202.   gd.g10.flags := {ISup.gdTextColor2};
  203.   gd.g10.leftEdge := 353;
  204.   gd.g10.topEdge := (6 * textHeight) + 52;
  205.   gd.g10.width := 100;
  206.   gd.g10.height := textHeight + 6;
  207.   gd.g10.text := SYS.ADR("Cancel");
  208.   gd.g10.textAttr := NIL;
  209.  
  210.   gd.dataEnd := ISup.dataEnd;
  211. END InitGadgetData;
  212.  
  213.  
  214. (*------------------------------------*)
  215. (* Exported procedures *)
  216.  
  217.  
  218. (*------------------------------------*)
  219. PROCEDURE InitTemplate * (VAR template : Template);
  220.  
  221. BEGIN (* InitTemplate *)
  222.   Height := (7 * TextHeight()) + 64;
  223.   NEW (template.GadgetData);
  224.   InitGadgetData (template.GadgetData)
  225. END InitTemplate;
  226.  
  227.  
  228. (*------------------------------------*)
  229. PROCEDURE CleanupTemplate * (VAR template : Template);
  230.  
  231. BEGIN (* CleanupTemplate *)
  232.   SYS.DISPOSE (template.GadgetData)
  233. END CleanupTemplate;
  234.  
  235.  
  236. END ToolDlgTpl.
  237.  
  238. (***************************************************************************
  239.  
  240.   $Log: ToolDlgTpl.mod $
  241.   Revision 1.6  1994/08/08  16:13:59  fjc
  242.   Release 1.4
  243.  
  244.   Revision 1.5  1994/06/17  17:32:19  fjc
  245.   - Updated for release
  246.  
  247.   Revision 1.4  1994/06/04  23:49:52  fjc
  248.   - Changed to use new Amiga interface
  249.  
  250.   Revision 1.3  1994/05/12  21:26:09  fjc
  251.   - Prepared for release
  252.  
  253.   Revision 1.2  1994/01/24  14:33:33  fjc
  254.   Changed version control header
  255.  
  256.   Revision 1.1  1994/01/15  17:32:38  fjc
  257.   Start of revision control
  258.  
  259. ***************************************************************************)
  260.  
  261.