home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / jËzyki_programowania / oberon / system1 / myedit.mod (.txt) < prev    next >
Oberon Text  |  1977-12-31  |  1KB  |  42 lines

  1. Syntax10.Scn.Fnt
  2. Syntax10i.Scn.Fnt
  3. StampElems
  4. Alloc
  5. 6 Oct 94
  6. Syntax10b.Scn.Fnt
  7. MODULE MyEdit;
  8. (** Markus Knasm
  9. ller  
  10.     IMPORT DialogCheckBoxes, DialogFrames, Dialogs, DialogTexts, Oberon, TextFrames, Texts;
  11.     VAR  w: Texts.Writer;
  12. PROCEDURE Open*;
  13. (** you can also use Dialog.Open Test.Dlg instead of this commando *)
  14.     VAR x, y: INTEGER; p: Dialogs.Panel;
  15. BEGIN
  16.     Oberon.AllocateUserViewer (Oberon.Mouse.X, x, y);
  17.     DialogFrames.OpenPanel ("Test.Dlg", x, y, p);
  18. END Open;
  19. PROCEDURE Print*;
  20. (** prints the text in draft or not draft mode *)
  21.     VAR t, draft: Dialogs.Object; par: Oberon.ParList; res: INTEGER; t1: Texts.Text; p: Dialogs.Panel;
  22. BEGIN
  23.     NEW (par); par.text := TextFrames.Text (""); par.vwr := Oberon.FocusViewer; par.frame := Oberon.Par.frame;
  24.     p := Dialogs.cmdPanel;
  25.     t := p.NamedObject ("file"); 
  26.     draft := p.NamedObject ("draft");
  27.     WITH t: DialogTexts.Item DO
  28.         WITH draft: DialogCheckBoxes.Item DO
  29.             IF draft.on THEN
  30.                 Texts.WriteString (w, "QuickDraw % ");
  31.             ELSE
  32.                 Texts.WriteString (w, "QuickDraw ");
  33.             END;
  34.             t1 := t.GetText (); Texts.Save (t1, 0, t1.len, w.buf); Texts.Append (par.text, w.buf); 
  35.             Oberon.Call ("Edit.Print", par, FALSE, res);
  36.         ELSE
  37.         END
  38.     ELSE
  39. END Print;
  40. BEGIN Texts.OpenWriter (w);
  41. END MyEdit.
  42.