1 /***************************************************************************
3 TextEditor.mcc - Textediting MUI Custom Class
4 Copyright (C) 1997-2000 Allan Odgaard
5 Copyright (C) 2005 by TextEditor.mcc Open Source Team
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 TextEditor class Support Site: http://www.sf.net/projects/texteditor-mcc
21 ***************************************************************************/
25 #include <clib/alib_protos.h>
26 #include <libraries/asl.h>
27 #include <libraries/gadtools.h>
28 #include <libraries/mui.h>
29 #include <mui/BetterString_mcc.h>
30 #include <mui/HotkeyString_mcc.h>
31 #include <proto/exec.h>
32 #include <proto/intuition.h>
33 #include <proto/muimaster.h>
40 #include "TextEditor_mcc.h"
46 AROS_HOOKPROTONH(ListDisplayFunc
, void, char **, array
, struct te_key
*, entry
)
48 HOOKPROTONH(ListDisplayFunc
, void, char **array
, struct te_key
*entry
)
53 static char buffer
[118];
70 ka
.qualifier
= entry
->qual
;
71 KeyToString(buffer
, &ka
);
75 *array
= FunctionName(entry
->act
);
79 *array
++ = GetStr(MSG_LVLabel_Key
);
81 *array
= GetStr(MSG_LVLabel_Action
);
88 MakeStaticHook(ListDisplayHook
, ListDisplayFunc
);
91 AROS_HOOKPROTONH(ListConstructFunc
, APTR
, APTR
, pool
, struct te_key
*, entry
)
93 HOOKPROTONH(ListConstructFunc
, APTR
, APTR pool
, struct te_key
*entry
)
98 struct te_key
*newplace
;
101 newplace
= AllocPooled(pool
, sizeof(struct te_key
));
104 CopyMem(entry
, newplace
, sizeof(struct te_key
));
112 MakeStaticHook(ListConstructHook
, ListConstructFunc
);
115 AROS_HOOKPROTONH(ListDestructFunc
, void, APTR
, pool
, struct te_key
*, entry
)
117 HOOKPROTONH(ListDestructFunc
, void, APTR pool
, struct te_key
*entry
)
123 FreePooled(pool
, entry
, sizeof(struct te_key
));
128 MakeStaticHook(ListDestructHook
, ListDestructFunc
);
131 AROS_HOOKPROTONH(Popstring_WindowCode
, void, Object
*, pop
, Object
*, win
)
133 HOOKPROTONH(Popstring_WindowCode
, void, Object
*pop
, Object
*win
)
139 set(win
, MUIA_Window_DefaultObject
, pop
);
144 MakeStaticHook(Popstring_WindowHook
, Popstring_WindowCode
);
147 AROS_HOOKPROTONH(Popstring_OpenCode
, BOOL
, Object
*, pop
, Object
*, text
)
149 HOOKPROTONH(Popstring_OpenCode
, BOOL
, Object
*pop
, Object
*text
)
157 get(text
, MUIA_UserData
, &active
);
158 set(pop
, MUIA_List_Active
, active
);
165 MakeStaticHook(Popstring_OpenHook
, Popstring_OpenCode
);
168 AROS_HOOKPROTONH(Popstring_CloseCode
, void, Object
*, pop
, Object
*, text
)
170 HOOKPROTONH(Popstring_CloseCode
, void, Object
*pop
, Object
*text
)
178 get(pop
, MUIA_List_Active
, &active
);
179 set(text
, MUIA_UserData
, active
);
185 MakeStaticHook(Popstring_CloseHook
, Popstring_CloseCode
);
188 AROS_HOOKPROTONHNO(InsertCode
, void, APTR
**, array
)
190 HOOKPROTONHNO(InsertCode
, void, APTR
**array
)
195 static const struct te_key constentry
= {76, 0, 0};
196 Object
*keylist
= (Object
*)*array
++;
201 get(keylist
, MUIA_List_Active
, &entry
);
203 if((LONG
)entry
!= MUIV_List_Active_Off
)
204 nnset(keylist
, MUIA_List_Active
, MUIV_List_Active_Off
);
208 DoMethod(keylist
, MUIM_List_InsertSingle
, &constentry
, entry
);
209 set(keylist
, MUIA_List_Active
, entry
);
215 MakeStaticHook(InsertHook
, InsertCode
);
218 AROS_HOOKPROTONHNO(SelectCode
, void, APTR
**, array
)
220 HOOKPROTONHNO(SelectCode
, void, APTR
**array
)
225 struct InstData_MCP
*data
= (struct InstData_MCP
*)*array
++;
226 Object
*keylist
= (Object
*)*array
++;
227 struct te_key
*entry
;
231 DoMethod(keylist
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &entry
);
239 get(data
->keyfunctions
, MUIA_Popstring_String
, &result
);
240 nnset((Object
*)result
, MUIA_UserData
, entry
->act
);
242 ka
.key
= entry
->code
;
252 ka
.qualifier
= entry
->qual
;
253 KeyToString(buffer
, &ka
);
254 nnset(data
->hotkey
, MUIA_String_Contents
, buffer
);
261 MakeStaticHook(SelectHook
, SelectCode
);
264 AROS_HOOKPROTONHNO(UpdateCode
, void, APTR
**, array
)
266 HOOKPROTONHNO(UpdateCode
, void, APTR
**array
)
271 struct InstData_MCP
*data
= (struct InstData_MCP
*)*array
++;
272 Object
*keylist
= (Object
*)*array
++;
279 get(keylist
, MUIA_List_Active
, &active
);
281 if((LONG
)active
!= MUIV_List_Active_Off
)
283 SetAttrs(keylist
, MUIA_List_Quiet
, TRUE
,
284 MUIA_List_Active
, MUIV_List_Active_Off
,
287 DoMethod(keylist
, MUIM_List_Remove
, active
);
289 get(data
->keyfunctions
, MUIA_Popstring_String
, &result
);
290 get((Object
*)result
, MUIA_UserData
, &result
);
294 get(data
->hotkey
, MUIA_String_Contents
, &result
);
298 struct KeyAction keyaction
;
300 ConvertKeyString((STRPTR
)result
, entry
.act
, &keyaction
);
301 entry
.code
= keyaction
.key
;
302 if(keyaction
.vanilla
)
306 entry
.qual
= keyaction
.qualifier
;
309 DoMethod(keylist
, MUIM_List_InsertSingle
, &entry
, active
);
310 SetAttrs(keylist
, MUIA_List_Active
, active
,
311 MUIA_List_Quiet
, FALSE
,
320 MakeStaticHook(UpdateHook
, UpdateCode
);
322 static APTR
TxtLabel (STRPTR text
, ULONG weight
)
324 /* APTR result = TextEditorObject,
325 MUIA_Background, MUII_GroupBack,
326 MUIA_TextEditor_ReadOnly, TRUE,
327 MUIA_TextEditor_Contents, text,
331 APTR result
= TextObject
,
332 MUIA_FramePhantomHoriz
, TRUE
,
333 MUIA_Frame
, MUIV_Frame_ImageButton
,
334 MUIA_Text_PreParse
, "\33r",
335 MUIA_Text_SetVMax
, FALSE
,
336 MUIA_Text_Contents
, text
,
340 // APTR result = MUI_MakeObject(MUIO_Label, text, 0);
345 Object
*CreatePrefsGroup(struct InstData_MCP
*data
)
347 Object
*slider
, *slider2
, *readview
, *button
, *group
,
348 *editor
, *keylist
, *defaultkeys
, *functionname
,
351 struct NewMenu
*nm
, editpopupdata
[] =
353 { NM_TITLE
, MSG_MenuTitle_Edit
, 0, 0, 0, (APTR
)0 },
354 { NM_ITEM
, MSG_MenuItem_Cut
, NULL
, NM_COMMANDSTRING
, 0, (APTR
)1 },
355 { NM_ITEM
, MSG_MenuItem_Copy
, NULL
, NM_COMMANDSTRING
, 0, (APTR
)2 },
356 { NM_ITEM
, MSG_MenuItem_Paste
, NULL
, NM_COMMANDSTRING
, 0, (APTR
)3 },
357 { NM_ITEM
, MSG_MenuItem_Delete
, NULL
, NM_COMMANDSTRING
, 0, (APTR
)4 },
358 { NM_ITEM
, NM_BARLABEL
, 0, 0, 0, (APTR
)0 },
359 { NM_ITEM
, MSG_MenuItem_Undo
, NULL
, NM_COMMANDSTRING
, 0, (APTR
)5 },
360 { NM_ITEM
, MSG_MenuItem_Redo
, NULL
, NM_COMMANDSTRING
, 0, (APTR
)6 },
361 { NM_ITEM
, NM_BARLABEL
, 0, 0, 0, (APTR
)0 },
362 { NM_ITEM
, MSG_MenuItem_Bold
, NULL
, NM_COMMANDSTRING
| CHECKIT
|MENUTOGGLE
, 0, (APTR
)7 },
363 { NM_ITEM
, MSG_MenuItem_Italic
, NULL
, NM_COMMANDSTRING
| CHECKIT
|MENUTOGGLE
, 0, (APTR
)8 },
364 { NM_ITEM
, MSG_MenuItem_Underline
, NULL
, NM_COMMANDSTRING
| CHECKIT
|MENUTOGGLE
, 0, (APTR
)9 },
365 { NM_ITEM
, NM_BARLABEL
, 0, 0, 0, (APTR
)0 },
366 { NM_ITEM
, MSG_MenuSubTitle_Alignment
, 0, 0, 0, (APTR
)0 },
367 { NM_SUB
, MSG_MenuItem_Left
, NULL
, NM_COMMANDSTRING
| CHECKIT
|CHECKED
, ~1, (APTR
)10 },
368 { NM_SUB
, MSG_MenuItem_Center
, NULL
, NM_COMMANDSTRING
| CHECKIT
, ~2, (APTR
)11 },
369 { NM_SUB
, MSG_MenuItem_Right
, NULL
, NM_COMMANDSTRING
| CHECKIT
, ~4, (APTR
)12 },
371 { NM_ITEM
, MSG_MenuSubTitle_Color
, 0, 0, 0, (APTR
)0 },
372 { NM_SUB
, MSG_MenuItem_Normal
, NULL
, NM_COMMANDSTRING
| CHECKIT
|CHECKED
, ~1, (APTR
)13 },
373 { NM_SUB
, MSG_MenuItem_Shine
, NULL
, NM_COMMANDSTRING
| CHECKIT
, ~2, (APTR
)14 },
374 { NM_SUB
, MSG_MenuItem_Halfshine
, NULL
, NM_COMMANDSTRING
| CHECKIT
, ~4, (APTR
)15 },
375 { NM_SUB
, MSG_MenuItem_Background
, NULL
, NM_COMMANDSTRING
| CHECKIT
, ~8, (APTR
)16 },
376 { NM_SUB
, MSG_MenuItem_Halfshadow
, NULL
, NM_COMMANDSTRING
| CHECKIT
, ~16, (APTR
)17 },
377 { NM_SUB
, MSG_MenuItem_Shadow
, NULL
, NM_COMMANDSTRING
| CHECKIT
, ~32, (APTR
)18 },
378 { NM_SUB
, MSG_MenuItem_Text
, NULL
, NM_COMMANDSTRING
| CHECKIT
, ~64, (APTR
)19 },
379 { NM_SUB
, MSG_MenuItem_Fill
, NULL
, NM_COMMANDSTRING
| CHECKIT
, ~128, (APTR
)20 },
380 { NM_SUB
, MSG_MenuItem_Mark
, NULL
, NM_COMMANDSTRING
| CHECKIT
, ~256, (APTR
)21 },
382 { NM_END
, NULL
, 0, 0, 0, (APTR
)0 }
389 if (nm
->nm_Label
!= NM_BARLABEL
)
390 nm
->nm_Label
= GetStr(nm
->nm_Label
);
391 } while (++nm
,nm
->nm_Type
!= NM_END
);
393 data
->editpopup
= MUI_MakeObject(MUIO_MenustripNM
, editpopupdata
, NULL
);
396 Child
, RegisterGroup(data
->gTitles
),
397 MUIA_CycleChain
, TRUE
,
398 MUIA_Background
, MUII_RegisterBack
,
403 MUIA_Background
, MUII_GroupBack
,
404 MUIA_Frame
, MUIV_Frame_Group
,
405 MUIA_FrameTitle
, GetStr(MSG_GroupTitle_Control
),
406 Child
, RectangleObject
,
409 Child
, TxtLabel(GetStr(MSG_Label_UndoLevel
), 0),
410 Child
, data
->undosize
= SliderObject
,
411 MUIA_ShortHelp
, GetStr(HelpBubble_UndoLevel
),
412 MUIA_Numeric_Min
, 20,
413 MUIA_Numeric_Max
, 2000,
414 MUIA_Numeric_Format
, "%ld (± 5)",
416 Child
, TxtLabel(GetStr(MSG_Label_TabSize
), 0),
417 Child
, data
->tabsize
= SliderObject
,
419 MUIA_Numeric_Max
, 12,
420 MUIA_Numeric_Format
, GetStr(MSG_SliderText_TabSize
),
422 Child
, TxtLabel(GetStr(MSG_Label_Smooth
), 0),
424 MUIA_ShortHelp
, GetStr(HelpBubble_Smooth
),
425 Child
, data
->smooth
= MUI_MakeObject(MUIO_Checkmark
, NULL
),
426 Child
, RectangleObject
,
430 Child
, RectangleObject
,
435 // MUIA_VertWeight, 0,
436 MUIA_Group_SameHeight
, FALSE
,
437 MUIA_Background
, MUII_GroupBack
,
438 MUIA_Frame
, MUIV_Frame_Group
,
439 MUIA_FrameTitle
, GetStr(MSG_GroupTitle_Design
),
441 Child
, TxtLabel(GetStr(MSG_Label_Frame
), 0),
442 Child
, data
->frame
= MUI_NewObject("Popframe.mui",
443 MUIA_Window_Title
, GetStr(MSG_PopWinTitle_Frame
),
445 Child
, TxtLabel(GetStr(MSG_Label_Background
), 0),
446 Child
, data
->background
= MUI_NewObject("Popimage.mui",
447 MUIA_Window_Title
, GetStr(MSG_PopWinTitle_Background
),
448 MUIA_Imageadjust_Type
, 2,
450 Child
, TxtLabel(GetStr(MSG_Label_Text
), 0),
451 Child
, data
->textcolor
= PoppenObject
,
452 MUIA_Window_Title
, GetStr(MSG_PopWinTitle_Text
),
454 Child
, TxtLabel(GetStr(MSG_Label_Highlight
), 0),
455 Child
, data
->highlightcolor
= PoppenObject
,
456 MUIA_Window_Title
, GetStr(MSG_PopWinTitle_Highlight
),
462 MUIA_Background
, MUII_GroupBack
,
463 MUIA_Frame
, MUIV_Frame_Group
,
464 MUIA_FrameTitle
, GetStr(MSG_GroupTitle_Separator
),
465 Child
, TxtLabel(GetStr(MSG_Label_SeparatorShine
), 0),
466 Child
, data
->separatorshine
= PoppenObject
,
467 MUIA_Window_Title
, GetStr(MSG_PopWinTitle_SeparatorShine
),
469 Child
, TxtLabel(GetStr(MSG_Label_SeparatorShadow
), 0),
470 Child
, data
->separatorshadow
= PoppenObject
,
471 MUIA_Window_Title
, GetStr(MSG_PopWinTitle_SeparatorShadow
),
478 // MUIA_VertWeight, 0,
479 MUIA_Background
, MUII_GroupBack
,
480 MUIA_Frame
, MUIV_Frame_Group
,
481 MUIA_FrameTitle
, GetStr(MSG_GroupTitle_Fonts
),
482 Child
, RectangleObject
,
485 Child
, TxtLabel(GetStr(MSG_Label_Normal
), 0),
487 MUIA_Popstring_String
, data
->normalfont
= BetterStringObject
, StringFrame
, End
,
488 MUIA_Popstring_Button
, MUI_MakeObject(MUIO_PopButton
, MUII_PopUp
),
489 MUIA_Popasl_Type
, ASL_FontRequest
,
491 Child
, TxtLabel(GetStr(MSG_Label_Fixed
), 0),
493 MUIA_Popstring_String
, data
->fixedfont
= BetterStringObject
, StringFrame
, End
,
494 MUIA_Popstring_Button
, MUI_MakeObject(MUIO_PopButton
, MUII_PopUp
),
495 MUIA_Popasl_Type
, ASL_FontRequest
,
496 ASLFO_Flags
, FOF_FIXEDWIDTHONLY
,
499 Child
, RectangleObject
,
504 // MUIA_VertWeight, 0,
505 MUIA_Background
, MUII_GroupBack
,
506 MUIA_Frame
, MUIV_Frame_Group
,
507 MUIA_FrameTitle
, GetStr(MSG_GroupTitle_Cursor
),
508 MUIA_Group_Columns
, 2,
509 Child
, TxtLabel(GetStr(MSG_Label_Cursor
), 0),
510 Child
, data
->cursorcolor
= PoppenObject
,
511 MUIA_Window_Title
, GetStr(MSG_PopWinTitle_Cursor
),
513 Child
, TxtLabel(GetStr(MSG_Label_Selected
), 0),
514 Child
, data
->markedcolor
= PoppenObject
,
515 MUIA_Window_Title
, GetStr(MSG_PopWinTitle_Selected
),
517 Child
, TxtLabel(GetStr(MSG_Label_Width
), 0),
518 Child
, data
->cursorwidth
= NewObject(widthslider_mcc
->mcc_Class
, NULL
,
521 MUIA_Numeric_Format
, GetStr(MSG_SliderText_StdWidth
),
523 Child
, TxtLabel(GetStr(MSG_Label_BlinkSpeed
), 0),
524 Child
, data
->blinkspeed
= NewObject(speedslider_mcc
->mcc_Class
, NULL
,
526 MUIA_Numeric_Max
, 20,
527 MUIA_Numeric_Format
, GetStr(MSG_SliderText_StdSpeed
),
537 Child
, defaultkeys
= SimpleButton(GetStr(MSG_Button_DefaultKeys
)),
538 Child
, TxtLabel(GetStr(MSG_Label_BlkQual
), 1000),
539 Child
, data
->blockqual
= MUI_MakeObject(MUIO_Cycle
, NULL
, data
->cycleentries
),
541 Child
, data
->keybindings
= ListviewObject
,
542 MUIA_CycleChain
, TRUE
,
543 MUIA_Listview_DragType
, MUIV_Listview_DragType_Immediate
,
544 MUIA_Listview_List
, keylist
= ListObject
,
545 MUIA_Frame
, MUIV_Frame_InputList
,
546 MUIA_Background
, MUII_ListBack
,
547 MUIA_List_Title
, TRUE
,
548 MUIA_List_ConstructHook
, &ListConstructHook
,
549 MUIA_List_DestructHook
, &ListDestructHook
,
550 MUIA_List_DisplayHook
, &ListDisplayHook
,
551 MUIA_List_DragSortable
, TRUE
,
552 MUIA_List_Format
, "P=\33r W=100 0, P=\33c 1, 2",
553 // MUIA_List_Format, "P=\33r W=100 0, P=\33c NoTB NoBar 1, 2",
554 // MUIA_List_SourceArray, keybindings,
555 // MUIA_List_TitleClick, TRUE,
556 // MUIA_List_DragType, MUIV_List_DragType_Default,
561 Child
, data
->hotkey
= HotkeyStringObject
,
562 MUIA_CycleChain
, TRUE
,
563 MUIA_Frame
, MUIV_Frame_String
,
564 MUIA_HotkeyString_Snoop
, FALSE
,
567 Child
, button
= TextObject
, ButtonFrame
,
568 MUIA_CycleChain
, TRUE
,
569 MUIA_Background
, MUII_ButtonBack
,
570 MUIA_Text_Contents
, GetStr(MSG_Button_Snoop
),
571 MUIA_Text_SetMax
, TRUE
,
572 MUIA_InputMode
, MUIV_InputMode_Toggle
,
575 Child
, BalanceObject
, End
,
577 Child
, MUI_MakeObject(MUIO_Label
, "=", MUIO_Label_Centered
),
578 // Child, MUI_MakeObject(MUIO_Cycle, NULL, data->functions),
579 Child
, data
->keyfunctions
= PopobjectObject
,
581 MUIA_Popstring_String
, functionname
= NewObject(text_mcc
->mcc_Class
, NULL
, TextFrame
, MUIA_Background
, MUII_TextBack
, TAG_DONE
),
582 MUIA_Popstring_Button
, popbutton
= MUI_MakeObject(MUIO_PopButton
, MUII_PopUp
),
583 MUIA_Popobject_StrObjHook
, &Popstring_OpenHook
,
584 MUIA_Popobject_ObjStrHook
, &Popstring_CloseHook
,
585 MUIA_Popobject_WindowHook
, &Popstring_WindowHook
,
587 MUIA_Popobject_Object
, plist
= ListviewObject
,
588 MUIA_CycleChain
, TRUE
,
589 MUIA_Listview_List
, ListObject
,
591 MUIA_List_AutoVisible
, TRUE
,
592 MUIA_List_SourceArray
, data
->functions
,
596 // MUIA_Poplist_Array, data->functions,
601 Child
, data
->insertkey
= SimpleButton(GetStr(MSG_Button_Insert
)),
602 Child
, data
->deletekey
= SimpleButton(GetStr(MSG_Button_Delete
)),
611 Child
, readview
= TextEditorObject
,
613 MUIA_CycleChain
, TRUE
,
614 MUIA_TextEditor_ReadOnly
, TRUE
,
615 MUIA_TextEditor_Contents
, GetStr(MSG_HelpTxt_SpellChecker
),
617 Child
, slider2
= ScrollbarObject
,
621 Child
, BalanceObject
, End
,
624 Child
, TxtLabel(GetStr(MSG_Label_LookupCmd
), 0),
625 Child
, data
->LookupExeType
= CycleObject
,
626 MUIA_Cycle_Entries
, data
->execution
,
629 Child
, data
->lookupcmd
= BetterStringObject
, StringFrame
, End
,
630 Child
, TxtLabel(GetStr(MSG_Label_SuggestCmd
), 0),
631 Child
, data
->SuggestExeType
= CycleObject
,
632 MUIA_Cycle_Entries
, data
->execution
,
635 Child
, data
->suggestcmd
= BetterStringObject
, StringFrame
, MUIA_String_AdvanceOnCR
, TRUE
, End
,
638 Child
, TxtLabel(GetStr(MSG_Label_SpellNType
), 1000),
639 Child
, data
->typenspell
= MUI_MakeObject(MUIO_Checkmark
, NULL
),
640 Child
, TxtLabel(GetStr(MSG_Label_LookupWords
), 1000),
641 Child
, data
->CheckWord
= MUI_MakeObject(MUIO_Checkmark
, NULL
),
645 Child
, RectangleObject
,
653 Child
, editor
= TextEditorObject
,
654 MUIA_CycleChain
, TRUE
,
655 MUIA_ContextMenu
, data
->editpopup
,
656 MUIA_TextEditor_Contents
,
657 "\033r\033b" LIB_DATE
"\033n\n"
658 "\n\33cTextEditor.mcp " LIB_REV_STRING CPU
" (" LIB_DATE
")\n"
659 "Copyright (C) 1997-2000 Allan Odgaard\n"
662 "For the latest version, try: \33u\33p[7]http://www.sourceforge.net/projects/texteditor-mcc/\33p[0]\33n\n"
664 "This gadget is \33ifree software\33n. You can redistribute it and/or modify it under the terms of "
665 "the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 "
666 "of the License, or (at your option) any later version.\n"
668 "\33[s:2]\33c\33u\33b Usage: \33n\n"
670 "Besides the many keys you can configure on the \33iKeybindings\33n page, there is also the following you should know:\n"
672 "- You can double-click a word to select it. If you hold LMB after a double-click, then it will only mark \33bcomplete\33n words. Triple-clicking has the same effect, but for entire lines.\n"
674 "- In the default configuration you can extend your block by holding down any <Shift> key while you press LMB and drag the mouse until you reach the point where you want the block to end.\n"
676 "- While you drag to scroll, the farther away from the gadget your mouse pointer is, the faster the contents will scroll.\n"
678 "\33[s:2]\33c\33u\33b ARexx: \33n\n"
680 "The gadget offers the application using it the chance to extend its ARexx port to also cover this editor gadget. If this is done, you will have the following additional commands available:\n"
682 "CLEAR, CUT, COPY, PASTE, ERASE, GOTOLINE (\"/N/A\"), GOTOCOLUMN (\"/N/A\"), CURSOR (\"Up/S,Down/S,Left/S,Right/S\"), LINE (\"/N/A\"), COLUMN (\"/N/A\"), NEXT (\"Word/S,Sentence/S,Paragraph/S,Page/S\"), PREVIOUS (\"Word/S,Sentence/S,Paragraph/S,Page/S\"), POSITION (\"SOF/S,EOF/S,SOL/S,EOL/S,SOW/S,EOW/S,SOV/S,EOV/S\"), SETBOOKMARK (\"/N/A\"), GOTOBOOKMARK (\"/N/A\"), TEXT (\"/F\"), UNDO, REDO, GETLINE, GETCURSOR (\"Line/S,Column/S\"), MARK(\"On/S,Off/S\"), DELETE, BACKSPACE, KILLLINE, TOUPPER, TOLOWER.\n"
684 "Please refer to the TextEditor.mcc documentation for an explanation on how to use these commands.\n"
685 "\n\33[s:10]\n\33cThis instance has a context sensitive menu, from where you can play with text styles, colors, alignments etc.",
687 Child
, slider
= ScrollbarObject
,
695 set(readview
, MUIA_TextEditor_Slider
, slider2
);
696 set(editor
, MUIA_TextEditor_Slider
, slider
);
698 set(data
->blockqual
, MUIA_ShortHelp
, GetStr(HelpBubble_BlockQual
));
699 set(data
->typenspell
, MUIA_ShortHelp
, GetStr(HelpBubble_TypeNSpell
));
700 set(data
->CheckWord
, MUIA_ShortHelp
, GetStr(HelpBubble_CheckWord
));
702 set(data
->hotkey
, MUIA_String_AttachedList
, data
->keybindings
);
703 set(popbutton
, MUIA_CycleChain
, TRUE
);
705 DoMethod(data
->lookupcmd
, MUIM_Notify
, MUIA_String_Acknowledge
, MUIV_EveryTime
, MUIV_Notify_Window
, 3, MUIM_Set
, MUIA_Window_ActiveObject
, data
->suggestcmd
);
707 DoMethod(button
, MUIM_Notify
, MUIA_Selected
, TRUE
, MUIV_Notify_Window
, 3, MUIM_Set
, MUIA_Window_ActiveObject
, data
->hotkey
);
708 // DoMethod(button, MUIM_Notify, MUIA_Selected, FALSE, data->hotkey, 3, MUIM_Set, MUIA_String_Acknowledge, TRUE);
709 DoMethod(button
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
, data
->hotkey
, 3, MUIM_Set
, MUIA_HotkeyString_Snoop
, MUIV_TriggerValue
);
710 DoMethod(data
->hotkey
, MUIM_Notify
, MUIA_String_Contents
, MUIV_EveryTime
, button
, 3, MUIM_Set
, MUIA_Selected
, FALSE
);
712 DoMethod(plist
, MUIM_Notify
, MUIA_Listview_DoubleClick
, TRUE
, data
->keyfunctions
, 2, MUIM_Popstring_Close
, TRUE
);
714 DoMethod(defaultkeys
, MUIM_Notify
,
716 keylist
, 1, MUIM_List_Clear
);
717 DoMethod(defaultkeys
, MUIM_Notify
,
719 keylist
, 4, MUIM_List_Insert
, keybindings
, -1, MUIV_List_Insert_Bottom
);
721 DoMethod(data
->insertkey
, MUIM_Notify
,
723 MUIV_Notify_Self
, 3, MUIM_CallHook
, &InsertHook
, keylist
);
725 DoMethod(keylist
, MUIM_Notify
,
726 MUIA_List_Active
, MUIV_EveryTime
,
727 MUIV_Notify_Self
, 8, MUIM_MultiSet
, MUIA_Disabled
, FALSE
,
728 data
->hotkey
, button
, data
->keyfunctions
, data
->deletekey
, NULL
);
729 DoMethod(keylist
, MUIM_Notify
,
730 MUIA_List_Active
, MUIV_List_Active_Off
,
731 MUIV_Notify_Self
, 8, MUIM_MultiSet
, MUIA_Disabled
, TRUE
,
732 data
->hotkey
, button
, data
->keyfunctions
, data
->deletekey
, NULL
);
734 DoMethod(keylist
, MUIM_Notify
,
735 MUIA_List_Active
, MUIV_EveryTime
,
736 MUIV_Notify_Self
, 4, MUIM_CallHook
, &SelectHook
, data
, keylist
);
738 DoMethod(functionname
, MUIM_Notify
,
739 MUIA_UserData
, MUIV_EveryTime
,
740 MUIV_Notify_Self
, 4, MUIM_CallHook
, &UpdateHook
, data
, keylist
);
742 DoMethod(data
->hotkey
, MUIM_Notify
,
743 MUIA_String_Acknowledge
, MUIV_EveryTime
,
744 MUIV_Notify_Self
, 4, MUIM_CallHook
, &UpdateHook
, data
, keylist
);
746 DoMethod(data
->deletekey
, MUIM_Notify
,
748 keylist
, 2, MUIM_List_Remove
, MUIV_List_Remove_Active
);
751 DoMethod(data
->hotkey
, MUIM_MultiSet
,
753 data
->hotkey
, button
, data
->keyfunctions
, data
->deletekey
, NULL
);
755 DoMethod((Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,1), MUIM_Notify
,
756 MUIA_Menuitem_Trigger
, MUIV_EveryTime
,
757 editor
, 2, MUIM_TextEditor_ARexxCmd
, "Cut");
758 DoMethod((Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,2), MUIM_Notify
,
759 MUIA_Menuitem_Trigger
, MUIV_EveryTime
,
760 editor
, 2, MUIM_TextEditor_ARexxCmd
, "Copy");
761 DoMethod((Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,3), MUIM_Notify
,
762 MUIA_Menuitem_Trigger
, MUIV_EveryTime
,
763 editor
, 2, MUIM_TextEditor_ARexxCmd
, "Paste");
764 DoMethod((Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,4), MUIM_Notify
,
765 MUIA_Menuitem_Trigger
, MUIV_EveryTime
,
766 editor
, 2, MUIM_TextEditor_ARexxCmd
, "Erase");
767 DoMethod((Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,5), MUIM_Notify
,
768 MUIA_Menuitem_Trigger
, MUIV_EveryTime
,
769 editor
, 2, MUIM_TextEditor_ARexxCmd
, "Undo");
770 DoMethod((Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,6), MUIM_Notify
,
771 MUIA_Menuitem_Trigger
, MUIV_EveryTime
,
772 editor
, 2, MUIM_TextEditor_ARexxCmd
, "Redo");
774 DoMethod((Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,7), MUIM_Notify
,
775 MUIA_Menuitem_Checked
, MUIV_EveryTime
,
776 editor
, 3, MUIM_Set
, MUIA_TextEditor_StyleBold
, MUIV_TriggerValue
);
777 DoMethod((Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,8), MUIM_Notify
,
778 MUIA_Menuitem_Checked
, MUIV_EveryTime
,
779 editor
, 3, MUIM_Set
, MUIA_TextEditor_StyleItalic
, MUIV_TriggerValue
);
780 DoMethod((Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,9), MUIM_Notify
,
781 MUIA_Menuitem_Checked
, MUIV_EveryTime
,
782 editor
, 3, MUIM_Set
, MUIA_TextEditor_StyleUnderline
, MUIV_TriggerValue
);
784 DoMethod((Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,10), MUIM_Notify
,
785 MUIA_Menuitem_Checked
, TRUE
,
786 editor
, 3, MUIM_Set
, MUIA_TextEditor_Flow
, MUIV_TextEditor_Flow_Left
);
787 DoMethod((Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,11), MUIM_Notify
,
788 MUIA_Menuitem_Checked
, TRUE
,
789 editor
, 3, MUIM_Set
, MUIA_TextEditor_Flow
, MUIV_TextEditor_Flow_Center
);
790 DoMethod((Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,12), MUIM_Notify
,
791 MUIA_Menuitem_Checked
, TRUE
,
792 editor
, 3, MUIM_Set
, MUIA_TextEditor_Flow
, MUIV_TextEditor_Flow_Right
);
794 DoMethod((Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,13), MUIM_Notify
, MUIA_Menuitem_Checked
, TRUE
, editor
, 3, MUIM_Set
, MUIA_TextEditor_Pen
, 0);
795 DoMethod((Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,14), MUIM_Notify
, MUIA_Menuitem_Checked
, TRUE
, editor
, 3, MUIM_Set
, MUIA_TextEditor_Pen
, 1);
796 DoMethod((Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,15), MUIM_Notify
, MUIA_Menuitem_Checked
, TRUE
, editor
, 3, MUIM_Set
, MUIA_TextEditor_Pen
, 2);
797 DoMethod((Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,16), MUIM_Notify
, MUIA_Menuitem_Checked
, TRUE
, editor
, 3, MUIM_Set
, MUIA_TextEditor_Pen
, 3);
798 DoMethod((Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,17), MUIM_Notify
, MUIA_Menuitem_Checked
, TRUE
, editor
, 3, MUIM_Set
, MUIA_TextEditor_Pen
, 4);
799 DoMethod((Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,18), MUIM_Notify
, MUIA_Menuitem_Checked
, TRUE
, editor
, 3, MUIM_Set
, MUIA_TextEditor_Pen
, 5);
800 DoMethod((Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,19), MUIM_Notify
, MUIA_Menuitem_Checked
, TRUE
, editor
, 3, MUIM_Set
, MUIA_TextEditor_Pen
, 6);
801 DoMethod((Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,20), MUIM_Notify
, MUIA_Menuitem_Checked
, TRUE
, editor
, 3, MUIM_Set
, MUIA_TextEditor_Pen
, 7);
802 DoMethod((Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,21), MUIM_Notify
, MUIA_Menuitem_Checked
, TRUE
, editor
, 3, MUIM_Set
, MUIA_TextEditor_Pen
, 8);
804 DoMethod(editor
, MUIM_Notify
,
805 MUIA_TextEditor_StyleBold
, MUIV_EveryTime
,
806 (Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,7), 3, MUIM_Set
, MUIA_Menuitem_Checked
, MUIV_TriggerValue
);
807 DoMethod(editor
, MUIM_Notify
,
808 MUIA_TextEditor_StyleItalic
, MUIV_EveryTime
,
809 (Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,8), 3, MUIM_Set
, MUIA_Menuitem_Checked
, MUIV_TriggerValue
);
810 DoMethod(editor
, MUIM_Notify
,
811 MUIA_TextEditor_StyleUnderline
, MUIV_EveryTime
,
812 (Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,9), 3, MUIM_Set
, MUIA_Menuitem_Checked
, MUIV_TriggerValue
);
814 DoMethod(editor
, MUIM_Notify
,
815 MUIA_TextEditor_Flow
, MUIV_TextEditor_Flow_Left
,
816 (Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,10), 3, MUIM_Set
, MUIA_Menuitem_Checked
, MUIV_TriggerValue
);
817 DoMethod(editor
, MUIM_Notify
,
818 MUIA_TextEditor_Flow
, MUIV_TextEditor_Flow_Center
,
819 (Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,11), 3, MUIM_Set
, MUIA_Menuitem_Checked
, MUIV_TriggerValue
);
820 DoMethod(editor
, MUIM_Notify
,
821 MUIA_TextEditor_Flow
, MUIV_TextEditor_Flow_Right
,
822 (Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,12), 3, MUIM_Set
, MUIA_Menuitem_Checked
, MUIV_TriggerValue
);
824 DoMethod(editor
, MUIM_Notify
, MUIA_TextEditor_Pen
, 0, (Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,13), 3, MUIM_Set
, MUIA_Menuitem_Checked
, MUIV_TriggerValue
);
825 DoMethod(editor
, MUIM_Notify
, MUIA_TextEditor_Pen
, 1, (Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,14), 3, MUIM_Set
, MUIA_Menuitem_Checked
, MUIV_TriggerValue
);
826 DoMethod(editor
, MUIM_Notify
, MUIA_TextEditor_Pen
, 2, (Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,15), 3, MUIM_Set
, MUIA_Menuitem_Checked
, MUIV_TriggerValue
);
827 DoMethod(editor
, MUIM_Notify
, MUIA_TextEditor_Pen
, 3, (Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,16), 3, MUIM_Set
, MUIA_Menuitem_Checked
, MUIV_TriggerValue
);
828 DoMethod(editor
, MUIM_Notify
, MUIA_TextEditor_Pen
, 4, (Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,17), 3, MUIM_Set
, MUIA_Menuitem_Checked
, MUIV_TriggerValue
);
829 DoMethod(editor
, MUIM_Notify
, MUIA_TextEditor_Pen
, 5, (Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,18), 3, MUIM_Set
, MUIA_Menuitem_Checked
, MUIV_TriggerValue
);
830 DoMethod(editor
, MUIM_Notify
, MUIA_TextEditor_Pen
, 6, (Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,19), 3, MUIM_Set
, MUIA_Menuitem_Checked
, MUIV_TriggerValue
);
831 DoMethod(editor
, MUIM_Notify
, MUIA_TextEditor_Pen
, 7, (Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,20), 3, MUIM_Set
, MUIA_Menuitem_Checked
, MUIV_TriggerValue
);
832 DoMethod(editor
, MUIM_Notify
, MUIA_TextEditor_Pen
, 8, (Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,21), 3, MUIM_Set
, MUIA_Menuitem_Checked
, MUIV_TriggerValue
);
834 DoMethod(editor
, MUIM_Notify
, MUIA_TextEditor_AreaMarked
, MUIV_EveryTime
, MUIV_Notify_Self
, 7, MUIM_MultiSet
, MUIA_Menuitem_Enabled
, MUIV_TriggerValue
, (Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,1), (Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,2), (Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
,4), NULL
);
836 DoMethod(editor
, MUIM_Notify
, MUIA_TextEditor_UndoAvailable
, MUIV_EveryTime
, (Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
, 5), 3, MUIM_Set
, MUIA_Menuitem_Enabled
, MUIV_TriggerValue
);
837 DoMethod(editor
, MUIM_Notify
, MUIA_TextEditor_RedoAvailable
, MUIV_EveryTime
, (Object
*)DoMethod(data
->editpopup
,MUIM_FindUData
, 6), 3, MUIM_Set
, MUIA_Menuitem_Enabled
, MUIV_TriggerValue
);