ðQOberon10.Scn.FntOberon10i.Scn.Fnt€¹ MODULE Configuration; (* jt, js 28.10.93 *) (*---------------------------------------------------------* * Copyright (c) 1990-1996 ETH Z…rich. All Rights Reserved. * Oberon is a trademark of Institut f…r Computersysteme, ETH Z…rich. *---------------------------------------------------------*) (* * Executing the body of this module sets up the startup viewer configuration. * In addition to the standard config, this configuration sets up an 'intelligent' * scrolling log viewer with a command-level pin point. It has also a procedure * for inverting the palette of the white and black colors (If you want it, remove * the comments in the body. * * This module might be changed and recompiled to fit your personal needs. * If the Configuration.obj file does not exist, a default configuration will be used. *) IMPORT Viewers, Oberon, TextFrames, MenuViewers, Display, Texts, Files; CONST StandardMenu = "System.Close System.Copy System.Grow Edit.Search Edit.Store "; LogMenu = "System.Close System.Grow Edit.Locate Edit.Store "; VAR pinPos: LONGINT; PROCEDURE SetColors*; BEGIN Display.SetColor (15, 255, 255, 255); Display.SetColor (0, 0, 0, 0); END SetColors; PROCEDURE PinLog*; BEGIN pinPos := Oberon.Log.len; END PinLog; PROCEDURE HandleLog(F: Display.Frame; VAR M: Display.FrameMsg); VAR ch: CHAR; R: Texts.Reader; org: LONGINT; BEGIN TextFrames.Handle(F, M); IF M IS TextFrames.UpdateMsg THEN WITH M: TextFrames.UpdateMsg DO IF (M.text = Oberon.Log) & (M.id = TextFrames.insert) THEN WITH F: TextFrames.Frame DO IF M.beg > TextFrames.Pos(F, F.X + F.W, F.Y) + 1 THEN org := M.beg - 200 ELSE org := F.org END ; WHILE (org < pinPos) & (org < M.beg) & (TextFrames.Pos(F, F.X + F.W, F.Y) < M.end-1) DO Texts.OpenReader(R, F.text, org); REPEAT Texts.Read(R, ch) UNTIL R.eot OR (ch = 0DX); org := Texts.Pos(R); TextFrames.Show(F, org) END END END END END END HandleLog; PROCEDURE OpenViewers; VAR logV, toolV: Viewers.Viewer; X, Y: INTEGER; logger: Oberon.Task; T: Texts.Text; M: TextFrames.Frame; buf: Texts.Buffer; BEGIN Oberon.AllocateSystemViewer(0, X, Y); logV := MenuViewers.New( TextFrames.NewMenu("System.Log", LogMenu), TextFrames.NewText(Oberon.Log, 0), TextFrames.menuH, X, Y); logV.dsc.next.handle := HandleLog; Oberon.AllocateSystemViewer(0, X, Y); IF Files.Old("System.Menu.Text") = NIL THEN M := TextFrames.NewMenu("System.Tool", StandardMenu) ELSE M := TextFrames.NewMenu("System.Tool", ""); NEW(T); Texts.Open(T, "System.Menu.Text"); NEW(buf); Texts.OpenBuf(buf); Texts.Save(T, 0, T.len, buf); Texts.Append(M.text, buf) END; toolV := MenuViewers.New(M, TextFrames.NewText(TextFrames.Text("System.Tool"), 0), TextFrames.menuH, X, Y + 50) ; NEW(logger); logger.safe := TRUE; logger.time := -1; logger.handle := PinLog; Oberon.Install(logger) END OpenViewers; BEGIN (* SetColors; *) OpenViewers END Configuration.