| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371 |
- Listing:
- 1 IMPLEMENTATION MODULE MsgBox1;
- 2 (*
- 3 * REPERTOIRE
- 4 * Release 1.6
- 5 * By Charles Bradford and Cole Brecheen
- 6 * (c) Copyright 1985-1992 PMI
- 7 * Green Bay, Wisconsin
- 8 * All rights reserved
- 9 * (414) 468-6040
- 10 *
- 11 * $Header: D:/logfiles/mods/msgbox1.mov 1.5 10 Mar 1991 15:29:44 coleb $
- 12 *
- 13 *)
- 14
- 15
- 16
- 17 IMPORT GenLists;
- 18 IMPORT KbdInput;
- 19 IMPORT ListUtils;
- 20 IMPORT LowLevel;
- 21 IMPORT Numbers;
- 22 IMPORT NumTypes;
- 23 IMPORT SmartScreen;
- 24 IMPORT SYSTEM;
- 25 IMPORT VWindows;
- 26 IMPORT WindowPrims;
- 27
- 28 VAR
- 29 Initialized : BOOLEAN;
- 30
- 31 PROCEDURE Init();
- 32 BEGIN
- 33 IF Initialized THEN
- 34 RETURN;
- 35 ELSE
- 36 Initialized := TRUE;
- 37 END;
- 38 GenLists.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 39 KbdInput.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 40 ListUtils.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 41 LowLevel.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 42 Numbers.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 43 NumTypes.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 44 SmartScreen.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 45 VWindows.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 46 WindowPrims.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 47 END Init;
- ***** ^ not supported yet
- 48
- 49 CONST
- 50 lftcol = 4;
- 51 toprow = 3;
- 52 rtcol = 44;
- 53 btmrow = 14;
- 54 midcol = 24;
- 55 midrow = 9;
- 56
- 57 (* These define the starting points for the 4 msg box areas *)
- 58
- 59
- 60 PROCEDURE FindCoords( locatn: VWindows.Compass; MaxWidth,
- ***** ^ not supported yet
- 61 MaxHeight: CARDINAL; VAR col1, row1, col2, row2: CARDINAL );
- 62 BEGIN
- 63 CASE locatn OF
- ***** ^ not supported yet
- 64 VWindows.West, VWindows.NW, VWindows.SW :
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 65 col1 := lftcol;
- 66 | VWindows.North, VWindows.South :
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 67 col1 := midcol;
- 68 | VWindows.East, VWindows.NE, VWindows.SE :
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 69 col1 := rtcol;
- 70 END;
- 71 CASE locatn OF
- ***** ^ not supported yet
- 72 VWindows.North, VWindows.NW, VWindows.NE :
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 73 row1 := toprow;
- 74 | VWindows.East, VWindows.West :
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 75 row1 := midrow;
- 76 | VWindows.South, VWindows.SE, VWindows.SW :
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 77 row1 := btmrow;
- 78 END;
- 79 col2 := col1 + MaxWidth + 3;
- 80 row2 := row1 + MaxHeight + 3;
- 81 END FindCoords;
- ***** ^ not supported yet
- 82
- 83
- 84 PROCEDURE NullScan( StrAddr: SYSTEM.ADDRESS ): CARDINAL;
- ***** ^ not supported yet
- 85 BEGIN
- 86 RETURN LowLevel.ScanEQ( 32767, 0C, StrAddr );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 87 END NullScan;
- ***** ^ not supported yet
- 88
- 89
- 90 PROCEDURE WinMsgBox( TheWindow: VWindows.AWindowHandle;
- ***** ^ not supported yet
- 91 TextPtr: SYSTEM.ADDRESS; CaptionPtr: SYSTEM.ADDRESS;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 92 WinType: CARDINAL ): CARDINAL;
- 93 VAR
- 94 TxtLngth, CaptionLngth: CARDINAL;
- 95 TmpList: GenLists.GenList;
- ***** ^ not supported yet
- 96 KeyPressed: CARDINAL;
- 97 BEGIN
- 98 TxtLngth := NullScan( TextPtr );
- ***** ^ not supported yet
- ***** ^ not supported yet
- 99 CaptionLngth := NullScan( CaptionPtr );
- ***** ^ not supported yet
- ***** ^ not supported yet
- 100 GenLists.NewList( TmpList );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 101 GenLists.ListInsertAdr( TextPtr, TxtLngth,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 102 GenLists.StrCode, TmpList, 1 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 103 ListMsgBox( VWindows.NE, TmpList, KbdInput.AnyKeyNum,
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 104 KeyPressed );
- ***** ^ not supported yet
- 105 GenLists.DisposeList( TmpList );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 106 RETURN KeyPressed;
- 107 END WinMsgBox;
- ***** ^ not supported yet
- 108
- 109
- 110 PROCEDURE ListMsgBox(locatn : VWindows.Compass; TheList :
- ***** ^ not supported yet
- 111 GenLists.GenList; LegalKeys: KbdInput.KeyNumSet; VAR KeyPressed :
- ***** ^ not supported yet
- ***** ^ not supported yet
- 112 CARDINAL);
- 113 VAR
- 114 leng, breakspot, lastbreak, LinesAdded, BytesAdded : INTEGER;
- 115 StartLine, CursorLine, CursorCol, LstLngth, maxleng, newleng, i,
- 116 col1, row1, col2, row2, rowspot, colspot: CARDINAL;
- 117 BytePos : LONGINT;
- 118 screen : WindowPrims.ScreenType;
- ***** ^ not supported yet
- 119 TmpAdr: SYSTEM.ADDRESS;
- ***** ^ not supported yet
- 120 TypeCode, TmpSize: CARDINAL;
- 121
- 122 BEGIN
- 123 WindowPrims.PushColors();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 124 WindowPrims.PushCursorCoords();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 125 WindowPrims.PushCursorHeight();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 126 SmartScreen.SetCursorHeight(0);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 127 SmartScreen.SetAttribOrColor( WindowPrims.MsgForeColor,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 128 WindowPrims.MsgBackColor, WindowPrims.MsgMonoAtrib );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 129 maxleng := Numbers.Min( ListUtils.LongestLine(
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 130 TheList ), SmartScreen.MaxCol - rtcol - 3 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 131
- 132 StartLine := 1;
- 133 CursorLine := 1;
- 134 CursorCol := 1;
- 135 BytePos := NumTypes.L0;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 136 ListUtils.ReformPara( TheList, 0, maxleng - 2, StartLine,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 137 CursorLine, CursorCol, LinesAdded, BytesAdded, BytePos );
- ***** ^ not supported yet
- 138
- 139 LstLngth := Numbers.Min( GenLists.ListLength(
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 140 TheList ), SmartScreen.MaxRow - btmrow - 3 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 141 FindCoords( locatn, maxleng, LstLngth, col1, row1, col2, row2 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 142 WindowPrims.ScreenSave(screen, col1, row1, col2, row2 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 143 SmartScreen.ClearPart(col1, row1, col2, row2);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 144 (* save & clear an area of the required size *)
- 145 WindowPrims.DrawThisBox( WindowPrims.SingleBox, col1, row1,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 146 col2, row2 );
- ***** ^ not supported yet
- 147 (* draw a box of the required size *)
- 148 colspot := col1+2;
- 149 rowspot := row1+1;
- 150 FOR i := 1 TO LstLngth DO
- 151 (* write text in window *)
- 152 GenLists.GetElmtAdr( TheList, i, TmpAdr, TmpSize, TypeCode );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 153 TmpSize := ListUtils.ElmtSize( TheList, i );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 154 IF TypeCode = GenLists.StrCode THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 155 SmartScreen.AdrWriteAt( colspot, rowspot+i, TmpAdr, TmpSize );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 156 END;
- 157 END;
- 158 KeyPressed := KbdInput.KeyHit( LegalKeys );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 159 WindowPrims.ScreenRestore(screen, col1, row1);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 160 WindowPrims.PopCursorCoords();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 161 WindowPrims.PopCursorHeight();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 162 WindowPrims.PopColors();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 163 (* restore screen, cursor, and mode *)
- 164 END ListMsgBox;
- ***** ^ not supported yet
- 165
- 166
- 167 BEGIN
- 168 Initialized := FALSE;
- 169 Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- 170 END MsgBox1.
- ***** ^ not supported yet
- 195 errors
|