1 /***************************************************************************
3 BetterString.mcc - A better String gadget MUI Custom Class
4 Copyright (C) 1997-2000 Allan Odgaard
5 Copyright (C) 2005 by BetterString.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 BetterString class Support Site: http://www.sf.net/projects/bstring-mcc/
21 ***************************************************************************/
23 #include <proto/intuition.h>
24 #include <proto/muimaster.h>
25 #include <exec/libraries.h>
26 #include <libraries/asl.h>
27 #include <libraries/mui.h>
29 #include "BetterString_mcc.h"
39 STRPTR Key1
[] = { "Amiga + c", "Copy all or marked text" };
40 STRPTR Key2
[] = { "Amiga + x", "Cut all or marked text" };
41 STRPTR Key3
[] = { "Amiga + v", "Paste" };
42 STRPTR Key4
[] = { "Amiga + z", "Undo last deletion" };
43 STRPTR Key5
[] = { "Amiga + Z", "Redo last deletion" };
44 STRPTR Key6
[] = { "Amiga + q", "Toggle between original and modified buffer" };
45 STRPTR Key7
[] = { "Amiga + g", "Toggle case on char" };
46 STRPTR Key8
[] = { "Amiga + G", "Toggle case on word" };
47 STRPTR Key9
[] = { "Amiga + i", "Increase number" };
48 STRPTR Key10
[] = { "Amiga + d", "Decrease number" };
49 STRPTR Key11
[] = { "Amiga + #", "Hex to decimal" };
50 STRPTR Key12
[] = { "Amiga + $", "Decimal to hex" };
51 STRPTR Key13
[] = { "Amiga + Tab", "Filenamecompletion (use shift to cycle back)" };
53 STRPTR Key14
[] = { "Ctrl + crsr", "Mark" };
54 STRPTR Key15
[] = { "Ctrl + bs/del", "Delete to start/end of line" };
55 STRPTR Key16
[] = { "Shift + crsr", "Go to start/end of line" };
56 STRPTR Key17
[] = { "Shift + bs/del", "Delete to start/end of line" };
57 STRPTR Key18
[] = { "Alt + crsr", "Go to prev/next word" };
58 STRPTR Key19
[] = { "Alt + bs/del", "Delete prev/next word" };
60 STRPTR
*Keyinfo
[] = { Key1
, Key2
, Key3
, Key4
, Key5
, Key6
, Key7
, Key8
, Key9
, Key10
, Key11
, Key12
, Key13
, Key14
, Key15
, Key16
, Key17
, Key18
, Key19
, NULL
};
62 Object
*TxtLabel (STRPTR text
)
64 return TextObject
, ImageButtonFrame
,
65 MUIA_FramePhantomHoriz
, TRUE
,
66 MUIA_Text_PreParse
, "\33r",
67 MUIA_Text_SetVMax
, FALSE
,
68 MUIA_Text_Contents
, text
,
74 AROS_HOOKPROTONH(DisplayCode
, VOID
, STRPTR
*, place
, STRPTR
*, item
)
76 HOOKPROTONH(DisplayCode
, VOID
, STRPTR
* place
, STRPTR
*item
)
87 MakeStaticHook(DisplayHook
, DisplayCode
);
89 Object
*CreatePrefsGroup(struct InstData_MCP
*data
)
91 Object
**objs
= data
->Objects
;
92 Object
*group
= VGroup
,
94 Child
, PopobjectObject
,
95 MUIA_Popstring_String
, BetterStringObject
, StringFrame
,
96 MUIA_String_Contents
, GetStr(MSG_String_TestString
),
97 MUIA_String_Format
, MUIV_String_Format_Center
,
98 MUIA_CycleChain
, TRUE
,
100 MUIA_Popstring_Button
, PopButton(MUII_PopUp
),
101 MUIA_Popobject_Object
, ListviewObject
,
102 MUIA_Listview_Input
, FALSE
,
103 MUIA_Listview_List
, ListObject
, ReadListFrame
,
104 MUIA_List_DisplayHook
, &DisplayHook
,
105 MUIA_List_Format
, ",,",
106 MUIA_List_SourceArray
, Keyinfo
,
111 Child
, RectangleObject
,
118 Child
, RectangleObject
, End
,
120 MUIA_Group_SameWidth
, TRUE
,
122 MUIA_Font
, MUIV_Font_Tiny
,
123 MUIA_Text_Contents
, GetStr(MSG_Label_Background
),
124 MUIA_Text_PreParse
, "\33c",
127 MUIA_Font
, MUIV_Font_Tiny
,
128 MUIA_Text_Contents
, GetStr(MSG_Label_Text
),
129 MUIA_Text_PreParse
, "\33c",
133 Child
, TxtLabel(GetStr(MSG_Label_Inactive
)),
135 Child
, objs
[InactiveBack
] = PopimageObject
,
136 MUIA_Imageadjust_Type
, 2,
137 MUIA_CycleChain
, TRUE
,
139 Child
, objs
[InactiveText
] = PoppenObject
,
140 MUIA_CycleChain
, TRUE
,
144 Child
, TxtLabel(GetStr(MSG_Label_Active
)),
146 Child
, objs
[ActiveBack
] = PopimageObject
,
147 MUIA_Imageadjust_Type
, 2,
148 MUIA_CycleChain
, TRUE
,
150 Child
, objs
[ActiveText
] = PoppenObject
,
151 MUIA_CycleChain
, TRUE
,
155 Child
, RectangleObject
, End
,
156 Child
, RectangleObject
,
157 MUIA_Rectangle_HBar
, TRUE
,
161 Child
, TxtLabel(GetStr(MSG_Label_Cursor
)),
162 Child
, objs
[Cursor
] = PoppenObject
,
163 MUIA_CycleChain
, TRUE
,
166 Child
, TxtLabel(GetStr(MSG_Label_Marked
)),
168 Child
, objs
[MarkedBack
] = PoppenObject
,
169 MUIA_CycleChain
, TRUE
,
171 Child
, objs
[MarkedText
] = PoppenObject
,
172 MUIA_CycleChain
, TRUE
,
178 Child
, RectangleObject
,
179 MUIA_Rectangle_VBar
, TRUE
,
180 MUIA_HorizWeight
, 10,
184 Child
, TxtLabel(GetStr(MSG_Label_Fonts
)),
186 MUIA_Popstring_String
, objs
[Font
] = BetterStringObject
, StringFrame
,
187 MUIA_CycleChain
, TRUE
,
189 MUIA_Popstring_Button
, MUI_MakeObject(MUIO_PopButton
, MUII_PopUp
),
190 MUIA_Popasl_Type
, ASL_FontRequest
,
193 Child
, TxtLabel(GetStr(MSG_Label_Frame
)),
194 Child
, objs
[Frame
] = PopframeObject
,
195 MUIA_CycleChain
, TRUE
,
201 Child
, RectangleObject
,
205 Child
, CrawlingObject
, TextFrame
,
206 MUIA_Background
, MUII_TextBack
,
207 MUIA_Virtgroup_Input
, FALSE
,
208 MUIA_FixHeightTxt
, "\n\n",
210 MUIA_Text_Contents
, "BetterString.mcp V" LIB_REV_STRING
" (" LIB_DATE
")\n"
211 "Copyright 1997-2000 Allan Odgaard\n"
213 "For the latest version, check out:\n"
214 "http://www.sf.net/projects/bstring-mcc/\n\n\n\n",
215 MUIA_Text_PreParse
, "\33c",
221 if(MUIMasterBase
->lib_Version
<= 19 && objs
[Frame
])
222 set(objs
[Frame
], MUIA_Disabled
, TRUE
);