home *** CD-ROM | disk | FTP | other *** search
- {+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++}
- { }
- { T E C H N O J O C K S T U R B O T O O L K I T }
- { }
- { Module : Window.TTT }
- { }
- { Version : 3.0 , October 1, 1986 }
- { }
- { Purpose : Screen save & window utilities }
- { }
- { Requirements : Decl.TTT }
- { Fastwrit.TTT }
- { }
- { }
- { Proc Savescreen(Page:byte); }
- { RestoreScreen(Page:byte); }
- { DisposeScreen(Page:byte); }
- { MakeWin(X1,Y1,X2,Y2,fore,back,boxtype:integer); }
- { RmWin; }
- { }
- { Bob Ainsbury }
- { Technojock }
- { Houston }
- { (713) 293-2760 }
- {+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++}
-
- {
- ****************************
- * Screen Saving Procedures *
- ****************************
- }
-
- Procedure SaveScreen(Page:byte);
- var dummy1,dummy2 : integer;
- begin
- If ((WindowCounter = 0) and (Page > Max_Screens))
- or ((WindowCounter > 0) and (Page > Max_WindowsandScreens)) then
- begin
- Writeln(^G,'Too many screens saved, check Max_pages/Max_windows Const in DECL.TTT');
- Halt;
- end;
- New(Screen[Page]);
- If Snow then VideoOff;
- If Crtmode = 7 then
- Move(Monobuffer,Screen[Page]^.ScreenSnap, 4096)
- else
- Move(Colorbuffer,Screen[Page]^.Screensnap, 4096);
- If snow then VideoOn;
- FindCursor(Screen[Page]^.CursorX,Screen[Page]^.CursorY,Dummy1,Dummy2);
- end;
-
- Procedure RestoreScreen(Page:byte);
- begin
- If Snow then VideoOff;
- If Crtmode = 7 then
- Move(Screen[Page]^, Monobuffer, 4096)
- else
- Move(Screen[Page]^, Colorbuffer, 4096);
- If Snow then VideoOn;
- PosCursor(Screen[Page]^.CursorX,Screen[Page]^.CursorY);
- end;
-
- Procedure DisposeScreen(Page:byte);
- begin
- Dispose(Screen[Page]);
- end;
- {
- ****************************
- * Windowing Procedures *
- ****************************
- }
-
- procedure mkwin(x1,y1,x2,y2,F,B,boxtype:integer);
- begin
- WindowCounter := WindowCounter + 1;
- If WindowCounter > Max_WindowsandScreens - Max_Screens then
- begin
- writeln(^G,' Too many Windows change Max_Windows Const in DECL.TTT');
- halt;
- end;
- SaveScreen(Max_Screens + WindowCounter);
- Box(x1,y1,x2,y2,F,B,boxtype);
- ClearText(x1+1,y1+1,x2-1,y2-1,F,B);
- end;
-
- procedure rmwin;
- begin
- If WindowCounter > 0 then
- begin
- RestoreScreen(Max_Screens + WindowCounter);
- DisposeScreen(Max_Screens + WindowCounter);
- WindowCounter := WindowCounter - 1;
- end;
- end;