[Oberon] SystemV - Viewer Scroll
thomas.kral at email.cz
Mon Mar 18 21:13:58 CET 2019
On Fri, 15 Mar 2019 09:33:10 +0100
Jörg Straube <joerg.straube at iaeth.ch> wrote:
> Textframes knows lines and line breaks, Texts doesn‘t care.
Thank you, having re-read chapters on Texts and Frames.
Interesting, line brakes are kept in `Line' list that is built on the
fly when line is displayed `DisplayLine'.
Updating display is single pass and is fast. I also looked into
`LocateLine' these are all simple procs, I can understand so far.
Forward move seems favoured to backward in `Show' procedure, that I do not understand yet.
Unlike `Modify' proc that is called when a menu bar is moved up or down.
PROCEDURE Modify* (F: Frame; id, dY, Y, H: INTEGER);
Mark(F, FALSE); RemoveMarks(F); SetChangeMark(F, FALSE);
IF id = MenuViewers.extend THEN
IF dY > 0 THEN Display.CopyBlock(F.X, F.Y, F.W, F.H, F.X, F.Y + dY, 0); F.Y := F.Y + dY END;
ELSIF id = MenuViewers.reduce THEN
Reduce(F, Y + dY);
IF dY > 0 THEN Display.CopyBlock(F.X, F.Y, F.W, F.H, F.X, Y, 0); F.Y := Y END
IF F.H > 0 THEN Mark(F, TRUE); SetChangeMark(F, F.text.changed) END
Modify above almost mimics scroll forward(extend) and backward(reduce), it also nicely shows the idea of `dY'.
Both directions using `CopyBlock'!
I wonder why `Show' does not follow similar pattern of Modify. I can see, howevber, that code is symetric, though.
if pos < F.pos
elsif pos > F.pos
Tomas Kral <thomas.kral at email.cz>
More information about the Oberon