IMPLEMENTATION MODULE ScrnTypes; (* * REPERTOIRE * Release 1.6 * By Charles Bradford and Cole Brecheen * (c) Copyright 1985-1992 PMI * Green Bay, Wisconsin * All rights reserved * (414) 468-6040 * * $Header: D:/logfiles/mods/scrntype.mov 1.5 10 Mar 1991 15:32:10 coleb $ * *) IMPORT ErrorNames; IMPORT FrameManager; IMPORT GenLists; IMPORT LowLevel; IMPORT MsColors; IMPORT NdxTypes; IMPORT SYSTEM; IMPORT VStorage; IMPORT VWindows; VAR Initialized : BOOLEAN; PROCEDURE Init(); BEGIN IF Initialized THEN RETURN; ELSE Initialized := TRUE; END; ErrorNames.Init(); FrameManager.Init(); GenLists.Init(); LowLevel.Init(); MsColors.Init(); NdxTypes.Init(); VStorage.Init(); VWindows.Init(); END Init; (* The purpose of ScrnTypes is to allow other parts of Repertoire to refer to data types in the screen system without importing all screen system's code where it isn't necessary. We do include initialization procedures here, however, to prevent programs that do not use the screen system from doing dangerous things with improperly initialized or uninitialized data types.*) PROCEDURE InitDisplayFrame( VAR FrameRec : DisplayFrame; AssociatedWindow: VWindows.AWindowHandle ); (* Initializes a DisplayFrame before first use. *) VAR FrameSize: CARDINAL; BEGIN (* procedure InitDisplayFrame *) FrameSize := SYSTEM.TSIZE( DisplayFrameRec ); VStorage.DosAlloc( FrameRec, FrameSize ); FrameManager.AddWindow( AssociatedWindow ); (*Note that we don't call FrameActivated here because FrameManager only begins to care about a frame once part of it becomes visible.*) WITH FrameRec^ DO ThisFrame[0] := 0C; WindowHandle := AssociatedWindow; PushedFrame := NIL; (*initialize the frame stack to empty*) ClearFirst := TRUE; ClearAfter := FALSE; FrameChanged := FALSE; EntryBox := VWindows.DoubleBox; ExitBox := VWindows.SingleBox; Caption[0] := 0C; (*changed in 1.5a*) SelfSharedWithFile := FALSE; (*changed in 1.5b*) GenLists.NewList( self ); GenLists.NilList( DataList ); GenLists.NilList( PromptList ); GenLists.NilList( HelpList ); GenLists.NilList( EdFieldList ); GenLists.NilList( FieldList ); GenLists.NilList( ImageList ); GenLists.NilList( LinkedFrames ); (*Now we set up the odd structure of the self; see the manual for explanation.*) GenLists.ListInsert( '', GenLists.StrCode, self, 1 ); (*Insert null at position of the HelpFrame.*) GenLists.ListInsert( '', GenLists.StrCode, self, 2 ); (*Insert null at position of the ParentFrame.*) GenLists.ListInsert( '', GenLists.StrCode, self, 3 ); (*Insert null at position of the NormalNextFrame.*) GenLists.ListInsert( '', GenLists.StrCode, self, 4 ); (*Insert null at position of the DisplayFrameRec.*) GenLists.ListInsert( DataList, GenLists.ListCode, self, 5 ); GenLists.ListInsert( PromptList, GenLists.ListCode, self, 6 ); GenLists.ListInsert( HelpList, GenLists.ListCode, self, 7 ); GenLists.ListInsert( EdFieldList, GenLists.ListCode, self, 8 ); GenLists.ListInsert( FieldList, GenLists.ListCode, self, 9 ); GenLists.ListInsert( ImageList, GenLists.ListCode, self, 10 ); GenLists.ListInsert( LinkedFrames, GenLists.ListCode, self, 11 ); HelpFrame[0] := 0C; (* initialize the screen fields area to empty *) startcol := 0; startrow := 0; endcol := VWindows.EndCol(AssociatedWindow) - 1; endrow := VWindows.EndRow(AssociatedWindow) - 1; RowsScrolled := 0; ColsScrolled := 0; CurrentField := 0; VirtualWidth := 0; VirtualHeight := 0; headline := 0; action := 'W'; (*Wait for any key.*) parent[0] := 0C; normlnext[0] := 0C; (* Now, initialize defaults for colors & mono attributes: *) normatrb := MsColors.plain; normfor := MsColors.lightgrey; normbak := MsColors.blue; (* Normal text *) bordatrb := MsColors.plain; bordfor := MsColors.lightcyan; bordbak := MsColors.blue; (* Border colors *) selatrb := MsColors.bold; selfor := MsColors.lightmagenta; selbak := MsColors.blue; (* Selected text *) pbatrb := MsColors.ReverseVideo; pbfor := MsColors.black; pbbak := MsColors.red; (* Pointer Bar Colors *) msgatrb := MsColors.plain; msgfor := MsColors.black; msgbak := MsColors.lightgrey; (* Message Box Colors *) promatrb := MsColors.ReverseVideo; promfor := MsColors.black; prombak := MsColors.cyan; (* Prompt Line Colors *) FromFile := NIL; END; END InitDisplayFrame; PROCEDURE InitField( VAR TheField: InputFieldRecord ); BEGIN LowLevel.Fill( SYSTEM.ADR(TheField), SYSTEM.TSIZE(InputFieldRecord), 0C ); TheField.typ := DispCode; END InitField; BEGIN Initialized := FALSE; Init(); END ScrnTypes.