home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / sonderh1 / grafsys.erw < prev    next >
Text File  |  1987-05-18  |  3KB  |  84 lines

  1. (*-------------------------------------------------------------------------*)
  2. (*                              GRAFSYS.ERW                                *)
  3. (*         Erweiterung zu GRAFSYS.PAS um Fensterinhalte speichern und      *)
  4. (*                         rekonstruieren zu koennen.                      *)
  5.  
  6.    (*------------------- Systemabhaengiger Teil --------------------------*)
  7.    (* Implementation fuer Turbo Pascal auf MS-DOS Rechner mit CGA-Karte.  *)
  8.    (*      !!!! GRAPH.P muss im Hauptprogramm included werden !!!!        *)
  9.  
  10.    PROCEDURE StoreArea(x1 : x_Koord_Sys;
  11.                        y1 : y_Koord_Sys;
  12.                        x2 : x_Koord_Sys;
  13.                        y2 : y_Koord_Sys;
  14.                        VAR Inhalt : WinBackGround );
  15.  
  16.    BEGIN
  17.      (* Ggf. pruefen, ob noch genug Platz auf dem Heap vorhanden ist ! *)
  18.      New(Inhalt);   (* Speicherplatz anfordern *)
  19.      GetPic(Inhalt^,x1,y1,x2,y2)   (* <--- Hier anpassen *)
  20.    END;
  21.  
  22.  
  23.  
  24.    PROCEDURE RestoreArea(VAR Inhalt : WinBackGround;
  25.                          x : x_Koord_Sys;
  26.                          y : y_Koord_Sys             );
  27.  
  28.    BEGIN
  29.      PutPic(Inhalt^,x,y);  (* <--- Hier anpassen *)
  30.      Dispose(Inhalt)
  31.    END;
  32.  
  33.    (*                                                                     *)
  34.    (*-------------- Ende des systemabhaengigen Teils ---------------------*)
  35.  
  36.  
  37.  
  38. PROCEDURE StoreViewport( x1 : x_Koord;            (* Viewport- *)
  39.                          y1 : y_Koord;            (* Ausschnitt *)
  40.                          x2 : x_Koord;
  41.                          y2 : y_Koord;
  42.                          VAR Inhalt : WinBackGround );
  43.  
  44. BEGIN
  45.   IF Origin_is_Top THEN
  46.     StoreArea(x1 + ScreenXmin_Sys,
  47.               ScreenYmax - y1 + ScreenYmin_Sys,
  48.               x2 + ScreenXmin_Sys,
  49.               ScreenYmax - y2 + ScreenYmin_Sys,
  50.               Inhalt                                                 )
  51.   ELSE
  52.     StoreArea(x1 + ScreenXmin_Sys, y1 + ScreenYmin_Sys,
  53.               x2 + ScreenXmin_Sys, y2 + ScreenYmin_Sys,
  54.               Inhalt                                     )
  55.  END;
  56.  
  57.  
  58. PROCEDURE RestoreViewport( VAR Inhalt : WinBackGround;
  59.                            x : x_Koord; y : y_Koord    );
  60.                            (* Untere linke Ecke *)
  61.  
  62. BEGIN
  63.   IF Origin_is_Top THEN
  64.     RestoreArea(Inhalt,
  65.                 x + ScreenXmin_Sys, ScreenYmax - y + ScreenYmin_Sys )
  66.   ELSE
  67.     RestoreArea(Inhalt,
  68.                 x + ScreenXmin_Sys, y + ScreenYmin_Sys)
  69. END;
  70.  
  71. (*------------ Prozedur zum Vertauschen zweier Werte ---------------------*)
  72.  
  73. PROCEDURE RealSwap( VAR a,b : REAL ); (* Zum vertauschen zweier Realwerte *)
  74.  
  75. VAR hilf : REAL;
  76.  
  77. BEGIN
  78.   hilf := a;  a := b;  b := hilf
  79. END;
  80.  
  81.  
  82. (*-------------------------------------------------------------------------*)
  83. (*                          Ende GRAFSYS.ERW                               *)
  84.