home *** CD-ROM | disk | FTP | other *** search
/ The Best of Mecomp Multimedia 2 / MECOMP-CD-II.iso / amiga / programmieren / e / easyplugins / examples / multitext_demo.e < prev    next >
Encoding:
Text File  |  1998-02-25  |  2.1 KB  |  72 lines

  1.  
  2. /*
  3.  
  4.     text_demo: example program for text_plugin
  5.  
  6. */
  7.  
  8. OPT PREPROCESS, OSVERSION=37
  9.  
  10. MODULE 'tools/easygui', 'easyplugins/multitext', 'graphics/text',
  11.        'utility', 'utility/tagitem'
  12.  
  13. DEF multitext_a:PTR TO multitext_plugin,
  14.     multitext_b:PTR TO multitext_plugin,
  15.     multitext_c:PTR TO multitext_plugin,
  16.     disabled=FALSE, bars=FALSE
  17.  
  18. PROC main() HANDLE
  19.  
  20.     IF (utilitybase:=OpenLibrary('utility.library', 37))=NIL THEN Raise("utlb")
  21.  
  22.     NEW multitext_a.multitext([PLA_MultiText_Text, ['First test:', 'multitext_plugin', 'with many lines'],
  23.                                TAG_DONE]),
  24.         multitext_b.multitext([PLA_MultiText_Text, ['Second test:', 'multitext_plugin', 'with many lines'],
  25.                                PLA_MultiText_Justification, PLV_MultiText_JustifyLeft,
  26.                                TAG_DONE]),
  27.         multitext_c.multitext([PLA_MultiText_Text, ['Third test:', 'multitext_plugin', 'with many lines'],
  28.                                PLA_MultiText_Justification, PLV_MultiText_JustifyRight,
  29.                                TAG_DONE])
  30.  
  31.     easyguiA('multitext_plugin example',
  32.              [ROWS,
  33.                  [PLUGIN, 1, multitext_a],
  34.                  [PLUGIN, 1, multitext_b],
  35.                  [PLUGIN, 1, multitext_c],
  36.                  [COLS,
  37.                     [CHECK, {toggle_disabled}, '_Disabled?', disabled, FALSE, -1, "d"],
  38.                     [CHECK, {toggle_bars}, '_Bars?', bars, FALSE, -1, "b"],
  39.                     [SPACEH],
  40.                     [BUTTON, 0, 'Quit']
  41.                  ]
  42.              ])
  43.  
  44. EXCEPT DO
  45.  
  46.     END multitext_a, multitext_b, multitext_c
  47.  
  48.     IF utilitybase THEN CloseLibrary(utilitybase)
  49.  
  50. ENDPROC
  51.  
  52. PROC toggle_disabled()
  53.  
  54.     IF disabled THEN disabled:=FALSE ELSE disabled:=TRUE
  55.  
  56.     multitext_a.set(PLA_MultiText_Disabled, disabled)
  57.     multitext_b.set(PLA_MultiText_Disabled, disabled)
  58.     multitext_c.set(PLA_MultiText_Disabled, disabled)
  59.  
  60. ENDPROC
  61.  
  62. PROC toggle_bars()
  63.  
  64.     IF bars THEN bars:=FALSE ELSE bars:=TRUE
  65.  
  66.     multitext_a.set(PLA_MultiText_DrawBar, bars)
  67.     multitext_b.set(PLA_MultiText_DrawBar, bars)
  68.     multitext_c.set(PLA_MultiText_DrawBar, bars)
  69.  
  70. ENDPROC
  71.  
  72.