3 TextEditor.mcc/TextEditor.mcc
4 TextEditor.mcc/MUIA_TextEditor_AreaMarked
5 TextEditor.mcc/MUIA_TextEditor_AutoClip
6 TextEditor.mcc/MUIA_TextEditor_ColorMap
7 TextEditor.mcc/MUIA_TextEditor_Columns
8 TextEditor.mcc/MUIA_TextEditor_Contents
9 TextEditor.mcc/MUIA_TextEditor_CursorPosition
10 TextEditor.mcc/MUIA_TextEditor_CursorX
11 TextEditor.mcc/MUIA_TextEditor_CursorY
12 TextEditor.mcc/MUIA_TextEditor_DoubleClickHook
13 TextEditor.mcc/MUIA_TextEditor_ExportHook
14 TextEditor.mcc/MUIA_TextEditor_ExportWrap
15 TextEditor.mcc/MUIA_TextEditor_FixedFont
16 TextEditor.mcc/MUIA_TextEditor_Flow
17 TextEditor.mcc/MUIA_TextEditor_HasChanged
18 TextEditor.mcc/MUIA_TextEditor_ImportHook
19 TextEditor.mcc/MUIA_TextEditor_ImportWrap
20 TextEditor.mcc/MUIA_TextEditor_InsertMode (not yet implemented...)
21 TextEditor.mcc/MUIA_TextEditor_InVirtualGroup
22 TextEditor.mcc/MUIA_TextEditor_Pen
23 TextEditor.mcc/MUIA_TextEditor_Prop_DeltaFactor
24 TextEditor.mcc/MUIA_TextEditor_Prop_Entries
25 TextEditor.mcc/MUIA_TextEditor_Prop_First
26 TextEditor.mcc/MUIA_TextEditor_Prop_Visible
27 TextEditor.mcc/MUIA_TextEditor_Quiet
28 TextEditor.mcc/MUIA_TextEditor_ReadOnly
29 TextEditor.mcc/MUIA_TextEditor_RedoAvailable
30 TextEditor.mcc/MUIA_TextEditor_Rows
31 TextEditor.mcc/MUIA_TextEditor_Separator
32 TextEditor.mcc/MUIA_TextEditor_Slider
33 TextEditor.mcc/MUIA_TextEditor_StyleBold
34 TextEditor.mcc/MUIA_TextEditor_StyleItalic
35 TextEditor.mcc/MUIA_TextEditor_StyleUnderline
36 TextEditor.mcc/MUIA_TextEditor_TypeAndSpell
37 TextEditor.mcc/MUIA_TextEditor_UndoAvailable
38 TextEditor.mcc/MUIA_TextEditor_WrapBorder
39 TextEditor.mcc/MUIM_TextEditor_ARexxCmd
40 TextEditor.mcc/MUIM_TextEditor_BlockInfo
41 TextEditor.mcc/MUIM_TextEditor_ClearText
42 TextEditor.mcc/MUIM_TextEditor_ExportBlock (not yet implemented...)
43 TextEditor.mcc/MUIM_TextEditor_ExportText
44 TextEditor.mcc/MUIM_TextEditor_HandleError
45 TextEditor.mcc/MUIM_TextEditor_InsertText
46 TextEditor.mcc/MUIM_TextEditor_MacroBegin (not yet implemented...)
47 TextEditor.mcc/MUIM_TextEditor_MacroEnd (not yet implemented...)
48 TextEditor.mcc/MUIM_TextEditor_MacroExecute (not yet implemented...)
49 TextEditor.mcc/MUIM_TextEditor_MarkText
50 TextEditor.mcc/MUIM_TextEditor_Replace
51 TextEditor.mcc/MUIM_TextEditor_Search
52 \fTextEditor.mcc/TextEditor.mcc
54 TextEditor.mcc is a multiline string gadget which holds most of the functions
55 of a normal text editor.
57 The gadget was originally written in 1997, and is Copyright (C) 1997-2000
58 by Allan Odgaard. As of version 15.10, released in April 2005, the gadget
59 is maintained and Copyright (C) 2005 by the TextEditor.mcc Open Source team.
61 \fTextEditor.mcc/MUIA_TextEditor_AreaMarked
64 MUIA_TextEditor_AreaMarked -- [..G], BOOL
67 This tag will be set to TRUE when text is marked, and back to
68 FALSE when nothing is marked. You can create a notify event
69 with this tag and let your cut/copy buttons become ghosted
70 when nothing is marked.
72 \fTextEditor.mcc/MUIA_TextEditor_AutoClip
75 MUIA_TextEditor_AutoClip -- [ISG], BOOL
78 When the gadget is in read only mode and the user marks some text,
79 then it will be automatically copied to the clipboard. With this
80 tag you can disable that behaviour, but think twice, because the
81 configured 'copy' key (which the user normally uses to copy text)
82 will only function when the gadget is active (or default) which
83 it won't automatically become in read only mode (when clicked).
85 \fTextEditor.mcc/MUIA_TextEditor_ColorMap
88 MUIA_TextEditor_ColorMap -- [IS.], LONG *
91 This is a map of allocated colors, which corresponds to the pen number
92 you set with MUIA_TextEditor_Pen. By default the map looks like this:
94 0 = Normal (user configured text/highlight color)
109 If you supply your own colormap, then pen value 0 will still be
110 "Normal", i.e. the first entry in your colormap has pen value 1.
111 This may seem a bit illogical, suggest an alternative if you want!
113 You are allowed to dynamically change the colormap; however, if you
114 change an entry which is on-screen, then it won't have any immediate
115 effect. The idea is that you should e.g. supply a colormap with 16
116 unused LONGs, allow the user to select a custom color, allocate that
117 color and store the screen pen value into the colormap. Now you can
118 use that entry as argument for MUIA_TextEditor_Pen.
120 Bear in mind that your application may change screen, so the best
121 place to allocate/free colors is in the MUIM_Show and MUIM_Hide
122 methods of the editor gadget. An example of this can be found in
126 /* Create a cycle gadget which allows the user
127 * to mark his text with red, green and blue.
130 static LONG editor_cmap[3];
131 UBYTE *cycle_entries[] =
133 "Normal", "Red", "Green", "Blue", NULL
138 MUIA_Cycle_Entries, cycle_entries,
141 editor = TextEditorObject,
142 MUIA_TextEditor_ColorMap, editor_cmap,
147 DoMethod(cycle, MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime, editor, 3, MUIM_Set, MUIA_TextEditor_Pen, MUIV_TriggerValue);
148 DoMethod(editor, MUIM_Notify, MUIA_TextEditor_Pen, MUIV_EveryTime, cycle, 3, MUIM_Set, MUIA_Cycle_Active, MUIV_TriggerValue);
150 /* Subclass of TextEditor.mcc */
152 switch(msg->MethodID)
155 editor_cmap[0] = ObtainBestPenA(cm, 0xffffffff, 0, 0, NULL);
156 editor_cmap[1] = ObtainBestPenA(cm, 0, 0xffffffff, 0, NULL);
157 editor_cmap[2] = ObtainBestPenA(cm, 0, 0, 0xffffffff, NULL);
161 ReleasePen(cm, editor_cmap[0]);
162 ReleasePen(cm, editor_cmap[1]);
163 ReleasePen(cm, editor_cmap[2]);
172 \fTextEditor.mcc/MUIA_TextEditor_Columns
175 MUIA_TextEditor_Columns -- [I..], ULONG
178 Set the desired width, in characters.
183 \fTextEditor.mcc/MUIA_TextEditor_Contents
186 MUIA_TextEditor_Contents -- [IS.], APTR
189 Set the contents of this gadget. This should normally be a pointer to
190 a text buffer, but if you have supplied your own import hook, then you
191 can set this to anything you like, e.g. a filehandle.
194 MUIA_TextEditor_ImportHook, MUIM_TextEditor_InsertText
196 \fTextEditor.mcc/MUIA_TextEditor_CursorPosition
199 MUIA_TextEditor_CursorPosition -- [..G], struct Rectangle *
202 If you need to open a window or similar, and want it to match the
203 position and/or dimensions of the cursor, then you can use this
204 tag to obtain the rectangle that the cursor is occupying.
207 struct Rectangle *crsr;
208 if(GetAttr(MUIA_TextEditor_CursorPosition, obj, &rect))
209 printf("Cursor at (%ldx%ld)\n", crsr->MinX, crsr->MinY);
212 The values are relative to the top left corner of the window, not the
215 You can't take notify on this tag.
218 MUIA_TextEditor_CursorX, MUIA_TextEditor_CursorY
220 \fTextEditor.mcc/MUIA_TextEditor_CursorX
223 MUIA_TextEditor_CursorX -- [ISG], ULONG
226 You can get or set the cursor's X position with this tag.
227 The first character on a line has position 0.
228 The position is not affected by the gadget's `autowrap' feature.
229 If you set a value higher than the length of the current line, then
230 it will be automatically truncated.
233 MUIA_TextEditor_CursorY
235 \fTextEditor.mcc/MUIA_TextEditor_CursorY
238 MUIA_TextEditor_CursorY -- [ISG], ULONG
241 You can get or set the cursor's Y position with this tag.
242 The first line has position 0.
243 The position is not affected by the gadget's `autowrap' feature.
244 If you set a value higher than the number of lines, then it will
245 be automatically truncated.
248 MUIA_TextEditor_CursorX
250 \fTextEditor.mcc/MUIA_TextEditor_DoubleClickHook
253 MUIA_TextEditor_DoubleClickHook -- [IS.], struct Hook *
256 If you use the gadget in read only mode, you may want a special
257 action to take place when the user double clicks certain words.
258 For example, an e-mail or news client using this gadget to show
259 mails might allow the user to click on an URL to lookup the link.
261 The hook will be called with A1 pointing to a ClickMessage, and A0
262 will point to the hook itself. Your hook should return TRUE if it
263 wants to stop the editor from blocking.
266 /* This hook will test if the user double clicked an HTTP address */
268 BOOL URLHookCode (register __a1 struct ClickMessage *clickmsg)
270 UWORD pos = clickmsg->ClickPosition;
272 while(pos && *(clickmsg->LineContents+pos-1) != ' ' && *(clickmsg->LineContents+pos-1) != '<')
277 if(strncmp(clickmsg->LineContents+pos, "http:", 5))
281 LookupURL(clickmsg->LineContents+pos);
286 MUIA_TextEditor_ReadOnly, mui/TextEditor_mcc.h
288 \fTextEditor.mcc/MUIA_TextEditor_ExportHook
291 MUIA_TextEditor_ExportHook -- [IS.], struct Hook *
294 MUIV_TextEditor_ExportHook_EMail
295 MUIV_TextEditor_ExportHook_Plain (default)
298 The EMail export hook will convert a bold word to *bold*, italic
299 words to /italic/ and underlined words to _underline_.
300 It also export separators such as <sb> and <tsb>.
302 See MUIA_TextEditor_ImportHook for more information.
305 MUIA_TextEditor_ExportWrap, MUIA_TextEditor_ImportHook
306 MUIM_TextEditor_ExportText
308 \fTextEditor.mcc/MUIA_TextEditor_ExportWrap
311 MUIA_TextEditor_ExportWrap -- [ISG], ULONG
314 This attribute allows the built-in export hooks to perform wordwrap.
315 Zero means no wrap (default value).
318 MUIA_TextEditor_ExportHook, MUIA_TextEditor_WrapBorder
320 \fTextEditor.mcc/MUIA_TextEditor_FixedFont
323 MUIA_TextEditor_FixedFont -- [I.G], BOOL
326 Set this if you would like the editor to use a fixed width font.
328 \fTextEditor.mcc/MUIA_TextEditor_Flow
331 MUIA_TextEditor_Flow -- [.SG], UWORD
334 MUIV_TextEditor_Flow_Left
335 MUIV_TextEditor_Flow_Right
336 MUIV_TextEditor_Flow_Center
337 MUIV_TextEditor_Flow_Justified (not yet implemented)
340 Set/get the current paragraph's alignment.
342 If an area is marked while you set this attribute, then the new
343 alignment will be set for the complete area.
345 \fTextEditor.mcc/MUIA_TextEditor_HasChanged
348 MUIA_TextEditor_HasChanged -- [ISG], BOOL
351 This tag will show if the contents of the gadget have changed.
352 You can take notify on this tag, so that you can connect it with
353 a checkmark or text object.
355 You should set this tag to FALSE whenever you export the contents
356 of the gadget or overwrite them with something new.
358 Even if you have set up notification on this tag, you should
359 still get() it before you kill the text, because this makes it
360 possible to do some advanced testing to see if the text has
361 actually been modified, e.g. by checking the undo buffer, comparing
362 checksums or checking whether or not the text buffer is empty
363 (none of this is currently done, but it may be in the future).
365 The tag is currently not affected by:
366 MUIA_TextEditor_Contents, MUIM_TextEditor_ClearText
367 MUIM_TextEditor_Export, MUIM_TextEditor_Import
369 ... but comments are welcome :)
371 \fTextEditor.mcc/MUIA_TextEditor_ImportHook
374 MUIA_TextEditor_ImportHook -- [IS.], struct Hook *
377 MUIV_TextEditor_ImportHook_EMail
378 MUIV_TextEditor_ImportHook_MIME
379 MUIV_TextEditor_ImportHook_MIMEQuoted
380 MUIV_TextEditor_ImportHook_Plain (default)
383 Since this gadget allows different text styles, you can supply an
384 import hook to parse the text correctly.
386 The default import hook understands the following escape sequences.
387 They may appear at any position within the line:
389 <ESC> + u Set the soft style to underline.
390 <ESC> + b Set the soft style to bold.
391 <ESC> + i Set the soft style to italic.
392 <ESC> + n Set the soft style back to normal.
393 <ESC> + h Highlight the current line.
394 <ESC> + p[x] Change to color x, where x is taken from the colormap.
395 0 means normal. The color is reset for each new line.
397 The following sequences are only valid at the beginning of a line.
398 If they are placed elsewhere, the result is undefined (they might
401 <ESC> + l Left justify current and following lines.
402 <ESC> + r Right justify current and following lines.
403 <ESC> + c Center current and following lines.
404 <ESC> + [s:x] Create a separator. x is a bit combination of flags:
405 Placement (mutually exclusive):
410 8 = StrikeThru - Draw separator on top of text.
411 16 = Thick - Make separator extra thick.
414 MUIV_TextEditor_ImportHook_MIME:
416 This built-in hook will convert quoted-printables (e.g. "=E5") to
417 the ASCII representation, merge lines ending with a "=", wordwrap
418 the text (using the value set with MUIA_TextEditor_ImportWrap),
419 highlight all lines that start with ">", make real *bold*, /italic/,
420 _underline_ and #colored# text, and replace <sb> or <tsb> with a real
421 separator bar. It will stop parsing upon reaching a NULL byte.
423 The color used for #colored# text is colormap entry 6, which defaults
424 to MPEN_FILL. To override it, just supply a colormap with entry 6
425 set to whatever color you would like.
428 MUIV_TextEditor_ImportHook_MIMEQuoted:
430 Like the MIME import hook, but each line gets quoted and highlighted.
433 MUIV_TextEditor_ImportHook_EMail:
435 Like the MIME import hook, but it doesn't convert quoted printables.
438 You can of course create your own import hook - there is an external
439 file which describes the procedure.
441 *** PLEASE DON'T CREATE YOUR OWN HOOKS WHILE THE GADGET IS STILL BETA ***
444 MUIA_TextEditor_ColorMap, MUIA_TextEditor_ExportHook
445 MUIA_TextEditor_ImportWrap
448 /* Here is how you can `easily' allow the
449 * user to set the pen of #colored# text
452 static LONG editor_cmap[1];
454 set(editor, MUIA_TextEditor_ColorMap, editor_cmap-6);
455 /* This saves a little memory :) */
458 /* Subclass of TextEditor.mcc */
460 switch(msg->MethodID)
463 editor_cmap[0] = MUI_ObtainPen(muiRenderInfo(obj), spec, flags);
467 MUI_ReleasePen(muiRenderInfo(obj), editor_cmap[0]);
472 \fTextEditor.mcc/MUIA_TextEditor_ImportWrap
475 MUIA_TextEditor_ImportWrap -- [ISG], ULONG
478 This is here to allow the built-in import hooks to perform wordwrap.
479 The built-in hooks accept a value between 4 and 1024. Defaults to
483 MUIA_TextEditor_ImportHook, MUIA_TextEditor_WrapBorder
485 \fTextEditor.mcc/MUIA_TextEditor_InsertMode
488 MUIA_TextEditor_InsertMode -- [ISG], BOOL
491 Not yet implemented...
493 \fTextEditor.mcc/MUIA_TextEditor_InVirtualGroup
496 MUIA_TextEditor_InVirtualGroup -- [I..], BOOL
499 Set this to TRUE when the gadget is inside a virtual group.
500 The reason is cosmetical - the pattern will be relative to the
501 gadget instead of the window, since the gadget can be "moved" around.
503 \fTextEditor.mcc/MUIA_TextEditor_Pen
506 MUIA_TextEditor_Pen -- [.SG], UBYTE (do you need UWORD or ULONG?)
509 The value of this tag reflects the current render pen.
512 MUIA_TextEditor_ColorMap
514 \fTextEditor.mcc/MUIA_TextEditor_Prop_DeltaFactor
517 MUIA_TextEditor_Prop_DeltaFactor -- [..G], ULONG (OBSOLETE)
521 This tag can tell you how high a line is. This is useful when you set
522 the increment value of a slider, as MUIA_TextEditor_Prop_Entries holds
525 You shouldn't use this. Instead, use MUIA_TextEditor_Slider.
528 DoMethod(editorgad, MUIM_Notify,
529 MUIA_TextEditor_Prop_DeltaFactor, MUIV_EveryTime,
530 slider, 3, MUIM_Set, MUIA_Prop_DeltaFactor, MUIV_TriggerValue);
533 MUIA_TextEditor_Prop_Visible, MUIA_TextEditor_Slider
534 MUIA_TextEditor_Prop_First, MUIA_TextEditor_Prop_Entries
536 \fTextEditor.mcc/MUIA_TextEditor_Prop_Entries
539 MUIA_TextEditor_Prop_Entries -- [..G], ULONG (OBSOLETE)
543 This value is the total number of lines in the editor.
544 If you want a slider attached to the gadget, you should create
545 a notify on this attribute.
547 You shouldn't use this. Instead, use MUIA_TextEditor_Slider.
550 DoMethod(editorgad, MUIM_Notify,
551 MUIA_TextEditor_Prop_Entries, MUIV_EveryTime,
552 slider, 3, MUIM_Set, MUIA_Prop_Entries, MUIV_TriggerValue);
555 MUIA_TextEditor_Prop_Visible, MUIA_TextEditor_Slider
556 MUIA_TextEditor_Prop_First, MUIA_TextEditor_Prop_DeltaFactor
558 \fTextEditor.mcc/MUIA_TextEditor_Prop_First
561 MUIA_TextEditor_Prop_First -- [.SG], ULONG (OBSOLETE)
564 Get or set the first displayed line. The purpose of this attribute
565 is to allow connection between the editor gadget and a scrollbar.
569 DoMethod(editor, MUIM_Notify,
570 MUIA_TextEditor_Prop_First, MUIV_EveryTime,
571 slider, 3, MUIM_Set, MUIA_Prop_First, MUIV_TriggerValue);
573 DoMethod(slider, MUIM_Notify,
574 MUIA_Prop_First, MUIV_EveryTime,
575 editor, 3, MUIM_Set, MUIA_TextEditor_Prop_First, MUIV_TriggerValue);
578 MUIA_TextEditor_Prop_Visible, MUIA_TextEditor_Slider
579 MUIA_TextEditor_Prop_Entries, MUIA_TextEditor_Prop_DeltaFactor
581 \fTextEditor.mcc/MUIA_TextEditor_Prop_Visible
584 MUIA_TextEditor_Prop_Visible -- [..G], ULONG (OBSOLETE)
587 This value is the number of lines that currently fit in the window.
588 If you want a slider attached to the gadget, you should create a
589 notify on this attribute.
591 You shouldn't use this. Instead, use MUIA_TextEditor_Slider.
595 DoMethod(editorgad, MUIM_Notify,
596 MUIA_TextEditor_Prop_Visible, MUIV_EveryTime,
597 slider, 3, MUIM_Set, MUIA_Prop_Visible, MUIV_TriggerValue);
600 MUIA_TextEditor_Prop_Entries, MUIA_TextEditor_Slider
601 MUIA_TextEditor_Prop_First, MUIA_TextEditor_Prop_DeltaFactor
603 \fTextEditor.mcc/MUIA_TextEditor_Quiet
606 MUIA_TextEditor_Quiet -- [ISG], BOOL
609 If you need to insert a lot of text "line by line", you should
610 set this tag to TRUE before starting, and then back to FALSE when
611 you are done adding text.
614 MUIM_TextEditor_InsertText
616 \fTextEditor.mcc/MUIA_TextEditor_ReadOnly
619 MUIA_TextEditor_ReadOnly -- [ISG], BOOL
622 Setting this tag to TRUE will make the text read-only.
623 This is very similar to the FloatText.mui, except that
624 this gadget offers blocking.
627 - there will be no cursor (only a normal TAB frame),
628 - TAB will activate the next gadget (instead of alt-TAB),
629 - the frame will be set to a ReadListFrame (may change),
630 - there is no ARexx support, except "Copy".
632 The MUIA_TextEditor_StyleXXX tags are still usable.
634 \fTextEditor.mcc/MUIA_TextEditor_RedoAvailable
637 MUIA_TextEditor_RedoAvailable -- [..G], BOOL
640 This tag is set to TRUE when the user is able to redo his action(s)
641 (normally after an undo). You can create a notify on this tag and
642 let your redo button be ghosted when there is nothing to redo.
645 MUIA_TextEditor_UndoAvailable
647 \fTextEditor.mcc/MUIA_TextEditor_Rows
650 MUIA_TextEditor_Rows -- [I..], ULONG
653 Set the desired height, in lines.
656 MUIA_TextEditor_Columns
658 \fTextEditor.mcc/MUIA_TextEditor_Separator
661 MUIA_TextEditor_Separator -- [.SG], UWORD *
664 Each line can act as a separator.
666 A separator can be either thick or thin. It can be rendered over
667 the lines contents, or only on both sides of the contents. The
668 placement can be either top, middle or bottom.
670 This tag reflects the current line. See mui/TextEditor_mcc.h for
674 /* A simple way to let the user insert a separator is to create a
675 button or menu item with the following notify.
677 Note: The import hook should be set to
678 MUIV_TextEditor_ImportHook_Plain
679 when the notify is executed.
682 DoMethod(button, MUIM_Notify,
684 editor, 2, MUIM_TextEditor_InsertText, "\n\33c\33[s:2]\n");
686 \fTextEditor.mcc/MUIA_TextEditor_Slider
689 MUIA_TextEditor_Slider -- [IS.], Object *
692 You should give a pointer to a prop object to allow connection
693 between the editor gadget and the prop object.
695 The reason why you shouldn't set up notification yourself is that
696 the gadget needs to set two undocumented tags for the prop object.
699 MUIA_TextEditor_Prop_DeltaFactor, MUIA_TextEditor_Prop_Entries
700 MUIA_TextEditor_Prop_First, MUIA_TextEditor_Prop_Visible
702 \fTextEditor.mcc/MUIA_TextEditor_StyleBold
705 MUIA_TextEditor_StyleBold -- [.SG], BOOL
708 This tag shows whether the cursor or block is over bolded text or not.
709 You can set this tag to TRUE or FALSE if you want the style changed.
713 DoMethod(boldgad, MUIM_Notify,
714 MUIA_Selected, MUIV_EveryTime,
715 editor, 3, MUIM_NoNotifySet, MUIA_TextEditor_StyleBold, MUIV_TriggerValue);
717 DoMethod(editor, MUIM_Notify,
718 MUIA_TextEditor_StyleBold, MUIV_EveryTime,
719 boldgad, 3, MUIM_NoNotifySet, MUIA_Selected, MUIV_TriggerValue);
722 MUIA_TextEditor_StyleItalic, MUIA_TextEditor_StyleUnderline
724 \fTextEditor.mcc/MUIA_TextEditor_StyleItalic
727 MUIA_TextEditor_StyleItalic -- [.SG], BOOL
730 This tag shows whether the cursor or block is over text in italics
731 or not. You can set this tag to TRUE or FALSE if you want the
735 See MUIA_TextEditor_StyleBold
738 MUIA_TextEditor_StyleBold, MUIA_TextEditor_StyleUnderline
740 \fTextEditor.mcc/MUIA_TextEditor_StyleUnderline
743 MUIA_TextEditor_StyleUnderline -- [.SG], BOOL
746 This tag shows whether the cursor or block is over underlined text
747 or not. You can set this tag to TRUE or FALSE if you want the
751 See MUIA_TextEditor_StyleBold
754 MUIA_TextEditor_StyleBold, MUIA_TextEditor_StyleItalic
756 \fTextEditor.mcc/MUIA_TextEditor_TypeAndSpell
759 MUIA_TextEditor_TypeAndSpell -- [.SG], BOOL
762 This is a shortcut to the Type'n'spell switch that the user can
763 set in the .mcp module. NEVER integrate this into the settings
768 DoMethod(editor, MUIM_Notify,
769 MUIA_TextEditor_TypeAndSpell, MUIV_EveryTime,
770 toggle, 3, MUIM_Set, MUIA_Selected, MUIV_TriggerValue);
771 DoMethod(toggle, MUIM_Notify,
772 MUIA_Selected, MUIV_EveryTime,
773 editor, 3, MUIM_Set, MUIA_TextEditor_TypeAndSpell, MUIV_TriggerValue);
775 \fTextEditor.mcc/MUIA_TextEditor_UndoAvailable
778 MUIA_TextEditor_UndoAvailable -- [..G], BOOL
781 This tag is set to TRUE when the user is able to undo his action(s).
782 You can create a notify on this tag and let your undo button be
783 ghosted when there is nothing to undo.
786 MUIA_TextEditor_RedoAvailable
788 \fTextEditor.mcc/MUIA_TextEditor_WrapBorder
791 MUIA_TextEditor_WrapBorder -- [ISG], ULONG
794 The gadget will insert a line break in front of the current word
795 if the cursor goes beyond the column given here.
797 Please remember that the gadget does real time wordwrap, which is
798 much better! This tag is only for special cases!!!
801 MUIA_TextEditor_ExportWrap, MUIA_TextEditor_ImportWrap
803 \fTextEditor.mcc/MUIM_TextEditor_ARexxCmd
806 MUIM_TextEditor_ARexxCmd
809 DoMethod(obj, MUIM_TextEditor_ARexxCmd, STRPTR command);
812 If the user spends much of his time in the TextEditor gadget, he
813 may want to have the gadget's functions integrated in the ARexx
814 command set supplied by the program. This can easily be done with
815 this method - simply call it with the command that the user has
816 executed. If the method returns something else than FALSE, then
817 the command has been used by the gadget; if it does return FALSE,
818 then you should parse the command yourself.
820 This method can also be used by you, to communicate with the gadget.
822 The following commands are currently supported:
829 GOTOLINE Template: /N/A
830 GOTOCOLUMN Template: /N/A
831 CURSOR Template: Up/S,Down/S,Left/S,Right/S
833 COLUMN Template: /N/A
834 NEXT Template: Word/S,Sentence/S,Paragraph/S,Page/S
835 PREVIOUS Template: Word/S,Sentence/S,Paragraph/S,Page/S
836 POSITION Template: SOF/S,EOF/S,SOL/S,EOL/S,SOW/S,EOW/S,SOV/S,EOV/S
837 SETBOOKMARK Template: /N/A
838 GOTOBOOKMARK Template: /N/A
846 GETCURSOR Template: Line/S,Column/S
847 MARK Template: On/S,Off/S
855 The method will return FALSE if it couldn't use the command.
856 It will return TRUE if it did use the command, but the command
857 didn't give a result back. It will return a pointer (STRPTR)
858 when the command gives a result - you should return this pointer
859 to the user (CreateArgString() it, and set it as the result, in
860 the Rexx message). You must free the result yourself with FreeVec().
862 \fTextEditor.mcc/MUIM_TextEditor_BlockInfo
865 MUIM_TextEditor_BlockInfo
868 DoMethod(obj, MUIM_TextEditor_BlockInfo, ULONG *startx, ULONG *starty,
869 ULONG *stopx, ULONG *stopy);
872 This method fills out the ULONG pointers with the start and stop
873 position of the currently marked block.
876 The method will return FALSE if no text has been marked.
879 ULONG x1, y1, x2, y2;
880 if(DoMethod(obj, MUIM_TextEditor_BlockInfo, &x1, &y1, &x2, &y2))
885 \fTextEditor.mcc/MUIM_TextEditor_ClearText
888 MUIM_TextEditor_ClearText
891 DoMethod(obj, MUIM_TextEditor_ClearText);
894 This will clear all the text in the gadget.
896 \fTextEditor.mcc/MUIM_TextEditor_ExportBlock
899 MUIM_TextEditor_ExportBlock
902 DoMethod(obj, MUIM_TextEditor_ExportBlock);
905 Not yet implemented...
911 MUIM_TextEditor_InsertText, MUIM_TextEditor_ExportText
913 \fTextEditor.mcc/MUIM_TextEditor_ExportText
916 MUIM_TextEditor_ExportText
919 DoMethod(obj, MUIM_TextEditor_ExportText);
922 This will export the text using the current export hook.
925 Depends on the export hook. The built-in hooks will return
926 a pointer to a NULL terminated buffer containing all the text.
927 You must free this buffer with FreeVec() when you are done using it.
930 MUIM_TextEditor_InsertText, MUIM_TextEditor_ExportBlock
932 \fTextEditor.mcc/MUIM_TextEditor_HandleError
935 MUIM_TextEditor_HandleError
938 DoMethod(obj, MUIM_TextEditor_HandleError, ULONG errorcode);
941 This method is not supported by the editor gadget itself. The idea
942 is that you should subclass the gadget and implement your own error
943 handler. The handler should just bring up a requester or write the
944 error in a status line.
946 The different errors are:
948 Error_ClipboardIsEmpty: The clipboard doesn't hold any data.
949 Error_ClipboardIsNotFTXT: The clipboard doesn't hold any text.
950 Error_MacroBufferIsFull: Not yet used.
951 Error_MemoryAllocationFailed: Not yet used.
952 Error_NoAreaMarked: The user has tried to copy or cut, but
953 hasn't marked anything.
954 Error_NoMacroDefined: Not yet used.
955 Error_NothingToRedo: There is nothing more to redo.
956 Error_NothingToUndo: There is nothing more to undo.
957 Error_NotEnoughUndoMem: The user has erased a block that is too
958 big to be saved. This results in a lost
960 Error_StringNotFound: Not yet used.
965 \fTextEditor.mcc/MUIM_TextEditor_InsertText
968 MUIM_TextEditor_InsertText
971 DoMethod(obj, MUIM_TextEditor_InsertText, STRPTR text, LONG pos);
974 This will insert the given text using the current import hook.
975 The position of the inserted text can be:
977 MUIV_TextEditor_InsertText_Cursor
978 MUIV_TextEditor_InsertText_Top
979 MUIV_TextEditor_InsertText_Bottom
985 MUIM_TextEditor_ExportText
987 \fTextEditor.mcc/MUIM_TextEditor_MacroBegin
990 MUIM_TextEditor_MacroBegin
993 DoMethod(obj, MUIM_TextEditor_MacroBegin);
996 Not yet implemented...
1002 MUIM_TextEditor_MacroEnd, MUIM_TextEditor_MacroExecute
1004 \fTextEditor.mcc/MUIM_TextEditor_MacroEnd
1007 MUIM_TextEditor_MacroEnd
1010 DoMethod(obj, MUIM_TextEditor_MacroEnd);
1013 Not yet implemented...
1019 MUIM_TextEditor_MacroBegin, MUIM_TextEditor_MacroExecute
1021 \fTextEditor.mcc/MUIM_TextEditor_MacroExecute
1024 MUIM_TextEditor_MacroExecute
1027 DoMethod(obj, MUIM_TextEditor_MacroExecute);
1030 Not yet implemented...
1036 MUIM_TextEditor_MacroBegin, MUIM_TextEditor_MacroEnd
1038 \fTextEditor.mcc/MUIM_TextEditor_MarkText
1041 MUIM_TextEditor_MarkText
1044 DoMethod(obj, MUIM_TextEditor_MarkText, ULONG start_x, ULONG start_y, ULONG stop_x, ULONG stop_y);
1047 This method will mark the given area.
1052 \fTextEditor.mcc/MUIM_TextEditor_Replace
1055 MUIM_TextEditor_Replace
1058 DoMethod(obj, MUIM_TextEditor_Replace, STRPTR newstring, ULONG flags);
1061 This method replacea the marked area with the given string.
1062 Currently no flags are defined, so pass 0L for now.
1065 TRUE if the string was replaced. A failure is likely to be because
1066 nothing was marked when this method was invoked.
1068 \fTextEditor.mcc/MUIM_TextEditor_Search
1071 MUIM_TextEditor_Search
1074 DoMethod(obj, MUIM_TextEditor_Search, STRPTR string, ULONG flags);
1077 Search the text for the given string. The string must not exceed 120
1082 MUIF_TextEditor_Search_FromTop
1083 Normally the search starts at the cursor position - this flag will
1084 make it start at the beginning of the text.
1086 MUIF_TextEditor_Search_CaseSensitive
1087 If you want the search to be case sensitive, then set this flag.
1090 TRUE if the string was found, otherwise FALSE.
1093 If the string is found, it will be automatically marked. Thus,
1094 in case you want to replace it, simply clear the marked string and