home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / jËzyki_programowania / pascal / wwg-crt / crtdemo.p < prev    next >
Text File  |  1997-07-14  |  1KB  |  73 lines

  1. program CrtDemo;
  2.  
  3. {$I "INCLUDE:Utils/Crt.i"}
  4.  
  5. var
  6.    x, y     :  integer;
  7.    tc, tb   :  byte;
  8.    
  9. procedure DrawShellGfx;
  10. var
  11.    i, mx, my   :  integer;
  12.    key         :  char;
  13. begin
  14.    mx := x/2+1;
  15.    my := y/2;
  16.    
  17.    { Die Diagonalen: }
  18.    TextBackground(2);
  19.    TextLine(2, 2, x-1, y-1, ' ');
  20.    TextBackground(4);
  21.    TextLine(x-1, 2, 2, y-1, ' ');
  22.    
  23.    { Die Informationen: }
  24.    TextMode(TS_BOLD, 5, 7);
  25.    GotoXY(x-12, my);    Write("Spalten: ", x:2);
  26.    GotoXY(x-12, my+1);  Write("Zeilen : ", y:2);
  27.    
  28.    { Die Nummerierungsspalte: }
  29.    TextMode(TS_ITALIC, 0, 3);
  30.    GotoXY(1, 1);  Write(1:2);
  31.    for i := 3 to y-2 do begin
  32.       GotoXY(1, i);  Write(i:2);
  33.    end;
  34.    GotoXY(1, y);  Write(y:2);
  35.    
  36.    { Der Untergrund für das Dreieck: }
  37.    TextMode(TS_PLAIN, 1, 0);
  38.    TextRectFill(mx-9, my/8, 19, my/4, ' ');
  39.    
  40.    { Das Dreieck: }
  41.    TextMode(TS_PLAIN, 4, 3);
  42.    TextLine(mx-8, 2, mx+8, 2, '·');
  43.    TextLine(mx-8, 2, mx, my-1, '·');
  44.    TextLine(mx+8, 2, mx, my-1, '·');
  45.    
  46.    { Warten auf die Benutzereingabe: }
  47.    TextMode(TS_BOLD, 2, 3);
  48.    GotoY(my+my*2/3+1);
  49.    CenterText("Press <RETURN>");
  50.    key := ReadKey;
  51. end;
  52.  
  53. begin
  54.    x  := MaxX;
  55.    y  := MaxY;
  56.    
  57.    if (x >= 32) and (y >= 8) then begin
  58.       ClrScr;
  59.       CursorOff;
  60.       
  61.       tc := GetTextColor;
  62.       tb := GetTextBackground;
  63.       
  64.       DrawShellGfx;
  65.       
  66.       TextColor(tc);
  67.       TextBackground(tb);
  68.       
  69.       ClrScr;
  70.       CursorOn;
  71.    end else WriteLn('Bitte das Fenster vergrößern!');
  72. end.  
  73.