home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 2
/
goldfish_vol2_cd1.bin
/
files
/
dev
/
obero
/
oberon-a
/
source
/
fpe
/
tooldlgtpl.mod
< prev
Wrap
Text File
|
1994-08-08
|
6KB
|
261 lines
(***************************************************************************
$RCSfile: ToolDlgTpl.mod $
Description: Defines and implements the IntuiSup template for the tool
editor dialog.
Created by: fjc (Frank Copeland)
$Revision: 1.6 $
$Author: fjc $
$Date: 1994/08/08 16:13:59 $
Copyright © 1993-1994, Frank Copeland.
This file is part of FPE.
See FPE.doc for conditions of use and distribution.
Log entries are at the end of the file.
***************************************************************************)
MODULE ToolDlgTpl;
(*
** $C= CaseChk $I= IndexChk $L= LongAdr $N- NilChk
** $P= PortableCode $R= RangeChk $S= StackChk $T= TypeChk
** $V= OvflChk $Z= ZeroVars
**
** Compiler NIL checking is replaced by ASSERTs at the appropriate places.
*)
IMPORT
E := Exec, G := Graphics, I := Intuition, ISup := IntuiSup, Data,
SYS := SYSTEM;
(*------------------------------------*)
(* Project Information *)
CONST
LeftEdge * = 0;
TopEdge * = 0;
Width * = 465;
VAR
Height * : INTEGER;
(*------------------------------------*)
(* Gadget data *)
CONST
NumGadgetDatas * = 11;
TYPE
GadgetDataPtr * = POINTER TO GadgetData;
GadgetData * = RECORD
g0 * : ISup.InputData;
g1 * : ISup.InputData;
g2 * : ISup.InputData;
g3 * : ISup.CheckData;
g4 * : ISup.CheckData;
g6 * : ISup.InputData;
g8 * : ISup.InputData;
g9 * : ISup.ButtonData;
g10 * : ISup.ButtonData;
dataEnd : LONGINT;
END; (* GadgetData *)
(*------------------------------------*)
(* Template data structure *)
TYPE
Template * = RECORD
GadgetData * : GadgetDataPtr;
END; (* Template *)
(*------------------------------------*)
(* Local procedures *)
(*------------------------------------*)
(* Font data *)
(*------------------------------------*)
PROCEDURE TextHeight () : INTEGER;
VAR scr : I.Screen;
BEGIN (* TextHeight *)
IF I.base.GetScreenData (scr, SIZE (I.Screen), {I.wbenchScreen}, NIL) THEN
RETURN scr.font.ySize
ELSE
RETURN 8
END
END TextHeight;
(*------------------------------------*)
(* Gadget data *)
(*------------------------------------*)
PROCEDURE InitGadgetData (gd : GadgetDataPtr);
VAR textHeight : INTEGER;
BEGIN (* InitGadgetData *)
ASSERT (gd # NIL, 137);
textHeight := TextHeight ();
gd.g0.type := ISup.string;
gd.g0.flags := {ISup.gdTextLeft, ISup.gdInputAutoActivate};
gd.g0.leftEdge := 128;
gd.g0.topEdge := textHeight + 7;
gd.g0.width := 115;
gd.g0.height := textHeight + 6;
gd.g0.text := SYS.ADR("Button");
gd.g0.textAttr := NIL;
gd.g0.len := Data.ButtonChars;
gd.g0.activateNext := 1;
gd.g0.activatePrev := 6;
gd.g1.type := ISup.string;
gd.g1.flags := {ISup.gdTextLeft, ISup.gdInputAutoActivate};
gd.g1.leftEdge := 128;
gd.g1.topEdge := (2 * textHeight) + 16;
gd.g1.width := 325;
gd.g1.height := textHeight + 6;
gd.g1.text := SYS.ADR("Command");
gd.g1.textAttr := NIL;
gd.g1.len := Data.PathChars;
gd.g1.activateNext := 2;
gd.g1.activatePrev := 0;
gd.g2.type := ISup.string;
gd.g2.flags := {ISup.gdTextLeft, ISup.gdInputAutoActivate};
gd.g2.leftEdge := 128;
gd.g2.topEdge := (3 * textHeight) + 25;
gd.g2.width := 325;
gd.g2.height := textHeight + 6;
gd.g2.text := SYS.ADR("Arguments");
gd.g2.textAttr := NIL;
gd.g2.len := Data.PathChars;
gd.g2.activateNext := 5;
gd.g2.activatePrev := 1;
gd.g3.type := ISup.check;
gd.g3.flags := {ISup.gdTextRight};
gd.g3.leftEdge := 298;
gd.g3.topEdge := textHeight + 8;
gd.g3.width := 27;
gd.g3.height := textHeight + 3;
gd.g3.text := SYS.ADR("Active ?");
gd.g3.textAttr := NIL;
gd.g4.type := ISup.check;
gd.g4.leftEdge := 13;
gd.g4.topEdge := (4 * textHeight) + 35;
gd.g4.width := 27;
gd.g4.height := textHeight + 3;
gd.g6.type := ISup.string;
gd.g6.flags := {ISup.gdTextLeft, ISup.gdInputAutoActivate};
gd.g6.leftEdge := 128;
gd.g6.topEdge := (4 * textHeight) + 34;
gd.g6.width := 325;
gd.g6.height := textHeight + 6;
gd.g6.text := SYS.ADR("Console");
gd.g6.textAttr := NIL;
gd.g6.len := Data.ConsoleChars;
gd.g6.activateNext := 6;
gd.g6.activatePrev := 2;
gd.g8.type := ISup.integer;
gd.g8.flags := {ISup.gdTextLeft, ISup.gdInputAutoActivate};
gd.g8.leftEdge := 128;
gd.g8.topEdge := (5 * textHeight) + 43;
gd.g8.width := 75;
gd.g8.height := textHeight + 6;
gd.g8.text := SYS.ADR("Stack");
gd.g8.textAttr := NIL;
gd.g8.len := 5;
gd.g8.activateNext := 0;
gd.g8.activatePrev := 5;
gd.g8.default := SYS.VAL (E.APTR, 4000);
gd.g9.type := ISup.button;
gd.g9.leftEdge := 248;
gd.g9.topEdge := (6 * textHeight) + 52;
gd.g9.width := 100;
gd.g9.height := textHeight + 6;
gd.g9.text := SYS.ADR("Accept");
gd.g9.textAttr := NIL;
gd.g10.type := ISup.button;
gd.g10.flags := {ISup.gdTextColor2};
gd.g10.leftEdge := 353;
gd.g10.topEdge := (6 * textHeight) + 52;
gd.g10.width := 100;
gd.g10.height := textHeight + 6;
gd.g10.text := SYS.ADR("Cancel");
gd.g10.textAttr := NIL;
gd.dataEnd := ISup.dataEnd;
END InitGadgetData;
(*------------------------------------*)
(* Exported procedures *)
(*------------------------------------*)
PROCEDURE InitTemplate * (VAR template : Template);
BEGIN (* InitTemplate *)
Height := (7 * TextHeight()) + 64;
NEW (template.GadgetData);
InitGadgetData (template.GadgetData)
END InitTemplate;
(*------------------------------------*)
PROCEDURE CleanupTemplate * (VAR template : Template);
BEGIN (* CleanupTemplate *)
SYS.DISPOSE (template.GadgetData)
END CleanupTemplate;
END ToolDlgTpl.
(***************************************************************************
$Log: ToolDlgTpl.mod $
Revision 1.6 1994/08/08 16:13:59 fjc
Release 1.4
Revision 1.5 1994/06/17 17:32:19 fjc
- Updated for release
Revision 1.4 1994/06/04 23:49:52 fjc
- Changed to use new Amiga interface
Revision 1.3 1994/05/12 21:26:09 fjc
- Prepared for release
Revision 1.2 1994/01/24 14:33:33 fjc
Changed version control header
Revision 1.1 1994/01/15 17:32:38 fjc
Start of revision control
***************************************************************************)