Syntax10.Scn.Fnt Syntax10i.Scn.Fnt StampElems Alloc 6 Oct 94 Syntax10b.Scn.Fnt MODULE MyEdit; (** Markus Knasm ller IMPORT DialogCheckBoxes, DialogFrames, Dialogs, DialogTexts, Oberon, TextFrames, Texts; VAR w: Texts.Writer; PROCEDURE Open*; (** you can also use Dialog.Open Test.Dlg instead of this commando *) VAR x, y: INTEGER; p: Dialogs.Panel; BEGIN Oberon.AllocateUserViewer (Oberon.Mouse.X, x, y); DialogFrames.OpenPanel ("Test.Dlg", x, y, p); END Open; PROCEDURE Print*; (** prints the text in draft or not draft mode *) VAR t, draft: Dialogs.Object; par: Oberon.ParList; res: INTEGER; t1: Texts.Text; p: Dialogs.Panel; BEGIN NEW (par); par.text := TextFrames.Text (""); par.vwr := Oberon.FocusViewer; par.frame := Oberon.Par.frame; p := Dialogs.cmdPanel; t := p.NamedObject ("file"); draft := p.NamedObject ("draft"); WITH t: DialogTexts.Item DO WITH draft: DialogCheckBoxes.Item DO IF draft.on THEN Texts.WriteString (w, "QuickDraw % "); ELSE Texts.WriteString (w, "QuickDraw "); END; t1 := t.GetText (); Texts.Save (t1, 0, t1.len, w.buf); Texts.Append (par.text, w.buf); Oberon.Call ("Edit.Print", par, FALSE, res); ELSE END ELSE END Print; BEGIN Texts.OpenWriter (w); END MyEdit.