[Oberon] SystemV - Viewer Scroll

Jörg Straube joerg.straube at iaeth.ch
Fri Mar 15 09:33:10 CET 2019

Trying to understand „TextFrames“ is not an easy task but worth doing.

First you have to understand Texts and the internal piece representation of Text.

Texts (and the pieces) represent a one-dimensional, sequential stream of characters. Pieces help to easily insert or delete characters or a batch of characters without physically moving characters around in memory. The index into this stream is called „pos“.

As the screen is two-dimensional (x,y coordinates) one of the main tasks of Textframes is to break the sequential Text in two dimensions: one dimension (y axis) is the line, the second dimension (x axis) is the character position in a line. So Textframes knows lines and line breaks, Texts doesn‘t care.
Every line has an „org“ and a „len“. „org“ is the „pos“ of the first character of the line. F.org is the pos of the first character of the top most line displayed in that Frame.
All of this and much more is obviously described in NWs documentation. Please have a look at chapter 5


> Am 15.03.2019 um 09:02 schrieb Tomas Kral <thomas.kral at email.cz>:
> On Thu, 14 Mar 2019 21:36:28 +0100
> Andreas Pirklbauer <andreas_pirklbauer at yahoo.com> wrote:
>> Using ‘CopyBlock' to optimize scrolling in *both* directions
> Hi Andreas,
> Thank you, looking into your code. I wish, however to understand the
> original first.
> PROCEDURE Show* (F: Frame; pos: LONGINT);
>  (* driven by delta pos - F.org *) 
>  IF pos < F.org THEN (*???*)
>  ELSIF pos > F.org THEN (*???*)
>  ELSIF pos = F.org THEN (*???*)
>    (*use of CopyBlock()*)
>  ELSE (*???*)
>  END ;
> END Show;
> PROCEDURE Edit* (F: Frame; X, Y: INTEGER; Keys: SET);
>   IF Keys = {2} THEN   (*ML, scroll up*)
>   ELSIF Keys = {1} THEN   (*MM*) (*!!! up or down !!!*)
>   ELSIF Keys = {0} THEN   (*MR, scroll down*)
>   END ;
>   Show(....);
> END Edit;
> -- 
> Tomas Kral <thomas.kral at email.cz>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20190315/6bbe8ed3/attachment.html>

More information about the Oberon mailing list