Procedure DoEmptyLine(y,xl,xh:Longint);
{
Write an empty line at row Y from column Xl to Xh. Memory is also updated.
}
Var
len : Longint;
blank_with_attribute : TCharAttr;
Begin
ttyGotoXY(xl,y);
len:=xh-xl+1;
LineWrite(Space(len));
blank_with_attribute.ch:=' ';
blank_with_attribute.attr:=TextAttr;
FillWord(ConsoleBuf^[(y-1)*ScreenWidth+xl -1],len,word(blank_with_attribute));
End;
Procedure ClrScr; { Clear the current window, and set the cursor on 1,1 } Var CY,i : Longint; oldflush : boolean; blank_with_attribute : TCharAttr;
Begin
{ See if color has changed }
if OldTextAttr<>TextAttr then
begin
i:=TextAttr;
TextAttr:=OldTextAttr;
ttyColor(i);
end;
oldflush:=ttySetFlush(Flushing);
if FullWin then
begin
if not OutputRedir then
ttySendStr(#27'[H'#27'[2J');
CurrX:=1;
CurrY:=1;
blank_with_attribute.ch := ' ';
blank_with_attribute.attr := TextAttr;
FillWord(ConsoleBuf^,ScreenWidth*ScreenHeight,word(blank_with_attribute) );
end
else
begin
For Cy:=WinMinY To WinMaxY Do
DoEmptyLine(Cy,WinMinX,WinMaxX);
GoToXY(1,1);
end;
ttySetFlush(oldflush);
End;
_______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel