Unit Trsek.pas work with text window and keyboard in pascal

Delphi & Pascal (česká wiki)
Přejít na: navigace, hledání
Category: Source in Pascal

Program: Trsek.pas
File exe: Pouzi.exe
need: Pouzi.pas

It took a long time to complete this library. I believe it includes many useful things like the memorising and restoring of the window basis, the window display, the question with 3 alternatives, the buffer clearing and the others. POUZI.PAS program guides you through all the functions. Don't hesitate to use it when you account the problems. Don't invent the stuff that has already been invented. As far as I'm concerned I'll be only pleased that you used it. Just remember you can't present the copied parts of the source codes under your authorship.

For example
- forgetting the bacground of a screen and back
- displaying the window with many different kinds of frames
- a question with 3 possibilities to answer
- deleting a buffer of the keyboard
and other 25 functions.

You can use if you wish. Do not lose your precious time on what has already been done. And for my part I will only be happy for it. Just don't forget you can't present the parts of source files you copied as your work. Pouzi.pas program will guide you through all the functions.
{ POUZI.PAS                 Copyright (c) TrSek alias Zdeno Sekerak }
{ Program demonstruje vsetky funkcie unitu TRSEK.PAS                }
{ Nielenze predvedie, ale aj kompletne opise vstupne parametre      }
{                                                                   }
{ Datum:24.10.1995                             http://www.trsek.com }
 
program pouzi_unit;
uses crt,dos,trsek;
 
var ch:char;
     i:integer;
 
begin
 farba(BLACK,WHITE);
 clrscr;
 for i:=1 to 185 do write('-123456789');
 
 farba(GREEN,YELLOW);
 open_win(13,3,73,15,'Okno',1);
 i:=get_window(13,3,73,15);
 
 farba(BLUE,YELLOW);
 open_win(1,3,33,22,'Okno',2);
 i:=get_window(1,3,33,22);
 
 farba(LIGHTGRAY,DARKGRAY);
 open_win(60,3,73,15,'Okno',3);
 i:=get_window(60,3,73,15);
 
 farba(RED,YELLOW);
 open_win(1,17,78,23,'Okno',4);
 i:=get_window(1,17,78,23);
 i:=get_window(1,1,80,25);
 
 window(1,1,80,25);
 farba(BLACK,YELLOW);
 clrscr;
 
 repeat
  window(1,1,80,25);
  farba(BLACK,YELLOW);
  writexy(1,1,'Stlac 1,2,3,4,5  SPACE-Zmaz  ESC-Koniec');
 
  ch:=readkey;
 
  if ch=#32 then clrscr;
 
  if ch=#27 then begin
      clrscr;
      WriteXY(22,1,'Koniec');
      i:=otazka(18,2,'Ano','nIe','',BLUE,2);
      if i<>1 then ch:=#13
              else ch:=#27;
     end;
 
  if ch in ['1'..'5'] then
      i:=put_window(ord(ch)-48,0,0,0,0);
 
 until (ch=#27);
 rem_all_win;
 
 help(' ');
end.