[Oberon] Oberon.Call
eas lab
lab.eas at gmail.com
Fri Feb 1 23:56:34 CET 2013
Thanks Paul,
] > Getting the tokens at the cursor is exactly what must happen with:
] > Oberon.Call(S.s, Oberon.Par, FALSE, res);
] ...
]> But the <TextScanner> does NOT read the cursor co-ordinates;
] Have a look at TextFrames.Call(), which calls Oberon.Call() after setting
] up the parameters to the command.
]
] TextFrames.Call() is called from TextFrames.Edit() when tracking the mouse.
]
] TextFrames.Edit is in turn called from the TextFrames message handler
] TextFrames.Handle().
----
OK, but I still can't see how to get the char at the CURSOR.
Is this correct:--
Oberon.GetSelection(text, beg, end, time);
char := <Scan 'text' from 'beg'>
would get the char of mouse: RM.
But the RECORD in Oberon.Mod which holds 'text' and 'beg'
has been Set by a process, which runs in the background,
which is not published.
---------------------------------------------
I want the CURSOR-chars, to be returned, for various keys, like they
can be, for mouse: RM, via < Scan(GetSelected(args)) >.
The code which allows MM to be replaced by kybrd:Ctrl, would also be
close to my requirements. But I can't find it, and perhaps it was only
in the early DOSbased version.
======= OK I found something! Geunter Feldmann's archives are substantial
and he's done a substantial job makeing ETHO usable on other OSs.
NO/Input.Mod == ...
PROCEDURE Mouse*(VAR keys: SET; VAR x, y: INTEGER);
(* middle button emulation *)
IF buttons # 3 THEN (* -2, 2, -3 *)
IF buttons = 2 THEN (* 2 => Ctrl is middle button *)
------- --
But I can't find a solution from this lead, either.
The difficult part, is that the <text stream viewed on the screen/display>
consists of differnt sized rectangles.
It seems to me that there can be no 'mapping' from X,Y to the correspondingly
displayed-char. Because eg. if you change the font-size of charN, then the
X,Y of char (n + i) changes.
So the X,Y location of any char/object is <where it gets allocated, depending
on the number a sizes of preceding chars>.
Analagously: is it possible to know the Nth prime number, without knowing all
N-1 preceding?
OMG, it's even more complex: it's NOT the char that has coordinates; it's
the pixel-rectangle of the char. But *that* mapping is direct/easy.
I'm not getting near a solution.
== Chris Glur.
More information about the Oberon
mailing list