|
@@ -165,11 +165,6 @@ TYPE
|
|
END
|
|
END
|
|
END GetLineLength;
|
|
END GetLineLength;
|
|
|
|
|
|
- PROCEDURE GetNofLines() : LONGINT;
|
|
|
|
- BEGIN
|
|
|
|
- RETURN nofLines
|
|
|
|
- END GetNofLines;
|
|
|
|
-
|
|
|
|
PROCEDURE LayoutLine(VAR pos : LONGINT; VAR lineInfo : LineInfo);
|
|
PROCEDURE LayoutLine(VAR pos : LONGINT; VAR lineInfo : LineInfo);
|
|
VAR
|
|
VAR
|
|
dummyCh : Char32;
|
|
dummyCh : Char32;
|
|
@@ -959,7 +954,7 @@ TYPE
|
|
PROCEDURE UpdateScrollbars;
|
|
PROCEDURE UpdateScrollbars;
|
|
BEGIN
|
|
BEGIN
|
|
IF vScrollbar # NIL THEN
|
|
IF vScrollbar # NIL THEN
|
|
- vScrollbar.max.Set(layout.GetNofLines());
|
|
|
|
|
|
+ vScrollbar.max.Set(layout.nofLines);
|
|
vScrollbar.pos.Set(firstLineI);
|
|
vScrollbar.pos.Set(firstLineI);
|
|
END;
|
|
END;
|
|
IF hScrollbar # NIL THEN
|
|
IF hScrollbar # NIL THEN
|
|
@@ -1363,7 +1358,7 @@ TYPE
|
|
PROCEDURE CheckNumberOfLines;
|
|
PROCEDURE CheckNumberOfLines;
|
|
BEGIN
|
|
BEGIN
|
|
UpdateScrollbars;
|
|
UpdateScrollbars;
|
|
- firstLine.SetBounds(0, layout.GetNofLines() - 1)
|
|
|
|
|
|
+ firstLine.SetBounds(0, layout.nofLines - 1)
|
|
END CheckNumberOfLines;
|
|
END CheckNumberOfLines;
|
|
|
|
|
|
PROCEDURE CheckCursor;
|
|
PROCEDURE CheckCursor;
|
|
@@ -1395,7 +1390,7 @@ TYPE
|
|
(* move the cursor down by 3 lines to get more context *)
|
|
(* move the cursor down by 3 lines to get more context *)
|
|
l := MAX(0, l - 3);
|
|
l := MAX(0, l - 3);
|
|
firstLine.Set(l);
|
|
firstLine.Set(l);
|
|
- ELSIF (l < layout.GetNofLines()) THEN
|
|
|
|
|
|
+ ELSIF (l < layout.nofLines) THEN
|
|
ty := bordersI.t; i := firstLineI;
|
|
ty := bordersI.t; i := firstLineI;
|
|
WHILE i < l DO
|
|
WHILE i < l DO
|
|
ty := ty + layout.lines[i].height;
|
|
ty := ty + layout.lines[i].height;
|
|
@@ -1805,7 +1800,7 @@ TYPE
|
|
PROCEDURE LineYPos(lineNr : LONGINT; VAR y0, y1 : LONGINT);
|
|
PROCEDURE LineYPos(lineNr : LONGINT; VAR y0, y1 : LONGINT);
|
|
VAR i : LONGINT;
|
|
VAR i : LONGINT;
|
|
BEGIN
|
|
BEGIN
|
|
- IF (lineNr >= firstLineI) & (lineNr < layout.GetNofLines()) THEN
|
|
|
|
|
|
+ IF (lineNr >= firstLineI) & (lineNr < layout.nofLines) THEN
|
|
y0 := bordersI.t; i := firstLineI;
|
|
y0 := bordersI.t; i := firstLineI;
|
|
WHILE i < lineNr DO
|
|
WHILE i < lineNr DO
|
|
y0 := y0 + layout.lines[i].height;
|
|
y0 := y0 + layout.lines[i].height;
|
|
@@ -1856,7 +1851,7 @@ TYPE
|
|
RETURN TRUE
|
|
RETURN TRUE
|
|
ELSIF (pos = 0) & (firstLineI = 0) THEN
|
|
ELSIF (pos = 0) & (firstLineI = 0) THEN
|
|
ty := bordersI.t;
|
|
ty := bordersI.t;
|
|
- IF layout.GetNofLines() > 0 THEN
|
|
|
|
|
|
+ IF layout.nofLines > 0 THEN
|
|
y := (ty + layout.lines[0].ascent);
|
|
y := (ty + layout.lines[0].ascent);
|
|
ELSE
|
|
ELSE
|
|
f := GetFont();
|
|
f := GetFont();
|
|
@@ -1868,7 +1863,7 @@ TYPE
|
|
RETURN TRUE
|
|
RETURN TRUE
|
|
ELSE
|
|
ELSE
|
|
l := layout.FindLineNrByPos(pos);
|
|
l := layout.FindLineNrByPos(pos);
|
|
- IF (l >= firstLineI) & (l < layout.GetNofLines()) THEN
|
|
|
|
|
|
+ IF (l >= firstLineI) & (l < layout.nofLines) THEN
|
|
ty := bordersI.t; i := firstLineI;
|
|
ty := bordersI.t; i := firstLineI;
|
|
WHILE i < l DO
|
|
WHILE i < l DO
|
|
ty := ty + layout.lines[i].height;
|
|
ty := ty + layout.lines[i].height;
|
|
@@ -2362,7 +2357,7 @@ TYPE
|
|
IF llen < 0 THEN
|
|
IF llen < 0 THEN
|
|
linelength := layout.GetLineLength(linenr);
|
|
linelength := layout.GetLineLength(linenr);
|
|
(* hack for the bidi formatter *)
|
|
(* hack for the bidi formatter *)
|
|
- IF linenr = layout.GetNofLines() - 1 THEN
|
|
|
|
|
|
+ IF linenr = layout.nofLines - 1 THEN
|
|
DEC(linelength);
|
|
DEC(linelength);
|
|
END;
|
|
END;
|
|
ELSE
|
|
ELSE
|
|
@@ -2385,7 +2380,7 @@ TYPE
|
|
localTextReader.SetPosition(0);
|
|
localTextReader.SetPosition(0);
|
|
ELSE
|
|
ELSE
|
|
(* revert the hack for the bidi formatter *)
|
|
(* revert the hack for the bidi formatter *)
|
|
- IF (llen < 0) & (linenr = layout.GetNofLines() - 1) THEN
|
|
|
|
|
|
+ IF (llen < 0) & (linenr = layout.nofLines - 1) THEN
|
|
INC(linelength);
|
|
INC(linelength);
|
|
END;
|
|
END;
|
|
localTextReader := utilreader;
|
|
localTextReader := utilreader;
|
|
@@ -2634,7 +2629,7 @@ TYPE
|
|
pos := positionMarkers[i].pos.GetPosition();
|
|
pos := positionMarkers[i].pos.GetPosition();
|
|
l := layout.FindLineNrByPos(pos);
|
|
l := layout.FindLineNrByPos(pos);
|
|
IF FindScreenPos(pos, x, y) THEN
|
|
IF FindScreenPos(pos, x, y) THEN
|
|
- IF (l >= 0) & (l < layout.GetNofLines()) THEN
|
|
|
|
|
|
+ IF (l >= 0) & (l < layout.nofLines) THEN
|
|
ascent := layout.lines[l].ascent;
|
|
ascent := layout.lines[l].ascent;
|
|
(* IF ascent = 0 THEN ascent := layout.lines[l].height END;
|
|
(* IF ascent = 0 THEN ascent := layout.lines[l].height END;
|
|
IF ascent = 0 THEN ascent := 10 END; *)
|
|
IF ascent = 0 THEN ascent := 10 END; *)
|
|
@@ -3088,8 +3083,8 @@ TYPE
|
|
NEW(dragSelA, text);NEW(dragSelB, text);
|
|
NEW(dragSelA, text);NEW(dragSelB, text);
|
|
dragSelA.SetPosition(selection.a); dragSelB.SetPosition(selection.b);
|
|
dragSelA.SetPosition(selection.a); dragSelB.SetPosition(selection.b);
|
|
|
|
|
|
- la := Limit(layout.FindLineNrByPos(selection.a), 0, layout.GetNofLines() - 1);
|
|
|
|
- lb := Limit(layout.FindLineNrByPos(selection.b), 0, layout.GetNofLines() - 1);
|
|
|
|
|
|
+ la := Limit(layout.FindLineNrByPos(selection.a), 0, layout.nofLines - 1);
|
|
|
|
+ lb := Limit(layout.FindLineNrByPos(selection.b), 0, layout.nofLines - 1);
|
|
(* estimate the size of the selection *)
|
|
(* estimate the size of the selection *)
|
|
h := 0; w := 0;
|
|
h := 0; w := 0;
|
|
FOR i := la TO lb DO
|
|
FOR i := la TO lb DO
|
|
@@ -3375,7 +3370,7 @@ TYPE
|
|
END;
|
|
END;
|
|
|
|
|
|
cl := layout.FindLineNrByPos(pos);
|
|
cl := layout.FindLineNrByPos(pos);
|
|
- IF cl < layout.GetNofLines() - 1 THEN
|
|
|
|
|
|
+ IF cl < layout.nofLines - 1 THEN
|
|
INC(cl);
|
|
INC(cl);
|
|
lineStart := layout.GetLineStartPos(cl);
|
|
lineStart := layout.GetLineStartPos(cl);
|
|
cPos := lineStart + MIN(layout.GetLineLength(cl) - 1, lineEnter);
|
|
cPos := lineStart + MIN(layout.GetLineLength(cl) - 1, lineEnter);
|
|
@@ -3469,13 +3464,13 @@ TYPE
|
|
cursor.SetVisible(TRUE);
|
|
cursor.SetVisible(TRUE);
|
|
Texts.ClearLastSelection
|
|
Texts.ClearLastSelection
|
|
END;
|
|
END;
|
|
- IF firstLineI = layout.GetNofLines() - 1 THEN
|
|
|
|
|
|
+ IF firstLineI = layout.nofLines - 1 THEN
|
|
cursor.SetPosition(text.GetLength());
|
|
cursor.SetPosition(text.GetLength());
|
|
ELSE
|
|
ELSE
|
|
(* save cursor screen pos for repositioning *)
|
|
(* save cursor screen pos for repositioning *)
|
|
IF ~FindScreenPos(cursor.GetPosition(), cx, cy) THEN cx := 0; cy := 0 END;
|
|
IF ~FindScreenPos(cursor.GetPosition(), cx, cy) THEN cx := 0; cy := 0 END;
|
|
i := firstLineI; dy := 0;
|
|
i := firstLineI; dy := 0;
|
|
- WHILE (i < layout.GetNofLines() - 1) & (dy < bounds.GetHeight() - bordersI.t - bordersI.b) DO
|
|
|
|
|
|
+ WHILE (i < layout.nofLines - 1) & (dy < bounds.GetHeight() - bordersI.t - bordersI.b) DO
|
|
INC(i); dy := dy + (layout.lines[i].height)
|
|
INC(i); dy := dy + (layout.lines[i].height)
|
|
END;
|
|
END;
|
|
firstLine.Set(i);
|
|
firstLine.Set(i);
|