[Oberon] Re: N-O Scanner structure confusing ?
thoken at gmail.com
thoken at gmail.com
Sat Feb 10 23:08:44 MET 2007
After reading some ETH PlugIn / Win32 2.4 (14.5.2001) code
I would start to try something like:
VAR M: Oberon.CaretMsg;
M.id := Oberon.get; M.car := NIL;
Display(?).Broadcast(M);
(* TextFrames.GetCaret is called for every frame
by TextFrames.Handle and perhaps other Handlers,
but only the "FocusViewer" may "feed" the message. *)
IF (M.car # NIL) & (M.car IS Textframes.Frame) THEN
(* M.car should be the frame viewing M.text and the caret at M.pos *)
On 2/10/07, Bob Walkden <bob at web-options.com> wrote:
> > > I use the ETH version for Windows, and the native version on bare
> > > Intel hardware. N-O does not seem to have Oberon.FocusViewer.
> > > Anybody know where the FocusViewer variable is in N-O?
> > >
> > If I had ETH version for Windows and time perhaps I'd examine
> > what "Oberon.FocusViewer" does; and then see if N-O needs/has
> > the same requirement.
>
> Sorry, I was a little unclear. Neither of these versions includes
> Oberon.FocusViewer.
>
> FocusViewer tells you which Viewer has the keyboard focus. That is,
> which one is displaying the caret.
>
> --
> Regards,
> Bob
>
> > Thomas wrote:
> > > [...]
> > > > > Here's a simple job which I can't acheive -- directly yet.
> > > > > 1. set the caret
> > > > > 2. scan from the caret until the token "END"
> > > > > 3. reset the caret after the found token.
> [...]
> > > > PROCEDURE Do*; (* Test.Do *)
> > > > VAR F: TextFrames.Frame; S: Texts.Scanner;
> > > > BEGIN
> > > > F := Oberon.FocusViewer.dsc.next(TextFrames.Frame);
> > > > IF F.hasCar THEN
> > > > Texts.OpenScanner(S, F.text, F.carloc.pos); Texts.Scan(S);
> > > > WHILE ~S.eot & ((S.class # Texts.Name) OR (S.s # "END")) DO
> > > > Texts.Scan(S)
> > > > END;(***)
> > > > IF ~S.eot THEN
> > > > TextFrames.SetCaret(F, Texts.Pos(S))
> > > > END
> > > > END
> > > > END Do;
More information about the Oberon
mailing list