Syntax10.Scn.FntSyntax10i.Scn.Fnt`=IStampElemsAlloc28 Jun 98{qInfoElemsAllocVSyntax10.Scn.Fnt`=IStampElemsAlloc28 Jun 98R/"Title": WebPanelElems "Author": Andreas Helm "Abstract": WebPanelElems is part of the Oberon-Web-Browser "Keywords": Panels, Cells, Tablecells, Web, Webbrowser, Tables "Version": no version "From": 1 March 98 "Until":  "Changes": no changes so far "Hints": based on PanelElems from the elems package aqBalloonElemsAllocSyntax10.Scn.FntSyntax10i.Scn.Fnt Syntax10b.Scn.Fnt 1  Syntax10m.Scn.Fnt @ !  (  &  !,   -!+"WebPanelElems" WebPanelElems is an auxiliaray module for the Oberon-Web-Browser. It implements the panels for the rows of the tables and the container for complex cells with nested tables. WebPanelElems is based on the Elems package. "Elem" Elem* = POINTER TO ElemDesc; ElemDesc* = RECORD(PanelElems.PanelDesc) END; "ElemDesc" Elem* = POINTER TO ElemDesc; See Elem for more details. "DrawPanel" PROCEDURE DrawPanel*(e: WebPanelElems.Elem; x, y, color: INTEGER; f: Display.Frame); DrawPanel draws the frame around the elem e and draws the panel. "Handle" PROCEDURE Handle*(E: Texts.Elem; VAR msg: Texts.ElemMsg); Handle is the handler for a WebPanelElems.Elem. "Init" PROCEDURE Init*(e: WebPanelElems.Elem); Init sets the default values for the elem e. "New" PROCEDURE New*; New creates a new element and calls Init for it. The resulting element is stored in Texts.New. "Create" PROCEDURE Create*(border: INTEGER): WebPanelElems.Elem; Create creates a new element and calls Init for it. The resulting element is returned..|Syntax10b.Scn.Fnt8FoldElemsNewCSyntax10.Scn.FntSyntax10b.Scn.Fnt %0 ElemDesc* = RECORD(PanelElems.PanelDesc) END;88  38tSyntax10i.Scn.FntSyntax10.Scn.Fnt&O%] VAR h, w, X, Y, W, H : INTEGER; BEGIN h := GU.Unit(p.H, TRUE); w := GU.Unit(p.W, TRUE); GU.ReplConst(f, color, x, y, w, h, Display.paint); IF p.border > 0 THEN GU.Frame(f, GU.black, x, y, w, h, p.border, Display.paint) END; IF f # NIL THEN PanelElems.TruncateFrame(f(PanelElems.Frame), X, Y, W, H) END; PanelElems.DrawContents(p, f, x, y); IF f # NIL THEN PanelElems.SetFrameCoords(f(PanelElems.Frame), X, Y, W, H) END END DrawPanel;8 *8OSyntax10.Scn.FntaSyntax10i.Scn.Fnt4&8FoldElemsNew_Syntax10.Scn.FntSyntax10i.Scn.Fnt0< IF msg.prepare THEN (* send display message to all embedded elems *) Texts.OpenReader(r, E.elemTxt, 0); WHILE ~ r.eot DO Texts.ReadElem(r); IF r.elem # NIL THEN r.elem.handle(r.elem, msg) END END ELSE E.sel := NIL; msg.elemFrame := PanelElems.OpenFrame(E, msg.frame, PanelElems.FrameHandle, msg.X0, msg.Y0, SHORT(E.W DIV DUnit), SHORT(E.H DIV DUnit)); DrawPanel(E, msg.X0, msg.Y0, msg.col, msg.elemFrame) END 8# 8#Syntax10.Scn.Fnt IF ~msg.prepare THEN border := E.border; IF E.border > 0 THEN E.border := 1 ELSE E.border := 0 END; PanelElems.Handle(E, msg); E.border := border; ELSE PanelElems.Handle(E, msg) END 88#Syntax10.Scn.FntSS IF msg.e = NIL THEN NEW(elem); msg.e := elem END; PanelElems.Handle(E, msg) 8 8CSyntax10.Scn.FntSyntax10i.Scn.Fnt.2 msg.mod := "WebPanelElems"; msg.proc := "New" 848#Syntax10.Scn.Fnt PanelElems.Handle(E, msg) 8!8#Syntax10.Scn.Fnt PanelElems.Handle(E, msg) 8!8#Syntax10.Scn.Fnt PanelElems.Handle(E, msg) 818#Syntax10.Scn.Fnt PanelElems.Handle(E, msg); Texts.OpenReader(r, E.elemTxt, 0); REPEAT Texts.ReadElem(r); IF r.elem # NIL THEN r.elem.handle(r.elem, msg) END; UNTIL r.eot38 VAR r: Texts.Reader; elem: Elem; border: INTEGER; BEGIN WITH E: Elem DO E.locked := TRUE; (* to prevent unlocking by Inspector or a program *) WITH msg: TextFrames.DisplayMsg DO  | msg : TextPrinter.PrintMsg DO  | msg : Texts.CopyMsg DO  | msg : Texts.IdentifyMsg DO  | msg : Elems.AttrMsg DO | msg : Texts.FileMsg DO  | msg: TextFrames.TrackMsg DO  | msg: TextFrames.FocusMsg DO  ELSE  (* Broadcast to all elems, which are in elemTxt *)  END END END Handle;80  ~8<Syntax10i.Scn.FntSyntax10.Scn.FntFG BEGIN PanelElems.Init(e); e.handle := Handle; e.border := 1 END Init;83 8<Syntax10i.Scn.FntSyntax10.Scn.Fnt=> VAR e: Elem; BEGIN NEW(e); Init(e); Texts.new := e END New;8F 8#Syntax10.Scn.FntOO VAR e: Elem; BEGIN NEW(e); Init(e); e.border := border; RETURN e END Create;8MODULE WebPanelElems; (* Andreas Helm,  *)   (* Based on PanelElems of the elems package *) IMPORT Display, Elems, GU := GUtils, PanelElems, TextFrames, TextPrinter, Texts; CONST DUnit = TextFrames.Unit; TYPE Elem* = POINTER TO ElemDesc;  (* Draws a frame around the elem and paints the Panel *) PROCEDURE DrawPanel*(p: Elem; x, y, color: INTEGER; f: Display.Frame);  (* Message handler *) PROCEDURE Handle*(E: Texts.Elem; VAR msg: Texts.ElemMsg);  (* Sets the default properties of the element *) PROCEDURE Init*(e: Elem);  (* Creates a new element and calls Init for it *) PROCEDURE New*;  (* Creates a new element, initializes it and returns it as result *) PROCEDURE Create*(border: INTEGER): Elem;  END WebPanelElems.