home *** CD-ROM | disk | FTP | other *** search
- var winds:array [0..2] of windowrec;
- split,inuse:byte;
-
- procedure getcoor;
- begin
- with winds[inuse] do begin
- window (x1,y1,x2,y2);
- cx:=wherex;
- cy:=wherey;
- if cy<1 then cy:=1;
- if cy>(y2-y1)+1 then cy:=(y2-y1)+1
- end
- end;
-
- procedure usewind (n:byte);
- begin
- getcoor;
- inuse:=n;
- with winds[n] do begin
- window (x1,y1,x2,y2);
- gotoxy (cx,cy);
- textcolor (color);
- textbackground (0);
- lasty:=y2-y1+1
- end
- end;
-
- procedure setwind (n:byte; nx1,ny1,nx2,ny2:byte);
- var i:integer;
- begin
- i:=inuse;
- usewind(n);
- with winds[n] do begin
- x1:=nx1;
- y1:=ny1;
- x2:=nx2;
- y2:=ny2
- end;
- usewind(n);
- if n<>i then usewind(i)
- end;
-
- procedure initwind (n,nx1,ny1,nx2,ny2,ncolor:byte);
- begin
- with winds[n] do begin
- x1:=nx1;
- y1:=ny1;
- x2:=nx2;
- y2:=ny2;
- cx:=1;
- cy:=1;
- color:=ncolor
- end
- end;
-
- procedure top;
- begin
- usewind (1)
- end;
-
- procedure bottom;
- begin
- usewind (2)
- end;
-
- procedure wholescreen;
- begin
- usewind (0)
- end;
-
- procedure drawsplit;
- var cnt:integer;
- begin
- usewind (0);
- textcolor (splitcolor);
- gotoxy (1,split);
- for cnt:=0 to 79 do writeturbo (chr(196));
- bottom
- end;
-
- procedure initwinds;
- begin
- splitmode:=false;
- initwind (0,1,1,80,25,splitcolor);
- initwind (2,1,1,80,23,normbotcolor);
- split:=0;
- inuse:=0;
- bottom
- end;
-
- procedure unsplit;
- begin
- setwind (2,1,1,80,23);
- setwind (1,1,1,80,split);
- top;
- clrscr;
- splitmode:=false;
- bottom
- end;
-
- procedure splitscreen (v:byte);
- begin
- if splitmode then unsplit;
- splitmode:=true;
- split:=v;
- drawsplit;
- initwind (1,1,1,80,split-1,normtopcolor);
- setwind (2,1,split+1,80,23);
- top;
- clrscr;
- bottom
- end;