home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turbo Toolbox
/
Turbo_Toolbox.iso
/
sonderh1
/
grafsys.erw
< prev
next >
Wrap
Text File
|
1987-05-18
|
3KB
|
84 lines
(*-------------------------------------------------------------------------*)
(* GRAFSYS.ERW *)
(* Erweiterung zu GRAFSYS.PAS um Fensterinhalte speichern und *)
(* rekonstruieren zu koennen. *)
(*------------------- Systemabhaengiger Teil --------------------------*)
(* Implementation fuer Turbo Pascal auf MS-DOS Rechner mit CGA-Karte. *)
(* !!!! GRAPH.P muss im Hauptprogramm included werden !!!! *)
PROCEDURE StoreArea(x1 : x_Koord_Sys;
y1 : y_Koord_Sys;
x2 : x_Koord_Sys;
y2 : y_Koord_Sys;
VAR Inhalt : WinBackGround );
BEGIN
(* Ggf. pruefen, ob noch genug Platz auf dem Heap vorhanden ist ! *)
New(Inhalt); (* Speicherplatz anfordern *)
GetPic(Inhalt^,x1,y1,x2,y2) (* <--- Hier anpassen *)
END;
PROCEDURE RestoreArea(VAR Inhalt : WinBackGround;
x : x_Koord_Sys;
y : y_Koord_Sys );
BEGIN
PutPic(Inhalt^,x,y); (* <--- Hier anpassen *)
Dispose(Inhalt)
END;
(* *)
(*-------------- Ende des systemabhaengigen Teils ---------------------*)
PROCEDURE StoreViewport( x1 : x_Koord; (* Viewport- *)
y1 : y_Koord; (* Ausschnitt *)
x2 : x_Koord;
y2 : y_Koord;
VAR Inhalt : WinBackGround );
BEGIN
IF Origin_is_Top THEN
StoreArea(x1 + ScreenXmin_Sys,
ScreenYmax - y1 + ScreenYmin_Sys,
x2 + ScreenXmin_Sys,
ScreenYmax - y2 + ScreenYmin_Sys,
Inhalt )
ELSE
StoreArea(x1 + ScreenXmin_Sys, y1 + ScreenYmin_Sys,
x2 + ScreenXmin_Sys, y2 + ScreenYmin_Sys,
Inhalt )
END;
PROCEDURE RestoreViewport( VAR Inhalt : WinBackGround;
x : x_Koord; y : y_Koord );
(* Untere linke Ecke *)
BEGIN
IF Origin_is_Top THEN
RestoreArea(Inhalt,
x + ScreenXmin_Sys, ScreenYmax - y + ScreenYmin_Sys )
ELSE
RestoreArea(Inhalt,
x + ScreenXmin_Sys, y + ScreenYmin_Sys)
END;
(*------------ Prozedur zum Vertauschen zweier Werte ---------------------*)
PROCEDURE RealSwap( VAR a,b : REAL ); (* Zum vertauschen zweier Realwerte *)
VAR hilf : REAL;
BEGIN
hilf := a; a := b; b := hilf
END;
(*-------------------------------------------------------------------------*)
(* Ende GRAFSYS.ERW *)