home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / MUI / MCC_TextEditor / Developer / Autodocs / MCC_TextEditor.Doc
Encoding:
Text File  |  1999-08-07  |  32.6 KB  |  1,056 lines

  1. TABLE OF CONTENTS
  2.  
  3. TextEditor.mcc/TextEditor.mcc
  4. TextEditor.mcc/MUIA_TextEditor_AreaMarked
  5. TextEditor.mcc/MUIA_TextEditor_ColorMap
  6. TextEditor.mcc/MUIA_TextEditor_Columns
  7. TextEditor.mcc/MUIA_TextEditor_Contents
  8. TextEditor.mcc/MUIA_TextEditor_CursorX
  9. TextEditor.mcc/MUIA_TextEditor_CursorY
  10. TextEditor.mcc/MUIA_TextEditor_DoubleClickHook
  11. TextEditor.mcc/MUIA_TextEditor_ExportHook
  12. TextEditor.mcc/MUIA_TextEditor_ExportWrap
  13. TextEditor.mcc/MUIA_TextEditor_FixedFont
  14. TextEditor.mcc/MUIA_TextEditor_Flow
  15. TextEditor.mcc/MUIA_TextEditor_HasChanged
  16. TextEditor.mcc/MUIA_TextEditor_ImportHook
  17. TextEditor.mcc/MUIA_TextEditor_ImportWrap
  18. TextEditor.mcc/MUIA_TextEditor_InsertMode         (not yet implemented...)
  19. TextEditor.mcc/MUIA_TextEditor_InVirtualGroup
  20. TextEditor.mcc/MUIA_TextEditor_Pen
  21. TextEditor.mcc/MUIA_TextEditor_Prop_DeltaFactor
  22. TextEditor.mcc/MUIA_TextEditor_Prop_Entries
  23. TextEditor.mcc/MUIA_TextEditor_Prop_First
  24. TextEditor.mcc/MUIA_TextEditor_Prop_Visible
  25. TextEditor.mcc/MUIA_TextEditor_Quiet
  26. TextEditor.mcc/MUIA_TextEditor_ReadOnly
  27. TextEditor.mcc/MUIA_TextEditor_RedoAvailable
  28. TextEditor.mcc/MUIA_TextEditor_Rows
  29. TextEditor.mcc/MUIA_TextEditor_Separator
  30. TextEditor.mcc/MUIA_TextEditor_Slider
  31. TextEditor.mcc/MUIA_TextEditor_StyleBold
  32. TextEditor.mcc/MUIA_TextEditor_StyleItalic
  33. TextEditor.mcc/MUIA_TextEditor_StyleUnderline
  34. TextEditor.mcc/MUIA_TextEditor_TypeAndSpell
  35. TextEditor.mcc/MUIA_TextEditor_UndoAvailable
  36. TextEditor.mcc/MUIA_TextEditor_WrapBorder
  37. TextEditor.mcc/MUIM_TextEditor_ARexxCmd
  38. TextEditor.mcc/MUIM_TextEditor_BlockInfo
  39. TextEditor.mcc/MUIM_TextEditor_ClearText
  40. TextEditor.mcc/MUIM_TextEditor_ExportBlock        (not yet implemented...)
  41. TextEditor.mcc/MUIM_TextEditor_ExportText
  42. TextEditor.mcc/MUIM_TextEditor_HandleError
  43. TextEditor.mcc/MUIM_TextEditor_InsertText
  44. TextEditor.mcc/MUIM_TextEditor_MacroBegin         (not yet implemented...)
  45. TextEditor.mcc/MUIM_TextEditor_MacroEnd           (not yet implemented...)
  46. TextEditor.mcc/MUIM_TextEditor_MacroExecute       (not yet implemented...)
  47. TextEditor.mcc/MUIM_TextEditor_MarkText
  48. TextEditor.mcc/MUIM_TextEditor_Replace
  49. TextEditor.mcc/MUIM_TextEditor_Search
  50. TextEditor.mcc/TextEditor.mcc
  51.  
  52. TextEditor.mcc is a multiline stringgadget which hold most of the functions of
  53. a normal text-editor.
  54.  
  55. The gadget is copyrighted 1998 by Allan Odgaard, and you need a licence to use
  56. it in a commercial/shareware application.
  57.  
  58. For feedback write to: Allan Odgaard
  59.                        Dagmarsgade 36
  60.                        DK-2200 Copenhagen
  61.                 email: Duff@DIKU.DK
  62.                   url: http://www.DIKU.dk/students/duff/
  63.  
  64. TextEditor.mcc/MUIA_TextEditor_AreaMarked
  65.  
  66.     NAME
  67.         MUIA_TextEditor_AreaMarked -- [..G], BOOL
  68.  
  69.     FUNCTION
  70.         This tag will be set to TRUE when text is marked. And back to
  71.         FALSE when nothing is marked.
  72.         You can create a notifyevent with this tag and let your cut/copy
  73.         buttons become ghosted when nothing is marked.
  74.  
  75. TextEditor.mcc/MUIA_TextEditor_ColorMap
  76.  
  77.     NAME
  78.         MUIA_TextEditor_ColorMap -- [IS.], LONG *
  79.  
  80.     FUNCTION
  81.         This is a map of allocated colors, which corresponds to the pen number
  82.         you set with MUIA_TextEditor_Pen.
  83.         By default the map looks like this:
  84.  
  85.            0 = Normal (user configured text/highlight color)
  86.            1 = Shine
  87.            2 = Halfshine
  88.            3 = Background
  89.            4 = Halfshadow
  90.            5 = Shadow
  91.            6 = Text
  92.            7 = Fill
  93.            8 = Mark
  94.            9 = Screen pen 0
  95.           10 = Screen pen 1
  96.           11 = Screen pen 3
  97.           .. = ...
  98.          255 = Screen pen 246
  99.  
  100.         If you supply your own colormap, then pen value 0 will still be
  101.         "Normal", i.e. the first entry in your colormap has pen value 1.
  102.         This may seem a bit illogical, suggest an alternative if you want!
  103.  
  104.         You are allowed to dynamically change the colormap. However if you
  105.         change an entry which is on-screen, then it won't have any immediate
  106.         effect. The idea is that you should e.g. supply a colormap with 16
  107.         unused LONGs, allow the user to select a custom color, allocate that
  108.         color and store the screen pen value into the colormap. Now you can
  109.         use that entry as argument to MUIA_TextEditor_Pen.
  110.  
  111.         Have in mind that your application may change screen, so the best
  112.         place to allocate/free colors are in the MUIM_Show and MUIM_Hide
  113.         methods of the editorgadget. An example of this can be found in
  114.         TextEditor-Demo.c
  115.  
  116.     EXAMPLE
  117.         /*  Create a cyclegadget which allows the user
  118.          *  to mark his text with red, green and blue.
  119.          */
  120.  
  121.            static LONG editor_cmap[3];
  122.            UBYTE *cycle_entries[] =
  123.            {
  124.              "Normal", "Red", "Green", "Blue", NULL
  125.            };
  126.  
  127.         ...
  128.            cycle = CycleObject,
  129.                        MUIA_Cycle_Entries, cycle_entries,
  130.                        End,
  131.            ...
  132.            editor = TextEditorObject,
  133.                        MUIA_TextEditor_ColorMap, editor_cmap,
  134.                        End,
  135.         ...
  136.  
  137.  
  138.         DoMethod(cycle, MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime, editor, 3, MUIM_Set, MUIA_TextEditor_Pen, MUIV_TriggerValue);
  139.         DoMethod(editor, MUIM_Notify, MUIA_TextEditor_Pen, MUIV_EveryTime, cycle, 3, MUIM_Set, MUIA_Cycle_Active, MUIV_TriggerValue);
  140.  
  141.         /* Subclass of TextEditor.mcc */
  142.  
  143.            switch(msg->MethodID)
  144.            {
  145.               case MUIM_Show:
  146.                  editor_cmap[0] = ObtainBestPenA(cm, 0xffffffff, 0, 0, NULL);
  147.                  editor_cmap[1] = ObtainBestPenA(cm, 0, 0xffffffff, 0, NULL);
  148.                  editor_cmap[2] = ObtainBestPenA(cm, 0, 0, 0xffffffff, NULL);
  149.                  break;
  150.  
  151.               case MUIM_Hide:
  152.                  ReleasePen(cm, editor_cmap[0]);
  153.                  ReleasePen(cm, editor_cmap[1]);
  154.                  ReleasePen(cm, editor_cmap[2]);
  155.                  break;
  156.            }
  157.            ...
  158.  
  159.  
  160.     SEE ALSO
  161.         MUIA_TextEditor_Pen
  162.  
  163. TextEditor.mcc/MUIA_TextEditor_Columns
  164.  
  165.     NAME
  166.         MUIA_TextEditor_Columns -- [I..], ULONG
  167.  
  168.     FUNCTION
  169.         Set the desired width in characters.
  170.  
  171.     SEE ALSO
  172.         MUIA_TextEditor_Rows
  173.  
  174. TextEditor.mcc/MUIA_TextEditor_Contents
  175.  
  176.     NAME
  177.         MUIA_TextEditor_Contents -- [IS.], APTR
  178.  
  179.     FUNCTION
  180.         Set the contents of this gadget. This should normally be a pointer to
  181.         a text buffer, but if you have supplied your own importhook, then you
  182.         can set this to anything you like, e.g. a filehandle.
  183.  
  184.     SEE ALSO
  185.         MUIA_TextEditor_ImportHook, MUIM_TextEditor_InsertText
  186.  
  187. TextEditor.mcc/MUIA_TextEditor_CursorX
  188.  
  189.     NAME
  190.         MUIA_TextEditor_CursorX -- [ISG], ULONG
  191.  
  192.     FUNCTION
  193.         You can get or set the cursors x position with this tag.
  194.         The first character on a line has position 0.
  195.         The position is not affected by the gadgets `autowrap' feature.
  196.         If you set a value higher than the length of the current line, then
  197.         it will automatically be truncated.
  198.  
  199.     SEE ALSO
  200.         MUIA_TextEditor_CursorY, MUIA_TextEditor_Position
  201.  
  202. TextEditor.mcc/MUIA_TextEditor_CursorY
  203.  
  204.     NAME
  205.         MUIA_TextEditor_CursorY -- [ISG], ULONG
  206.  
  207.     FUNCTION
  208.         You can get or set the cursors y position with this tag.
  209.         The first line has position 0.
  210.         The position is not affected by the gadgets `autowrap' feature.
  211.         If you set a value higher than the number of lines, then it will
  212.         automatically be truncated.
  213.  
  214.     SEE ALSO
  215.         MUIA_TextEditor_CursorX, MUIA_TextEditor_Position
  216.  
  217. TextEditor.mcc/MUIA_TextEditor_DoubleClickHook
  218.  
  219.     NAME
  220.         MUIA_TextEditor_DoubleClickHook -- [IS.], struct Hook *
  221.  
  222.     FUNCTION
  223.         If you use the gadget in ReadOnly mode then you may want a special
  224.         action to take place when the user doubleclick certain words.
  225.         For example a mail or news client, using this gadget to show mails,
  226.         may want the user to be able to click on URL's to lookup the link.
  227.  
  228.         The hook will be called with A1 pointing to a ClickMessage, and A0
  229.         will point to the hook itself.
  230.         Your hook should return TRUE if it wants to stop the editor from
  231.         blocking.
  232.  
  233.     EXAMPLE
  234.         /* This hook will test if the user doubleclicked an http address */
  235.  
  236.         BOOL URLHookCode (register __a1 struct ClickMessage *clickmsg)
  237.         {
  238.               UWORD pos = clickmsg->ClickPosition;
  239.  
  240.            while(pos && *(clickmsg->LineContents+pos-1) != ' ' && *(clickmsg->LineContents+pos-1) != '<')
  241.            {
  242.               pos--;
  243.            }
  244.  
  245.            if(strncmp(clickmsg->LineContents+pos, "http:", 5))
  246.            {
  247.               return(FALSE);
  248.            }
  249.            LookupURL(clickmsg->LineContents+pos);
  250.            return(TRUE);
  251.         }
  252.  
  253.     SEE ALSO
  254.         MUIA_TextEditor_ReadOnly, mui/TextEditor_mcc.h
  255.  
  256. TextEditor.mcc/MUIA_TextEditor_ExportHook
  257.  
  258.     NAME
  259.         MUIA_TextEditor_ExportHook -- [IS.], struct Hook *
  260.  
  261.     SPECIAL INPUTS
  262.         MUIV_TextEditor_ExportHook_EMail
  263.         MUIV_TextEditor_ExportHook_Plain (default)
  264.  
  265.     FUNCTION
  266.         The EMail export hook will convert a bold word to *bold*, italic
  267.         words to /italic/ and underlined words to _underline_.
  268.         It also export separators such as <sb> or <tsb>.
  269.  
  270.         See MUIA_TextEditor_ImportHook for more documentation.
  271.  
  272.     SEE ALSO
  273.         MUIA_TextEditor_ExportWrap, MUIA_TextEditor_ImportHook
  274.         MUIM_TextEditor_ExportText
  275.  
  276. TextEditor.mcc/MUIA_TextEditor_ExportWrap
  277.  
  278.     NAME
  279.         MUIA_TextEditor_ExportWrap -- [ISG], ULONG
  280.  
  281.     FUNCTION
  282.         This attribute allows the builtin export hooks to perform wordwrap.
  283.         Zero means no wrap (default).
  284.  
  285.     SEE ALSO
  286.         MUIA_TextEditor_ExportHook, MUIA_TextEditor_WrapBorder
  287.  
  288. TextEditor.mcc/MUIA_TextEditor_FixedFont
  289.  
  290.     NAME
  291.         MUIA_TextEditor_FixedFont -- [I.G], BOOL
  292.  
  293.     FUNCTION
  294.         Set this if you would like a fixed font for the editor.
  295.  
  296. TextEditor.mcc/MUIA_TextEditor_Flow
  297.  
  298.     NAME
  299.         MUIA_TextEditor_Flow -- [.SG], UWORD
  300.  
  301.     SPECIAL INPUTS
  302.         MUIV_TextEditor_Flow_Left
  303.         MUIV_TextEditor_Flow_Right
  304.         MUIV_TextEditor_Flow_Center
  305.         MUIV_TextEditor_Flow_Justified (not yet implemented)
  306.  
  307.     FUNCTION
  308.         Set/get the current paragraphs alignment.
  309.         If an area is marked while you set this attribute, then the new
  310.         alignment will be set for the complete area.
  311.  
  312. TextEditor.mcc/MUIA_TextEditor_HasChanged
  313.  
  314.     NAME
  315.         MUIA_TextEditor_HasChanged -- [ISG], BOOL
  316.  
  317.     FUNCTION
  318.         This tag will show if the contents of the gadget has changed.
  319.         You can take notify on this tag, so that you can connect it with a
  320.         checkmark or textobject.
  321.         You should set this tag to FALSE whenever you export the contents of
  322.         the gadget or overwrite it with something new.
  323.  
  324.         Even though you have set up notification on this tag you should
  325.         still get() it before you kill the text, because this makes it
  326.         possible to do some advanced testing to see if the text has actually
  327.         been modified. E.g. by checking the undobuffer, comparing checksums
  328.         or by checking whether or not the textbuffer is empty (none of this
  329.         is currently done, but it may be in the future).
  330.  
  331.         The tag is currently not affected by:
  332.          MUIA_TextEditor_Contents, MUIM_TextEditor_ClearText
  333.          MUIM_TextEditor_Export, MUIM_TextEditor_Import
  334.  
  335.         But I'm open for comments :)
  336.  
  337. TextEditor.mcc/MUIA_TextEditor_ImportHook
  338.  
  339.     NAME
  340.         MUIA_TextEditor_ImportHook -- [IS.], struct Hook *
  341.  
  342.     SPECIAL INPUTS
  343.         MUIV_TextEditor_ImportHook_EMail
  344.         MUIV_TextEditor_ImportHook_MIME
  345.         MUIV_TextEditor_ImportHook_MIMEQuoted
  346.         MUIV_TextEditor_ImportHook_Plain (default)
  347.  
  348.     FUNCTION                                                
  349.         Since this gadget allows different text styles, you can supply an
  350.         importhook to parse the text correctly.
  351.  
  352.         The default importhook understands the following escape sequences:
  353.  
  354.          <ESC> + u      Set the soft style to underline.
  355.          <ESC> + b      Set the soft style to bold.
  356.          <ESC> + i      Set the soft style to italic.
  357.          <ESC> + n      Set the soft style back to normal.
  358.          <ESC> + h      Highlight the current line.
  359.          <ESC> + p[x]   Change to color x, where x is taken from the colormap.
  360.                         0 means normal. The color is reset for each new line.
  361.  
  362.              The following sequences are only valid at the beginning of a line.
  363.  
  364.          <ESC> + l      Left justify current and following lines.
  365.          <ESC> + r      Right justify current and following lines.
  366.          <ESC> + c      Center current and following lines.
  367.          <ESC> + [s:x]  Create a separator. x is a bit combination of flags:
  368.                          Placement (mutually exclusive):
  369.                            1 = Top
  370.                            2 = Middle
  371.                            4 = Bottom
  372.                          Cosmetical:
  373.                            8 = StrikeThru   - Draw separator ontop of text.
  374.                           16 = Thick        - Make separator extra thick.
  375.  
  376.  
  377.           MUIV_TextEditor_ImportHook_MIME:
  378.  
  379.         This builtin hook will convert quoted-printables (e.g. "=E5") to the
  380.         ASCII representation, and merge lines ending with a "=", it will
  381.         wordwrap the text (using the value set with
  382.         MUIA_TextEditor_ImportWrap), it will highlight all lines which start
  383.         with ">" it will make real *bold*, /italic/, _underline_ and
  384.         #colored#, and it will replace <sb> or <tsb> with a real separator
  385.         bar. It stops parsing when it reaches a NULL byte.
  386.  
  387.         The color used for #colored# text is colormap entry 6, which defaults
  388.         to MPEN_FILL. To override it, just supply a colormap with entry 6 set
  389.         to whatever color you would like.
  390.  
  391.  
  392.           MUIV_TextEditor_ImportHook_MIMEQuoted:
  393.  
  394.         Like the MIME importhook, but each line gets quoted and highlighted.
  395.  
  396.  
  397.           MUIV_TextEditor_ImportHook_EMail:
  398.  
  399.         Like the MIME importhook, but it doesn't convert quoted printables.
  400.  
  401.  
  402.         You can of course create your own importhook, there is an external
  403.         file which describes the procedure.
  404.  
  405.       *** PLEASE DON'T CREATE YOUR OWN HOOKS WHILE THE GADGET IS STILL BETA ***
  406.  
  407.     SEE ALSO
  408.         MUIA_TextEditor_ColorMap, MUIA_TextEditor_ExportHook
  409.         MUIA_TextEditor_ImportWrap
  410.  
  411.     EXAMPLE
  412.         /*   Here is how you can `easily' allow the
  413.          *   user to set the pen of #colored# text
  414.          */
  415.  
  416.            static LONG editor_cmap[1];
  417.  
  418.         set(editor, MUIA_TextEditor_ColorMap, editor_cmap-6);
  419.                                            /* This saves a little memory :) */
  420.  
  421.  
  422.         /* Subclass of TextEditor.mcc */
  423.  
  424.            switch(msg->MethodID)
  425.            {
  426.               case MUIM_Show:
  427.                  editor_cmap[0] = MUI_ObtainPen(muiRenderInfo(obj), spec, flags);
  428.                  break;
  429.  
  430.               case MUIM_Hide:
  431.                  MUI_ReleasePen(muiRenderInfo(obj), editor_cmap[0]);
  432.                  break;
  433.            }
  434.            ...
  435.  
  436. TextEditor.mcc/MUIA_TextEditor_ImportWrap
  437.  
  438.     NAME
  439.         MUIA_TextEditor_ImportWrap -- [ISG], ULONG
  440.  
  441.     FUNCTION
  442.         This is here to allow the builtin import hooks to perform wordwrap.
  443.         The builtin hooks accepts a value between 4 and 1024. Defaults to 1023.
  444.  
  445.     SEE ALSO
  446.         MUIA_TextEditor_ImportHook, MUIA_TextEditor_WrapBorder
  447.  
  448. TextEditor.mcc/MUIA_TextEditor_InsertMode
  449.  
  450.     NAME
  451.         MUIA_TextEditor_InsertMode -- [ISG], BOOL
  452.  
  453.     FUNCTION
  454.         Not yet implemented...
  455.  
  456. TextEditor.mcc/MUIA_TextEditor_InVirtualGroup
  457.  
  458.     NAME
  459.         MUIA_TextEditor_InVirtualGroup -- [I..], BOOL
  460.  
  461.     FUNCTION
  462.         Set this to TRUE when the gadget is inside a virtualgroup.
  463.         The reason is cosmetical. The pattern will be relative to the gadget
  464.         instead of the window, since the gadget can be "moved" around.
  465.  
  466. TextEditor.mcc/MUIA_TextEditor_Pen
  467.  
  468.     NAME
  469.         MUIA_TextEditor_Pen -- [.SG], UBYTE (do you need UWORD or ULONG?)
  470.  
  471.     FUNCTION
  472.         The value of this tag reflects the current render pen.
  473.  
  474.     SEE ALSO
  475.         MUIA_TextEditor_ColorMap
  476.  
  477. TextEditor.mcc/MUIA_TextEditor_Prop_DeltaFactor
  478.  
  479.     NAME
  480.         MUIA_TextEditor_Prop_DeltaFactor -- [..G], ULONG (OBSOLETE)
  481.  
  482.  
  483.     FUNCTION
  484.         This tag can tell you how high a line is. This is useful when you set
  485.         the increment value of a slider, as MUIA_TextEditor_Prop_Entries holds
  486.         the lines in pixels.
  487.  
  488.         You shouldn't use this. Instead use MUIA_TextEditor_Slider.
  489.  
  490.     EXAMPLE
  491.  
  492.         DoMethod(editorgad, MUIM_Notify,
  493.                   MUIA_TextEditor_Prop_DeltaFactor, MUIV_EveryTime,
  494.                   slider, 3, MUIM_Set, MUIA_Prop_DeltaFactor, MUIV_TriggerValue);
  495.  
  496.     SEE ALSO
  497.         MUIA_TextEditor_Prop_Visible, MUIA_TextEditor_Slider
  498.         MUIA_TextEditor_Prop_First, MUIA_TextEditor_Prop_Entries
  499.  
  500. TextEditor.mcc/MUIA_TextEditor_Prop_Entries
  501.  
  502.     NAME
  503.         MUIA_TextEditor_Prop_Entries -- [..G], ULONG (OBSOLETE)
  504.  
  505.  
  506.     FUNCTION
  507.         This value is the total number of lines in the editor.
  508.         If you want a slider attached to the gadget you should create a
  509.         notify on this attribute.
  510.  
  511.         You shouldn't use this. Instead use MUIA_TextEditor_Slider.
  512.  
  513.     EXAMPLE
  514.  
  515.         DoMethod(editorgad, MUIM_Notify,
  516.                   MUIA_TextEditor_Prop_Entries, MUIV_EveryTime,
  517.                   slider, 3, MUIM_Set, MUIA_Prop_Entries, MUIV_TriggerValue);
  518.  
  519.     SEE ALSO
  520.         MUIA_TextEditor_Prop_Visible, MUIA_TextEditor_Slider
  521.         MUIA_TextEditor_Prop_First, MUIA_TextEditor_Prop_DeltaFactor
  522.  
  523. TextEditor.mcc/MUIA_TextEditor_Prop_First
  524.  
  525.     NAME
  526.         MUIA_TextEditor_Prop_First -- [.SG], ULONG (OBSOLETE)
  527.  
  528.     FUNCTION
  529.         Get or set the first displayed line.
  530.         The purpose of this attribute is to allow connection between the
  531.         editorgadget and a scrollbar.
  532.  
  533.     EXAMPLE
  534.  
  535.         DoMethod(editor, MUIM_Notify,
  536.                   MUIA_TextEditor_Prop_First, MUIV_EveryTime,
  537.                   slider, 3, MUIM_Set, MUIA_Prop_First, MUIV_TriggerValue);
  538.         
  539.         DoMethod(slider, MUIM_Notify,
  540.                   MUIA_Prop_First, MUIV_EveryTime,
  541.                   editor, 3, MUIM_Set, MUIA_TextEditor_Prop_First, MUIV_TriggerValue);
  542.  
  543.     SEE ALSO
  544.         MUIA_TextEditor_Prop_Visible, MUIA_TextEditor_Slider
  545.         MUIA_TextEditor_Prop_Entries, MUIA_TextEditor_Prop_DeltaFactor
  546. TextEditor.mcc/MUIA_TextEditor_Prop_Visible
  547.  
  548.     NAME
  549.         MUIA_TextEditor_Prop_Visible -- [..G], ULONG (OBSOLETE)
  550.  
  551.     FUNCTION
  552.         This value is the number of lines that currently fits in the window.
  553.         If you want a slider attached to the gadget you should create a
  554.         notify on this attribute.
  555.  
  556.         You shouldn't use this. Instead use MUIA_TextEditor_Slider.
  557.  
  558.     EXAMPLE
  559.  
  560.         DoMethod(editorgad, MUIM_Notify,
  561.                   MUIA_TextEditor_Prop_Visible, MUIV_EveryTime,
  562.                   slider, 3, MUIM_Set, MUIA_Prop_Visible, MUIV_TriggerValue);
  563.  
  564.     SEE ALSO
  565.         MUIA_TextEditor_Prop_Entries, MUIA_TextEditor_Slider
  566.         MUIA_TextEditor_Prop_First, MUIA_TextEditor_Prop_DeltaFactor
  567.  
  568. TextEditor.mcc/MUIA_TextEditor_Quiet
  569.  
  570.     NAME
  571.         MUIA_TextEditor_Quiet -- [ISG], BOOL
  572.  
  573.     FUNCTION
  574.         If you need to insert a lot of text "line by line" you should
  575.         set this tag to TRUE before starting, and then back to FALSE when you
  576.         are done adding text.
  577.  
  578.     SEE ALSO
  579.         MUIM_TextEditor_InsertText
  580.  
  581. TextEditor.mcc/MUIA_TextEditor_ReadOnly
  582.  
  583.     NAME
  584.         MUIA_TextEditor_ReadOnly -- [ISG], BOOL
  585.  
  586.     FUNCTION
  587.         Setting this tag to TRUE will make the text ReadOnly.
  588.         This is very similar to the FloatText.mui, except that this gadget
  589.         offers blocking.
  590.  
  591.         In ReadOnly-mode there will be:
  592.         No cursor (but a normal TAB-frame).
  593.         TAB will activate the next gadget (instead of alt TAB).
  594.         The frame will be set to a ReadListFrame. (may change).
  595.         There is no ARexx support, except "Copy".
  596.  
  597.         The MUIA_TextEditor_StyleXXX tags are still useable.
  598.  
  599. TextEditor.mcc/MUIA_TextEditor_RedoAvailable
  600.  
  601.     NAME
  602.         MUIA_TextEditor_RedoAvailable -- [..G], BOOL
  603.  
  604.     FUNCTION
  605.         This tag is set to TRUE when the user is able to redo his action(s)
  606.         (normally after an undo).
  607.         You can create a notify on this tag and let your redo button be
  608.         ghosted when there is nothing to redo.
  609.  
  610.     SEE ALSO
  611.         MUIA_TextEditor_UndoAvailable
  612.  
  613. TextEditor.mcc/MUIA_TextEditor_Rows
  614.  
  615.     NAME
  616.         MUIA_TextEditor_Rows -- [I..], ULONG
  617.  
  618.     FUNCTION
  619.         Set the desired height in lines.
  620.  
  621.     SEE ALSO
  622.         MUIA_TextEditor_Columns
  623.  
  624. TextEditor.mcc/MUIA_TextEditor_Separator
  625.  
  626.     NAME
  627.         MUIA_TextEditor_Separator -- [.SG], UWORD *
  628.  
  629.     FUNCTION
  630.         Each line can act as a separator.
  631.  
  632.         A separator can be either thick or thin. It can be rendered over the
  633.         lines contents, or only on both sides of the contents. The placement
  634.         can be either top, middle or bottom.
  635.  
  636.         This tag reflects the current line. See mui/TextEditor_mcc.h for
  637.         definitions.
  638.  
  639.     EXAMPLE
  640.         /* A simple way to let the user insert a separator is to create a
  641.            button or menuitem with the following notify.
  642.  
  643.                   Note: The ImportHook should be set to
  644.                         MUIV_TextEditor_ImportHook_Plain
  645.                         when the notify is executed.
  646.         */
  647.  
  648.            DoMethod(button, MUIM_Notify,
  649.                       MUIA_Pressed, FALSE,
  650.                       editor, 2, MUIM_TextEditor_InsertText, "\n\33c\33[s:2]\n");
  651.  
  652. TextEditor.mcc/MUIA_TextEditor_Slider
  653.  
  654.     NAME
  655.         MUIA_TextEditor_Slider -- [IS.], Object *
  656.  
  657.     FUNCTION
  658.         You should give a pointer to a propobject to allow connection between
  659.         the editorgadget and the propobject.
  660.  
  661.         The reason why you shouldn't set up notification yourself is that the
  662.         gadget needs to set two undocumented tags for the propobject.
  663.  
  664.     SEE ALSO
  665.         MUIA_TextEditor_Prop_DeltaFactor, MUIA_TextEditor_Prop_Entries
  666.         MUIA_TextEditor_Prop_First, MUIA_TextEditor_Prop_Visible
  667.  
  668. TextEditor.mcc/MUIA_TextEditor_StyleBold
  669.  
  670.     NAME
  671.         MUIA_TextEditor_StyleBold -- [.SG], BOOL
  672.  
  673.     FUNCTION
  674.         This tag shows whether the cursor or block is over bolded text or not.
  675.         You can set this tag to TRUE or FALSE if you want the style changed.
  676.  
  677.     EXAMPLE
  678.  
  679.         DoMethod(boldgad, MUIM_Notify,
  680.                   MUIA_Selected, MUIV_EveryTime,
  681.                   editor, 3, MUIM_NoNotifySet, MUIA_TextEditor_StyleBold, MUIV_TriggerValue);
  682.  
  683.         DoMethod(editor, MUIM_Notify,
  684.                   MUIA_TextEditor_StyleBold, MUIV_EveryTime,
  685.                   boldgad, 3, MUIM_NoNotifySet, MUIA_Selected, MUIV_TriggerValue);
  686.  
  687.     SEE ALSO
  688.         MUIA_TextEditor_StyleItalic, MUIA_TextEditor_StyleUnderline
  689.  
  690. TextEditor.mcc/MUIA_TextEditor_StyleItalic
  691.  
  692.     NAME
  693.         MUIA_TextEditor_StyleItalic -- [.SG], BOOL
  694.  
  695.     FUNCTION
  696.         This tag shows whether the cursor or block is over text in italics or
  697.         not.
  698.         You can set this tag to TRUE or FALSE if you want the style changed.
  699.  
  700.     EXAMPLE
  701.         see MUIA_TextEditor_StyleBold
  702.  
  703.     SEE ALSO
  704.         MUIA_TextEditor_StyleBold, MUIA_TextEditor_StyleUnderline
  705.  
  706. TextEditor.mcc/MUIA_TextEditor_StyleUnderline
  707.  
  708.     NAME
  709.         MUIA_TextEditor_StyleUnderline -- [.SG], BOOL
  710.  
  711.     FUNCTION
  712.         This tag shows whether the cursor or block is over underlined text or
  713.         not.
  714.         You can set this tag to TRUE or FALSE if you want the style changed.
  715.  
  716.     EXAMPLE
  717.         see MUIA_TextEditor_StyleBold
  718.  
  719.     SEE ALSO
  720.         MUIA_TextEditor_StyleBold, MUIA_TextEditor_StyleItalic
  721.  
  722. TextEditor.mcc/MUIA_TextEditor_TypeAndSpell
  723.  
  724.     NAME
  725.         MUIA_TextEditor_TypeAndSpell -- [.SG], BOOL
  726.  
  727.     FUNCTION
  728.         This is a shortcut to the Type'n'spell switch that the user can set
  729.         in the .mcp module.
  730.         Never integrate this into the settings of your preferences.
  731.  
  732.     EXAMPLE
  733.  
  734.         DoMethod(editor, MUIM_Notify,
  735.                   MUIA_TextEditor_TypeAndSpell, MUIV_EveryTime,
  736.                   toggle, 3, MUIM_Set, MUIA_Selected, MUIV_TriggerValue);
  737.         DoMethod(toggle, MUIM_Notify,
  738.                   MUIA_Selected, MUIV_EveryTime,
  739.                   editor, 3, MUIM_Set, MUIA_TextEditor_TypeAndSpell, MUIV_TriggerValue);
  740.  
  741. TextEditor.mcc/MUIA_TextEditor_UndoAvailable
  742.  
  743.     NAME
  744.         MUIA_TextEditor_UndoAvailable -- [..G], BOOL
  745.  
  746.     FUNCTION
  747.         This tag is set to TRUE when the user is able to undo his action(s)
  748.         You can create a notify on this tag and let your undo button be
  749.         ghosted when there is nothing to undo.
  750.  
  751.     SEE ALSO
  752.         MUIA_TextEditor_RedoAvailable
  753.  
  754. TextEditor.mcc/MUIA_TextEditor_WrapBorder
  755.  
  756.     NAME
  757.         MUIA_TextEditor_WrapBorder -- [ISG], ULONG
  758.  
  759.     FUNCTION
  760.         The gadget will insert a linebreak infront of the current word, if
  761.         the cursor comes beyond the column given here.
  762.  
  763.         Please remember that the gadget does realtime wordwrap which is much
  764.         better! This tag is for special cases!!!
  765.  
  766.     SEE ALSO
  767.         MUIA_TextEditor_ExportWrap, MUIA_TextEditor_ImportWrap
  768.  
  769. TextEditor.mcc/MUIM_TextEditor_ARexxCmd
  770.  
  771.     NAME
  772.         MUIM_TextEditor_ARexxCmd
  773.  
  774.     SYNOPSIS
  775.         DoMethod(obj, MUIM_TextEditor_ARexxCmd, STRPTR command);
  776.  
  777.     FUNCTION
  778.         If the user spends much of his time in the TextEditor gadget, then he
  779.         may want to have the gadgets functions integrated in the programs
  780.         arexx command set.
  781.         This can easily be done with this method, simply call it with the
  782.         command that the user has executed. If the method returns something
  783.         else than FALSE, then the command has been used by the gadget. If it
  784.         does return FALSE, then you should parse the command yourself.
  785.  
  786.         This method can also be used by you, to communicate with the gadget.
  787.  
  788.         The following commands are currently supported:
  789.  
  790.            CLEAR
  791.            CUT
  792.            COPY
  793.            PASTE
  794.            ERASE
  795.            GOTOLINE       Template: /N/A
  796.            GOTOCOLUMN     Template: /N/A
  797.            CURSOR         Template: Up/S,Down/S,Left/S,Right/S
  798.            LINE           Template: /N/A
  799.            COLUMN         Template: /N/A
  800.            NEXT           Template: Word/S,Sentence/S,Paragraph/S,Page/S
  801.            PREVIOUS       Template: Word/S,Sentence/S,Paragraph/S,Page/S
  802.            POSITION       Template: SOF/S,EOF/S,SOL/S,EOL/S,SOW/S,EOW/S,SOV/S,EOV/S
  803.            SETBOOKMARK    Template: /N/A
  804.            GOTOBOOKMARK   Template: /N/A
  805.            TEXT           Template: /F
  806.            UNDO
  807.            REDO
  808.            GETLINE
  809.            GETCURSOR      Template: Line/S,Column/S
  810.            MARK           Template: On/S,Off/S
  811.            DELETE
  812.            BACKSPACE
  813.  
  814.     RESULT
  815.         The method will return FALSE if it couldn't use the command.
  816.         It will return TRUE if it did use the command, but the command didn't
  817.         give a result. It will return a pointer (STRPTR) when the command
  818.         gives a result, you should return this pointer to the user
  819.         (CreateArgString() it, and set it as the result, in the rexx message),
  820.         you must free the result yourself with FreeVec()
  821.  
  822. TextEditor.mcc/MUIM_TextEditor_BlockInfo
  823.  
  824.     NAME
  825.         MUIM_TextEditor_BlockInfo
  826.  
  827.     SYNOPSIS
  828.         DoMethod(obj, MUIM_TextEditor_BlockInfo, ULONG *startx, ULONG *starty,
  829.                       ULONG *stopx, ULONG *stopy);
  830.  
  831.     FUNCTION
  832.         This method fills out the ULONG pointers with the start and stop
  833.         position of the currently marked block.
  834.  
  835.     RESULT
  836.         The method will return FALSE if no text have been marked.
  837.  
  838.     EXAMPLE
  839.         ULONG x1, y1, x2, y2;
  840.         if(DoMethod(obj, MUIM_TextEditor_BlockInfo, &x1, &y1, &x2, &y2))
  841.         {
  842.            ...
  843.         }
  844.  
  845. TextEditor.mcc/MUIM_TextEditor_ClearText
  846.  
  847.     NAME
  848.         MUIM_TextEditor_ClearText
  849.  
  850.     SYNOPSIS
  851.         DoMethod(obj, MUIM_TextEditor_ClearText);
  852.  
  853.     FUNCTION
  854.         This will clear all text in the gadget.
  855.  
  856. TextEditor.mcc/MUIM_TextEditor_ExportBlock
  857.  
  858.     NAME
  859.         MUIM_TextEditor_ExportBlock
  860.  
  861.     SYNOPSIS
  862.         DoMethod(obj, MUIM_TextEditor_ExportBlock);
  863.  
  864.     FUNCTION
  865.         Not yet implemented...
  866.  
  867.     RESULT
  868.         
  869.  
  870.     SEE ALSO
  871.         MUIM_TextEditor_InsertText, MUIM_TextEditor_ExportText
  872.  
  873. TextEditor.mcc/MUIM_TextEditor_ExportText
  874.  
  875.     NAME
  876.         MUIM_TextEditor_ExportText
  877.  
  878.     SYNOPSIS
  879.         DoMethod(obj, MUIM_TextEditor_ExportText);
  880.  
  881.     FUNCTION
  882.         This will export the text using the current exporthook.
  883.  
  884.     RESULT
  885.         This depends on the exporthook. The builtin hooks will return a
  886.         pointer to a null terminated buffer containing all the text. You must
  887.         free this buffer with FreeVec() when you are done using it.
  888.  
  889.     SEE ALSO
  890.         MUIM_TextEditor_InsertText, MUIM_TextEditor_ExportBlock
  891.  
  892. TextEditor.mcc/MUIM_TextEditor_HandleError
  893.  
  894.     NAME
  895.         MUIM_TextEditor_HandleError
  896.  
  897.     SYNOPSIS
  898.         DoMethod(obj, MUIM_TextEditor_HandleError, ULONG errorcode);
  899.  
  900.     FUNCTION
  901.         This method is not supported by the editorgadget itself. The idea is
  902.         that you should subclass the gadget and implement your own error
  903.         handler. The handler should just bring up a requester or write the
  904.         error in a status line.
  905.  
  906.         The different errors are:
  907.  
  908.         Error_ClipboardIsEmpty:        The clipboard doesn't hold any data.
  909.         Error_ClipboardIsNotFTXT:      The clipboard doesn't hold any text.
  910.         Error_MacroBufferIsFull:       Not yet used.
  911.         Error_MemoryAllocationFailed:  Not yet used.
  912.         Error_NoAreaMarked:            The user has tried to copy or cut, but
  913.                                        hasn't marked anything.
  914.         Error_NoMacroDefined:          Not yet used.
  915.         Error_NothingToRedo:           There is nothing more to redo.
  916.         Error_NothingToUndo:           There is nothing more to undo.
  917.         Error_NotEnoughUndoMem:        The user has erased a block that is too
  918.                                        big to be saved. This results in a lost
  919.                                        undobuffer.
  920.         Error_StringNotFound:          Not yet used.
  921.  
  922.     RESULT
  923.         NONE
  924.  
  925. TextEditor.mcc/MUIM_TextEditor_InsertText
  926.  
  927.     NAME
  928.         MUIM_TextEditor_InsertText
  929.  
  930.     SYNOPSIS
  931.         DoMethod(obj, MUIM_TextEditor_InsertText, STRPTR text, LONG pos);
  932.  
  933.     FUNCTION
  934.         This will insert the given text using the current importhook.
  935.         The position of the inserted text can be:
  936.  
  937.           MUIV_TextEditor_InsertText_Cursor
  938.           MUIV_TextEditor_InsertText_Top
  939.           MUIV_TextEditor_InsertText_Bottom
  940.  
  941.     RESULT
  942.         NONE
  943.  
  944.     SEE ALSO
  945.         MUIM_TextEditor_ExportText
  946.  
  947. TextEditor.mcc/MUIM_TextEditor_MacroBegin
  948.  
  949.     NAME
  950.         MUIM_TextEditor_MacroBegin
  951.  
  952.     SYNOPSIS
  953.         DoMethod(obj, MUIM_TextEditor_MacroBegin);
  954.  
  955.     FUNCTION
  956.         Not yet implemented...
  957.  
  958.     RESULT
  959.  
  960.  
  961.     SEE ALSO
  962.         MUIM_TextEditor_MacroEnd, MUIM_TextEditor_MacroExecute
  963.  
  964. TextEditor.mcc/MUIM_TextEditor_MacroEnd
  965.  
  966.     NAME
  967.         MUIM_TextEditor_MacroEnd
  968.  
  969.     SYNOPSIS
  970.         DoMethod(obj, MUIM_TextEditor_MacroEnd);
  971.  
  972.     FUNCTION
  973.         Not yet implemented...
  974.  
  975.     RESULT
  976.  
  977.  
  978.     SEE ALSO
  979.         MUIM_TextEditor_MacroBegin, MUIM_TextEditor_MacroExecute
  980.  
  981. TextEditor.mcc/MUIM_TextEditor_MacroExecute
  982.  
  983.     NAME
  984.         MUIM_TextEditor_MacroExecute
  985.  
  986.     SYNOPSIS
  987.         DoMethod(obj, MUIM_TextEditor_MacroExecute);
  988.  
  989.     FUNCTION
  990.         Not yet implemented...
  991.  
  992.     RESULT
  993.  
  994.  
  995.     SEE ALSO
  996.         MUIM_TextEditor_MacroBegin, MUIM_TextEditor_MacroEnd
  997.  
  998. TextEditor.mcc/MUIM_TextEditor_MarkText
  999.  
  1000.     NAME
  1001.         MUIM_TextEditor_MarkText
  1002.  
  1003.     SYNOPSIS
  1004.         DoMethod(obj, MUIM_TextEditor_MarkText, ULONG start_x, ULONG start_y, ULONG stop_x, ULONG stop_y);
  1005.  
  1006.     FUNCTION
  1007.         This method will mark the given area.
  1008.  
  1009.     RESULT
  1010.         Not defined.
  1011.  
  1012. TextEditor.mcc/MUIM_TextEditor_Replace
  1013.  
  1014.     NAME
  1015.         MUIM_TextEditor_Replace
  1016.  
  1017.     SYNOPSIS
  1018.         DoMethod(obj, MUIM_TextEditor_Replace, STRPTR newstring, ULONG flags);
  1019.  
  1020.     FUNCTION
  1021.         This method replace the marked area with the string given.
  1022.         Currently no flags are defined, so pass 0L for now.
  1023.  
  1024.     RESULT
  1025.         TRUE if the string was replaced. A failure is likely to be because
  1026.         nothing was marked when this method was invoked.
  1027.  
  1028. TextEditor.mcc/MUIM_TextEditor_Search
  1029.  
  1030.     NAME
  1031.         MUIM_TextEditor_Search
  1032.  
  1033.     SYNOPSIS
  1034.         DoMethod(obj, MUIM_TextEditor_Search, STRPTR string, ULONG flags);
  1035.  
  1036.     FUNCTION
  1037.         Searches the text for the given string. The string mustn't exceed 120
  1038.         characters.
  1039.  
  1040.         Flags can be:
  1041.  
  1042.          MUIF_TextEditor_Search_FromTop
  1043.           Normally the search starts at the cursor position - this flag will
  1044.           make it start at the beginning of the text.
  1045.  
  1046.          MUIF_TextEditor_Search_CaseSensitive
  1047.           If you want the search to be case sensitive, then set this flag.
  1048.  
  1049.     RESULT
  1050.         TRUE if the string was found, otherwise FALSE.
  1051.  
  1052.     NOTE
  1053.         If the string was found then it's left marked. So in case you want to
  1054.         replace it, simply clear the marked string and insert the new one.
  1055.  
  1056.