mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 13:06:18 +02:00
* support large screens
This commit is contained in:
parent
fa05db818d
commit
382ddb52ed
@ -123,6 +123,10 @@ Const
|
|||||||
Var
|
Var
|
||||||
CurrX,CurrY : Byte;
|
CurrX,CurrY : Byte;
|
||||||
OutputRedir, InputRedir : boolean; { is the output/input being redirected (not a TTY) }
|
OutputRedir, InputRedir : boolean; { is the output/input being redirected (not a TTY) }
|
||||||
|
WinMinX,
|
||||||
|
WinMinY,
|
||||||
|
WinMaxX,
|
||||||
|
WinMaxY : Longint;
|
||||||
|
|
||||||
|
|
||||||
{*****************************************************************************
|
{*****************************************************************************
|
||||||
@ -501,46 +505,6 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function WinMinX: Longint;
|
|
||||||
{
|
|
||||||
Current Minimum X coordinate
|
|
||||||
}
|
|
||||||
Begin
|
|
||||||
WinMinX:=(WindMin and $ff)+1;
|
|
||||||
End;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function WinMinY: Longint;
|
|
||||||
{
|
|
||||||
Current Minimum Y Coordinate
|
|
||||||
}
|
|
||||||
Begin
|
|
||||||
WinMinY:=(WindMin shr 8)+1;
|
|
||||||
End;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function WinMaxX: Longint;
|
|
||||||
{
|
|
||||||
Current Maximum X coordinate
|
|
||||||
}
|
|
||||||
Begin
|
|
||||||
WinMaxX:=(WindMax and $ff)+1;
|
|
||||||
End;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function WinMaxY: Longint;
|
|
||||||
{
|
|
||||||
Current Maximum Y coordinate;
|
|
||||||
}
|
|
||||||
Begin
|
|
||||||
WinMaxY:=(WindMax shr 8) + 1;
|
|
||||||
End;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function FullWin:boolean;
|
Function FullWin:boolean;
|
||||||
{
|
{
|
||||||
Full Screen 80x25? Window(1,1,80,25) is used, allows faster routines
|
Full Screen 80x25? Window(1,1,80,25) is used, allows faster routines
|
||||||
@ -698,6 +662,10 @@ Begin
|
|||||||
if (X1>X2) or (X2>ScreenWidth) or
|
if (X1>X2) or (X2>ScreenWidth) or
|
||||||
(Y1>Y2) or (Y2>ScreenHeight) then
|
(Y1>Y2) or (Y2>ScreenHeight) then
|
||||||
exit;
|
exit;
|
||||||
|
WinMinX:=X1;
|
||||||
|
WinMaxX:=X2;
|
||||||
|
WinMinY:=Y1;
|
||||||
|
WinMaxY:=Y2;
|
||||||
WindMin:=((Y1-1) Shl 8)+(X1-1);
|
WindMin:=((Y1-1) Shl 8)+(X1-1);
|
||||||
WindMax:=((Y2-1) Shl 8)+(X2-1);
|
WindMax:=((Y2-1) Shl 8)+(X2-1);
|
||||||
GoToXY(1,1);
|
GoToXY(1,1);
|
||||||
@ -762,17 +730,21 @@ Begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{ Tweak windmax so no scrolling happends }
|
{ Tweak winmaxx and winmaxy so no scrolling happends }
|
||||||
len:=WinMaxX-CurrX+1;
|
len:=WinMaxX-CurrX+1;
|
||||||
IsLastLine:=false;
|
IsLastLine:=false;
|
||||||
if CurrY=WinMaxY then
|
if CurrY=WinMaxY then
|
||||||
begin
|
begin
|
||||||
inc(WindMax,$0203);
|
inc(WinMaxX,3);
|
||||||
|
inc(WinMaxY,2);
|
||||||
IsLastLine:=true;
|
IsLastLine:=true;
|
||||||
end;
|
end;
|
||||||
ttySendStr(Space(len));
|
ttySendStr(Space(len));
|
||||||
if IsLastLine then
|
if IsLastLine then
|
||||||
dec(WindMax,$0203);
|
begin
|
||||||
|
dec(WinMaxX,3);
|
||||||
|
dec(WinMaxY,2);
|
||||||
|
end;
|
||||||
ttyGotoXY(0,0);
|
ttyGotoXY(0,0);
|
||||||
end;
|
end;
|
||||||
End;
|
End;
|
||||||
@ -1660,6 +1632,8 @@ Initialization
|
|||||||
(TTYName(TextRec(Input).Handle) <> TTYName(TextRec(Output).Handle)));
|
(TTYName(TextRec(Input).Handle) <> TTYName(TextRec(Output).Handle)));
|
||||||
{ Get Size of terminal and set WindMax to the window }
|
{ Get Size of terminal and set WindMax to the window }
|
||||||
GetConsoleBuf;
|
GetConsoleBuf;
|
||||||
|
WinMaxX:=ScreenWidth;
|
||||||
|
WinMaxY:=ScreenHeight;
|
||||||
WindMax:=((ScreenHeight-1) Shl 8)+(ScreenWidth-1);
|
WindMax:=((ScreenHeight-1) Shl 8)+(ScreenWidth-1);
|
||||||
{Get Current X&Y or Reset to Home}
|
{Get Current X&Y or Reset to Home}
|
||||||
if OutputRedir then
|
if OutputRedir then
|
||||||
@ -1693,7 +1667,10 @@ Finalization
|
|||||||
End.
|
End.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.5 2001-03-21 16:07:03 jonas
|
Revision 1.6 2001-06-27 20:21:46 peter
|
||||||
|
* support large screens
|
||||||
|
|
||||||
|
Revision 1.5 2001/03/21 16:07:03 jonas
|
||||||
* fixed problems when using together with graph (web bugs 1225 and 1441)
|
* fixed problems when using together with graph (web bugs 1225 and 1441)
|
||||||
|
|
||||||
Revision 1.4 2001/01/21 20:21:40 marco
|
Revision 1.4 2001/01/21 20:21:40 marco
|
||||||
|
@ -64,6 +64,11 @@ var
|
|||||||
TextAttr: Byte; { Current text attribute }
|
TextAttr: Byte; { Current text attribute }
|
||||||
WindMin: Word; { Window upper left coordinates }
|
WindMin: Word; { Window upper left coordinates }
|
||||||
WindMax: Word; { Window lower right coordinates }
|
WindMax: Word; { Window lower right coordinates }
|
||||||
|
{ FPC Specific for large screen support }
|
||||||
|
WinMinX,
|
||||||
|
WinMinY,
|
||||||
|
WinMaxX,
|
||||||
|
WinMaxY : Longint;
|
||||||
|
|
||||||
{ Interface procedures }
|
{ Interface procedures }
|
||||||
procedure AssignCrt(var F: Text);
|
procedure AssignCrt(var F: Text);
|
||||||
@ -114,7 +119,6 @@ var
|
|||||||
SaveCursorSize: Longint;
|
SaveCursorSize: Longint;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
definition of textrec is in textrec.inc
|
definition of textrec is in textrec.inc
|
||||||
}
|
}
|
||||||
@ -209,46 +213,6 @@ end;
|
|||||||
****************************************************************************}
|
****************************************************************************}
|
||||||
|
|
||||||
|
|
||||||
Function WinMinX: Byte;
|
|
||||||
{
|
|
||||||
Current Minimum X coordinate
|
|
||||||
}
|
|
||||||
Begin
|
|
||||||
WinMinX:=(WindMin and $ff)+1;
|
|
||||||
End;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function WinMinY: Byte;
|
|
||||||
{
|
|
||||||
Current Minimum Y Coordinate
|
|
||||||
}
|
|
||||||
Begin
|
|
||||||
WinMinY:=(WindMin shr 8)+1;
|
|
||||||
End;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function WinMaxX: Byte;
|
|
||||||
{
|
|
||||||
Current Maximum X coordinate
|
|
||||||
}
|
|
||||||
Begin
|
|
||||||
WinMaxX:=(WindMax and $ff)+1;
|
|
||||||
End;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function WinMaxY: Byte;
|
|
||||||
{
|
|
||||||
Current Maximum Y coordinate;
|
|
||||||
}
|
|
||||||
Begin
|
|
||||||
WinMaxY:=(WindMax shr 8) + 1;
|
|
||||||
End;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function FullWin:boolean;
|
Function FullWin:boolean;
|
||||||
{
|
{
|
||||||
Full Screen 80x25? Window(1,1,80,25) is used, allows faster routines
|
Full Screen 80x25? Window(1,1,80,25) is used, allows faster routines
|
||||||
@ -343,6 +307,10 @@ Begin
|
|||||||
if (X1>X2) or (X2>ScreenWidth) or
|
if (X1>X2) or (X2>ScreenWidth) or
|
||||||
(Y1>Y2) or (Y2>ScreenHeight) then
|
(Y1>Y2) or (Y2>ScreenHeight) then
|
||||||
exit;
|
exit;
|
||||||
|
WinMinX:=X1;
|
||||||
|
WinMaxX:=X2;
|
||||||
|
WinMinY:=Y1;
|
||||||
|
WinMaxY:=Y2;
|
||||||
WindMin:=((Y1-1) Shl 8)+(X1-1);
|
WindMin:=((Y1-1) Shl 8)+(X1-1);
|
||||||
WindMax:=((Y2-1) Shl 8)+(X2-1);
|
WindMax:=((Y2-1) Shl 8)+(X2-1);
|
||||||
GoToXY(1,1);
|
GoToXY(1,1);
|
||||||
@ -990,6 +958,10 @@ begin
|
|||||||
IsWindowsNT := (GetPlatformID = VER_PLATFORM_WIN32_NT);
|
IsWindowsNT := (GetPlatformID = VER_PLATFORM_WIN32_NT);
|
||||||
TurnMouseOff;
|
TurnMouseOff;
|
||||||
|
|
||||||
|
WinMinX:=1;
|
||||||
|
WinMinY:=1;
|
||||||
|
WinMaxX:=ScreenWidth;
|
||||||
|
WinMaxY:=ScreenHeight;
|
||||||
WindMax := (ScreenWidth - 1) OR ((ScreenHeight - 1) SHL 8);
|
WindMax := (ScreenWidth - 1) OR ((ScreenHeight - 1) SHL 8);
|
||||||
DoingNumChars := false;
|
DoingNumChars := false;
|
||||||
DoingNumCode := 0;
|
DoingNumCode := 0;
|
||||||
@ -1006,7 +978,10 @@ end. { unit Crt }
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.8 2001-04-14 14:05:42 peter
|
Revision 1.9 2001-06-27 20:21:47 peter
|
||||||
|
* support large screens
|
||||||
|
|
||||||
|
Revision 1.8 2001/04/14 14:05:42 peter
|
||||||
* fixed for stricter checking
|
* fixed for stricter checking
|
||||||
|
|
||||||
Revision 1.7 2001/04/10 21:28:36 peter
|
Revision 1.7 2001/04/10 21:28:36 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user