Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git] / workbench / classes / zune / betterstring / mcp / CreatePrefsGroup.c
blob4808e6122afcec233c1f1b28fd2d1b33f7ca7cda
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/
19 $Id$
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"
31 #include "locale.h"
32 #include "private.h"
33 #ifndef __AROS__
34 #include "muiextra.h"
35 #else
36 #endif
37 #include "rev.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,
69 MUIA_Weight, 0,
70 End;
73 #ifdef __AROS__
74 AROS_HOOKPROTONH(DisplayCode, VOID, STRPTR*, place, STRPTR *, item)
75 #else
76 HOOKPROTONH(DisplayCode, VOID, STRPTR* place, STRPTR *item)
77 #endif
79 HOOK_INIT
81 *place++ = *item++;
82 *place++ = "=";
83 *place = *item;
85 HOOK_EXIT
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,
99 End,
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,
107 End,
108 End,
109 End,
111 Child, RectangleObject,
112 MUIA_VertWeight, 10,
113 End,
115 Child, HGroup,
117 Child, ColGroup(2),
118 Child, RectangleObject, End,
119 Child, HGroup,
120 MUIA_Group_SameWidth, TRUE,
121 Child, TextObject,
122 MUIA_Font, MUIV_Font_Tiny,
123 MUIA_Text_Contents, GetStr(MSG_Label_Background),
124 MUIA_Text_PreParse, "\33c",
125 End,
126 Child, TextObject,
127 MUIA_Font, MUIV_Font_Tiny,
128 MUIA_Text_Contents, GetStr(MSG_Label_Text),
129 MUIA_Text_PreParse, "\33c",
130 End,
131 End,
133 Child, TxtLabel(GetStr(MSG_Label_Inactive)),
134 Child, HGroup,
135 Child, objs[InactiveBack] = PopimageObject,
136 MUIA_Imageadjust_Type, 2,
137 MUIA_CycleChain, TRUE,
138 End,
139 Child, objs[InactiveText] = PoppenObject,
140 MUIA_CycleChain, TRUE,
141 End,
142 End,
144 Child, TxtLabel(GetStr(MSG_Label_Active)),
145 Child, HGroup,
146 Child, objs[ActiveBack] = PopimageObject,
147 MUIA_Imageadjust_Type, 2,
148 MUIA_CycleChain, TRUE,
149 End,
150 Child, objs[ActiveText] = PoppenObject,
151 MUIA_CycleChain, TRUE,
152 End,
153 End,
155 Child, RectangleObject, End,
156 Child, RectangleObject,
157 MUIA_Rectangle_HBar, TRUE,
158 MUIA_VertWeight, 10,
159 End,
161 Child, TxtLabel(GetStr(MSG_Label_Cursor)),
162 Child, objs[Cursor] = PoppenObject,
163 MUIA_CycleChain, TRUE,
164 End,
166 Child, TxtLabel(GetStr(MSG_Label_Marked)),
167 Child, HGroup,
168 Child, objs[MarkedBack] = PoppenObject,
169 MUIA_CycleChain, TRUE,
170 End,
171 Child, objs[MarkedText] = PoppenObject,
172 MUIA_CycleChain, TRUE,
173 End,
174 End,
176 End,
178 Child, RectangleObject,
179 MUIA_Rectangle_VBar, TRUE,
180 MUIA_HorizWeight, 10,
181 End,
183 Child, ColGroup(2),
184 Child, TxtLabel(GetStr(MSG_Label_Fonts)),
185 Child, PopaslObject,
186 MUIA_Popstring_String, objs[Font] = BetterStringObject, StringFrame,
187 MUIA_CycleChain, TRUE,
188 End,
189 MUIA_Popstring_Button, MUI_MakeObject(MUIO_PopButton, MUII_PopUp),
190 MUIA_Popasl_Type, ASL_FontRequest,
191 End,
193 Child, TxtLabel(GetStr(MSG_Label_Frame)),
194 Child, objs[Frame] = PopframeObject,
195 MUIA_CycleChain, TRUE,
196 End,
197 End,
199 End,
201 Child, RectangleObject,
202 MUIA_VertWeight, 10,
203 End,
205 Child, CrawlingObject, TextFrame,
206 MUIA_Background, MUII_TextBack,
207 MUIA_Virtgroup_Input, FALSE,
208 MUIA_FixHeightTxt, "\n\n",
209 Child, TextObject,
210 MUIA_Text_Contents, "BetterString.mcp V" LIB_REV_STRING " (" LIB_DATE ")\n"
211 "Copyright 1997-2000 Allan Odgaard\n"
212 LIB_COPYRIGHT "\n\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",
216 End,
217 End,
219 End;
221 if(MUIMasterBase->lib_Version <= 19 && objs[Frame])
222 set(objs[Frame], MUIA_Disabled, TRUE);
224 return group;