home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD2.bin
/
bbs
/
dev
/
oberon-a-1.4ß.lha
/
Oberon-A
/
source
/
FPE
/
FPETpl.mod
< prev
next >
Wrap
Text File
|
1994-08-08
|
9KB
|
351 lines
(***************************************************************************
$RCSfile: FPETpl.mod $
Description: Defines and implements the IntuiSup template for the main
FPE window.
Created by: fjc (Frank Copeland)
$Revision: 1.7 $
$Author: fjc $
$Date: 1994/08/08 16:14:33 $
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 FPETpl;
(*
** $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 * = 414;
VAR
Height * : INTEGER;
CONST
RenderInfoFlags * = {};
OpenWindowFlags * = {ISup.owCenterScreen};
WindowFlags * =
I.wflgSmartRefresh +
(*I.wflgSimpleRefresh +*)
{ I.wflgDragBar .. I.wflgCloseGadget,
I.wflgActivate, I.wflgNoCareRefresh };
GadgetIDCMPFlags * = ISup.giButton + ISup.giCheck + ISup.giListview;
(*------------------------------------*)
(* Gadget data *)
CONST
NumGadgetDatas * = 17;
TYPE
GadgetDataPtr * = POINTER TO GadgetData;
GadgetData * = RECORD
g0 * : ISup.ListViewData;
g1 * : ARRAY Data.NumFiles OF ISup.CheckData;
g2 * : ARRAY Data.NumTools OF ISup.ButtonData;
dataEnd : LONGINT;
END; (* GadgetData *)
(*------------------------------------*)
(* Text data *)
CONST
NumTextDatas * = 4;
(*------------------------------------*)
(* Border data *)
CONST
NumBorderDatas * = 1;
(*------------------------------------*)
(* Template data structure *)
TYPE
Template * = RECORD
GadgetData * : GadgetDataPtr;
TextData * : ISup.TextDataListPtr;
BorderData * : ISup.BorderDataListPtr;
END; (* Template *)
(*------------------------------------*)
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 9
END
END TextHeight;
(*------------------------------------*)
(* Gadget data *)
(*------------------------------------*)
PROCEDURE InitGadgetData (gd : GadgetDataPtr);
VAR textHeight : INTEGER;
BEGIN (* InitGadgetData *)
ASSERT (gd # NIL, 137);
textHeight := TextHeight();
gd.g0.type := ISup.listView;
gd.g0.flags := {ISup.gdTextAbove, ISup.gdListviewShowSelected};
gd.g0.leftEdge := 13;
gd.g0.topEdge := (3 * textHeight) + 19;
gd.g0.width := 143;
gd.g0.height := (5 * textHeight) + 4;
gd.g0.text := SYS.ADR("Modules");
gd.g1[0].type := ISup.check;
gd.g1[0].flags := {ISup.gdTextRight};
gd.g1[0].leftEdge := 13;
gd.g1[0].topEdge := (9 * textHeight) + 32;
gd.g1[0].width := 27;
gd.g1[0].height := textHeight + 3;
gd.g1[1].type := ISup.check;
gd.g1[1].flags := {ISup.gdTextRight};
gd.g1[1].leftEdge := 88;
gd.g1[1].topEdge := (9 * textHeight) + 32;
gd.g1[1].width := 27;
gd.g1[1].height := textHeight + 3;
gd.g1[2].type := ISup.check;
gd.g1[2].flags := {ISup.gdTextRight};
gd.g1[2].leftEdge := 13;
gd.g1[2].topEdge := (10 * textHeight) + 40;
gd.g1[2].width := 27;
gd.g1[2].height := textHeight + 3;
gd.g1[3].type := ISup.check;
gd.g1[3].flags := {ISup.gdTextRight};
gd.g1[3].leftEdge := 88;
gd.g1[3].topEdge := (10 * textHeight) + 40;
gd.g1[3].width := 27;
gd.g1[3].height := textHeight + 3;
gd.g2[0].type := ISup.button;
gd.g2[0].leftEdge := 165;
gd.g2[0].topEdge := (3 * textHeight) + 19;
gd.g2[0].width := 113;
gd.g2[0].height := textHeight + 6;
gd.g2[1].type := ISup.button;
gd.g2[1].leftEdge := 288;
gd.g2[1].topEdge := (3 * textHeight) + 19;
gd.g2[1].width := 113;
gd.g2[1].height := textHeight + 6;
gd.g2[2].type := ISup.button;
gd.g2[2].leftEdge := 165;
gd.g2[2].topEdge := (4 * textHeight) + 26;
gd.g2[2].width := 113;
gd.g2[2].height := textHeight + 6;
gd.g2[3].type := ISup.button;
gd.g2[3].leftEdge := 288;
gd.g2[3].topEdge := (4 * textHeight) + 26;
gd.g2[3].width := 113;
gd.g2[3].height := textHeight + 6;
gd.g2[4].type := ISup.button;
gd.g2[4].leftEdge := 165;
gd.g2[4].topEdge := (5 * textHeight) + 33;
gd.g2[4].width := 113;
gd.g2[4].height := textHeight + 6;
gd.g2[5].type := ISup.button;
gd.g2[5].leftEdge := 288;
gd.g2[5].topEdge := (5 * textHeight) + 33;
gd.g2[5].width := 113;
gd.g2[5].height := textHeight + 6;
gd.g2[6].type := ISup.button;
gd.g2[6].leftEdge := 165;
gd.g2[6].topEdge := (6 * textHeight) + 40;
gd.g2[6].width := 113;
gd.g2[6].height := textHeight + 6;
gd.g2[7].type := ISup.button;
gd.g2[7].leftEdge := 288;
gd.g2[7].topEdge := (6 * textHeight) + 40;
gd.g2[7].width := 113;
gd.g2[7].height := textHeight + 6;
gd.g2[8].type := ISup.button;
gd.g2[8].leftEdge := 165;
gd.g2[8].topEdge := (7 * textHeight) + 47;
gd.g2[8].width := 113;
gd.g2[8].height := textHeight + 6;
gd.g2[9].type := ISup.button;
gd.g2[9].leftEdge := 288;
gd.g2[9].topEdge := (7 * textHeight) + 47;
gd.g2[9].width := 113;
gd.g2[9].height := textHeight + 6;
gd.g2[10].type := ISup.button;
gd.g2[10].leftEdge := 165;
gd.g2[10].topEdge := (8 * textHeight) + 54;
gd.g2[10].width := 113;
gd.g2[10].height := textHeight + 6;
gd.g2[11].type := ISup.button;
gd.g2[11].leftEdge := 288;
gd.g2[11].topEdge := (8 * textHeight) + 54;
gd.g2[11].width := 113;
gd.g2[11].height := textHeight + 6;
gd.dataEnd := ISup.dataEnd;
END InitGadgetData;
(*------------------------------------*)
(* Text data *)
(*------------------------------------*)
PROCEDURE InitTextData (td : ISup.TextDataListPtr);
VAR textHeight : INTEGER;
(*$I-*)
BEGIN (* InitTextData *)
ASSERT (td # NIL, 137);
textHeight := TextHeight();
td[0].type := ISup.text;
td[0].leftEdge := 13;
td[0].topEdge := textHeight + 9;
td[0].text := SYS.ADR("Project");
td[1].type := ISup.text;
td[1].flags := {ISup.tdBackFill};
td[1].leftEdge := 95;
td[1].topEdge := textHeight + 9;
td[2].type := ISup.text;
td[2].leftEdge := 255;
td[2].topEdge := (2 * textHeight) + 15;
td[2].text := SYS.ADR("Tools");
td[3].type := ISup.text;
td[3].leftEdge := 59;
td[3].topEdge := (8 * textHeight) + 28;
td[3].text := SYS.ADR("Files");
td[4].type := ISup.dataEnd;
END InitTextData;
(*$I=*)
(*------------------------------------*)
(* Border data *)
(*------------------------------------*)
PROCEDURE InitBorderData (bd : ISup.BorderDataListPtr);
VAR textHeight : INTEGER;
(*$I-*)
BEGIN (* InitBorderData *)
ASSERT (bd # NIL, 137);
textHeight := TextHeight();
bd[0].type := ISup.box1In;
bd[0].leftEdge := 90;
bd[0].topEdge := textHeight + 7;
bd[0].width := 310;
bd[0].height := textHeight + 4;
bd[1].type := ISup.dataEnd;
END InitBorderData;
(*$I=*)
(*------------------------------------*)
PROCEDURE Init * (VAR template : Template);
BEGIN (* Init *)
Height := (11 * TextHeight()) + 50;
NEW (template.GadgetData);
InitGadgetData (template.GadgetData);
SYS.NEW
( template.TextData,
SIZE (ISup.TextData) * NumTextDatas + 4,
{E.memClear} );
InitTextData (template.TextData);
SYS.NEW
( template.BorderData,
SIZE (ISup.BorderData) * NumBorderDatas + 4,
{E.memClear} );
InitBorderData (template.BorderData)
END Init;
(*------------------------------------*)
PROCEDURE Cleanup * (VAR template : Template);
BEGIN (* Cleanup *)
SYS.DISPOSE (template.GadgetData);
SYS.DISPOSE (template.TextData);
SYS.DISPOSE (template.BorderData);
END Cleanup;
END FPETpl.
(***************************************************************************
$Log: FPETpl.mod $
Revision 1.7 1994/08/08 16:14:33 fjc
Release 1.4
Revision 1.6 1994/06/17 17:26:27 fjc
- Updated for release
Revision 1.5 1994/06/09 13:38:52 fjc
- Incor