2
0
Эх сурвалжийг харах

* changed the parameters of gotoxy() and the return values of wherex/wherey
from byte into tcrtcoord=1..255, since all crt unit coordinates are
1-based (not for Window() procedure, see comments in crth.inc;
mantis #13788)

git-svn-id: trunk@13191 -

Jonas Maebe 16 жил өмнө
parent
commit
78c29a33ba

+ 3 - 3
rtl/amiga/crt.pp

@@ -479,7 +479,7 @@ begin
    ConData := pos + 1;
 end;
 
-function WhereX : Byte;
+function WhereX : tcrtcoord;
 begin
    WhereX := Byte(ConData(CD_CURRX))-lo(windmin);
 end;
@@ -494,7 +494,7 @@ begin
  RealY := Byte(ConData(CD_CURRY));
 end;
 
-function WhereY : Byte;
+function WhereY : tcrtcoord;
 begin
    WhereY := Byte(ConData(CD_CURRY))-hi(windmin);
 end;
@@ -516,7 +516,7 @@ end;
  end;
 
 
- procedure gotoxy(x,y : byte);
+ procedure gotoxy(x,y : tcrtcoord);
  begin
         if (x<1) then
           x:=1;

+ 3 - 3
rtl/go32v2/crt.pp

@@ -219,7 +219,7 @@ Begin
 End;
 
 
-Procedure GotoXy(X: Byte; Y: Byte);
+Procedure GotoXy(X: tcrtcoord; Y: tcrtcoord);
 {
   Go to coordinates X,Y in the current window.
 }
@@ -284,7 +284,7 @@ End;
 
 
 
-Function WhereX: Byte;
+Function WhereX: tcrtcoord;
 {
   Return current X-position of cursor.
 }
@@ -297,7 +297,7 @@ End;
 
 
 
-Function WhereY: Byte;
+Function WhereY: tcrtcoord;
 {
   Return current Y-position of cursor.
 }

+ 11 - 3
rtl/inc/crth.inc

@@ -66,15 +66,23 @@ var
   WindMinY : DWord;
   WindMaxY : DWord      ;
 
+type
+  { all crt unit coordinates are 1-based }
+  tcrtcoord = 1..255;
+
 { Interface procedures }
 procedure AssignCrt(var F: Text);
 function KeyPressed: Boolean;
 function ReadKey: Char;
 procedure TextMode (Mode: word);
+{ Window parameters not changed to tcrtcoord, because the window() procedure
+  does nothing if (x1 > x2) or (y1 > y2), and some people may set x2 or y2
+  to 0 if they don't want it to do anything (JM)
+}
 procedure Window(X1,Y1,X2,Y2: Byte);
-procedure GotoXY(X,Y: Byte);
-function WhereX: Byte;
-function WhereY: Byte;
+procedure GotoXY(X,Y: tcrtcoord);
+function WhereX: tcrtcoord;
+function WhereY: tcrtcoord;
 procedure ClrScr;
 procedure ClrEol;
 procedure InsLine;

+ 3 - 3
rtl/netware/crt.pp

@@ -198,7 +198,7 @@ Begin
 End;
 
 
-Procedure GotoXy(X: Byte; Y: Byte);
+Procedure GotoXy(X: tcrtcoord; Y: tcrtcoord);
 {
   Go to coordinates X,Y in the current window.
 }
@@ -279,7 +279,7 @@ End;
 
 
 
-Function WhereX: Byte;
+Function WhereX: tcrtcoord;
 {
   Return current X-position of cursor.
 }
@@ -292,7 +292,7 @@ End;
 
 
 
-Function WhereY: Byte;
+Function WhereY: Btcrtcoordyte;
 {
   Return current Y-position of cursor.
 }

+ 3 - 3
rtl/netwlibc/crt.pp

@@ -185,7 +185,7 @@ Begin
 End;
 
 
-Procedure GotoXy(X: Byte; Y: Byte);
+Procedure GotoXy(X: tcrtcoord; Y: tcrtcoord);
 {
   Go to coordinates X,Y in the current window.
 }
@@ -253,7 +253,7 @@ End;
 
 
 
-Function WhereX: Byte;
+Function WhereX: tcrtcoord;
 {
   Return current X-position of cursor.
 }
@@ -263,7 +263,7 @@ End;
 
 
 
-Function WhereY: Byte;
+Function WhereY: tcrtcoord;
 {
   Return current Y-position of cursor.
 }

+ 3 - 3
rtl/unix/crt.pp

@@ -580,7 +580,7 @@ End;
 
 
 
-Procedure GotoXy(X: Byte; Y: Byte);
+Procedure GotoXy(X: tcrtcoord; Y: tcrtcoord);
 {
   Go to coordinates X,Y in the current window.
 }
@@ -697,7 +697,7 @@ End;
 
 
 
-Function WhereX: Byte;
+Function WhereX: tcrtcoord;
 {
   Return current X-position of cursor.
 }
@@ -707,7 +707,7 @@ End;
 
 
 
-Function WhereY: Byte;
+Function WhereY: tcrtcoord;
 {
   Return current Y-position of cursor.
 }

+ 3 - 3
rtl/watcom/crt.pp

@@ -208,7 +208,7 @@ Begin
 End;
 
 
-Procedure GotoXy(X: Byte; Y: Byte);
+Procedure GotoXy(X: tcrtcoord; Y: tcrtcoord);
 {
   Go to coordinates X,Y in the current window.
 }
@@ -273,7 +273,7 @@ End;
 
 
 
-Function WhereX: Byte;
+Function WhereX: tcrtcoord;
 {
   Return current X-position of cursor.
 }
@@ -286,7 +286,7 @@ End;
 
 
 
-Function WhereY: Byte;
+Function WhereY: tcrtcoord;
 {
   Return current Y-position of cursor.
 }

+ 3 - 3
rtl/win/crt.pp

@@ -143,7 +143,7 @@ Begin
   TextBackGround(0);
 End;
 
-Procedure GotoXY(X: Byte; Y: Byte);
+Procedure GotoXY(X: tcrtcoord; Y: tcrtcoord);
 
 begin
   GotoXY32(X,Y);
@@ -227,7 +227,7 @@ begin
     Coord, @Temp);
 end;
 
-Function WhereX: Byte;
+Function WhereX: tcrtcoord;
 
 
 begin
@@ -245,7 +245,7 @@ Begin
   WhereX32:= x - WindMinX +1;
 End;
 
-Function WhereY: Byte;
+Function WhereY: tcrtcoord;
 
 begin
   WhereY:=WhereY32 mod 256;