1 /***************************************************************************
3 NListviews.mcp - New Listview MUI Custom Class Preferences
4 Registered MUI class, Serial Number: 1d51 (0x9d510001 to 0x9d51001F
5 and 0x9d510101 to 0x9d51013F)
7 Copyright (C) 1996-2001 by Gilles Masson
8 Copyright (C) 2001-2014 NList Open Source Team
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2.1 of the License, or (at your option) any later version.
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
20 NList classes Support Site: http://www.sf.net/projects/nlist-classes
24 ***************************************************************************/
29 #include <devices/inputevent.h>
30 #include <libraries/asl.h>
31 #include <libraries/locale.h>
32 #include <libraries/commodities.h>
33 #include <mui/HotkeyString_mcc.h>
35 #include <clib/alib_protos.h>
36 #include <proto/commodities.h>
37 #include <proto/muimaster.h>
38 #include <proto/intuition.h>
39 #include <proto/console.h>
40 #include <proto/locale.h>
41 #include <proto/exec.h>
50 #define INTUIBASEMIN 39
53 #define SimpleButtonCycle(name,helpstring) \
57 MUIA_Font, MUIV_Font_Button, \
58 MUIA_Text_Contents, name, \
59 MUIA_Text_PreParse, "\33c", \
60 MUIA_InputMode , MUIV_InputMode_RelVerify, \
61 MUIA_Background , MUII_ButtonBack, \
62 MUIA_ShortHelp, helpstring, \
66 #define ToggleButtonCycle(name,selected,disable,helpstring) \
70 MUIA_Font, MUIV_Font_Button, \
71 MUIA_Text_Contents, name, \
72 MUIA_Text_PreParse, "\33c", \
73 MUIA_Text_SetMax, TRUE, \
74 MUIA_InputMode , MUIV_InputMode_Toggle, \
75 MUIA_Selected , selected,\
76 MUIA_Background , MUII_ButtonBack, \
77 MUIA_Disabled , disable,\
78 MUIA_ShortHelp, helpstring, \
82 MUIA_ShowSelState , FALSE,\
90 static struct QualifierDef QualTab[] =
92 { "SHIFT", (IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT) },
93 { "LSHIFT", IEQUALIFIER_LSHIFT },
94 { "RSHIFT", IEQUALIFIER_RSHIFT },
95 { "CONTROL", IEQUALIFIER_CONTROL },
96 { "ALT", (IEQUALIFIER_LALT|IEQUALIFIER_RALT) },
97 { "LALT", IEQUALIFIER_LALT },
98 { "RALT", IEQUALIFIER_RALT },
99 { "COMMAND", (IEQUALIFIER_LCOMMAND|IEQUALIFIER_RCOMMAND) },
100 { "LCOMMAND", IEQUALIFIER_LCOMMAND },
101 { "RCOMMAND", IEQUALIFIER_RCOMMAND },
102 { "MIDBUTTON", IEQUALIFIER_MIDBUTTON },
103 { "RBUTTON", IEQUALIFIER_RBUTTON },
104 { "LEFTBUTTON", IEQUALIFIER_LEFTBUTTON },
109 Object
*MakeCheck(STRPTR label
, STRPTR help
, ULONG check
)
111 Object
*obj
= MUI_MakeObject(MUIO_Checkmark
, label
);
114 SetAttrs(obj
, MUIA_CycleChain
, 1,
115 MUIA_Selected
, check
,
116 MUIA_ShortHelp
, help
,
123 #define String2(contents,maxlen)\
124 (void *)StringObject,\
127 MUIA_String_MaxLen , maxlen,\
128 MUIA_String_Contents, contents,\
131 #define LOAD_DATALONG(obj,attr,cfg_attr,defaultval) \
134 if((ptrd = (ULONG *) DoMethod(msg->configdata, MUIM_Dataspace_Find, cfg_attr))) \
135 set(obj, attr, *ptrd); \
137 set(obj, attr, defaultval); \
140 #define SAVE_DATALONG(obj,attr,cfg_attr) \
143 get(obj, attr, &ptrd); \
144 DoMethod(msg->configdata, MUIM_Dataspace_Add, &ptrd, sizeof(ptrd), cfg_attr); \
147 #define LOAD_DATASPEC(obj,attr,cfg_attr,defaultval) \
150 if((ptrd = DoMethod(msg->configdata, MUIM_Dataspace_Find, cfg_attr))) \
151 set(obj, attr, ptrd); \
153 set(obj, attr, defaultval); \
156 #define SAVE_DATASPEC(obj,attr,cfg_attr) \
159 get(obj, attr, &ptrd); \
161 DoMethod(msg->configdata, MUIM_Dataspace_Add, ptrd, strlen((char *)ptrd)+1, cfg_attr); \
164 #define SAVE_DATASPEC2(obj,attr,cfg_attr) \
167 get(obj, attr, &ptrd); \
169 DoMethod(msg->configdata, MUIM_Dataspace_Add, ptrd, strlen((char *)ptrd)+1, cfg_attr); \
172 #define LOAD_DATAFONT(obj,cfg_attr) \
175 if((ptrd = DoMethod(msg->configdata, MUIM_Dataspace_Find, cfg_attr))) \
176 set(obj, MUIA_String_Contents, ptrd); \
178 set(obj, MUIA_String_Contents, ""); \
181 #define SAVE_DATAFONT(obj,cfg_attr) \
184 get(obj, MUIA_String_Contents, &ptrd); \
187 LONG dlen = strlen((char *) ptrd) + 1; \
189 DoMethod(msg->configdata, MUIM_Dataspace_Add, ptrd, dlen, cfg_attr); \
191 DoMethod(msg->configdata, MUIM_Dataspace_Remove, cfg_attr); \
195 /* *********************************************************************** */
197 static DEFAULT_KEYS_ARRAY
199 static ULONG keytags
[] =
201 KEYTAG_QUALIFIER_MULTISELECT
,
202 KEYTAG_QUALIFIER_DRAG
,
203 KEYTAG_QUALIFIER_BALANCE
,
204 KEYTAG_COPY_TO_CLIPBOARD
,
205 KEYTAG_DEFAULT_WIDTH_COLUMN
,
206 KEYTAG_DEFAULT_WIDTH_ALL_COLUMNS
,
207 KEYTAG_DEFAULT_ORDER_COLUMN
,
208 KEYTAG_DEFAULT_ORDER_ALL_COLUMNS
,
209 KEYTAG_SELECT_TO_TOP
,
210 KEYTAG_SELECT_TO_BOTTOM
,
211 KEYTAG_SELECT_TO_PAGE_UP
,
212 KEYTAG_SELECT_TO_PAGE_DOWN
,
215 KEYTAG_TOGGLE_ACTIVE
,
216 KEYTAG_QUALIFIER_WHEEL_FAST
,
217 KEYTAG_QUALIFIER_WHEEL_HORIZ
,
218 KEYTAG_QUALIFIER_TITLECLICK2
,
224 static struct KeyBinding empty_key
= { 0, (UWORD
)-1, 0 };
226 /* *********************************************************************** */
229 static const char *MainTextArray[] =
231 "If you have problems, try to increase the stack value,",
232 "in the icon infos if you launch the program from icon,",
233 "stack of CLI if you start it from CLI/Shell,",
234 "and if you launch it from some utility read its docs",
235 "to see how to increase it.",
236 "A stack of 12Kb, 16Kb or 20Kb is most of time a good idea.",
238 "If you still have problems, try to see if they happen with the Demo prog, then tell me.",
240 "Latest public release can be found on aminet (dev/mui).",
241 "All releases are available on",
242 "http://www.sourceforge.net/projects/nlist-classes/",
244 "\033r\0333(C) 2001-2013 by NList Open Source Team",
245 "\033r\0333(C) 1996-1998 by Gilles Masson",
246 "\033r\0333http://www.sourceforge.net/projects/nlist-classes/",
248 "\033cThis new list/listview custom class",
249 "\033chandles its own configurable backgrounds,",
250 "\033cpens, fonts, scrollbars, keys and qualifiers",
252 "\033cThe way used to handle cursor with multiselection",
253 "\033cis not exactly as the listview one !",
254 "\033cDrag&Drop is supported, both scrollbars",
255 "\033ccan be configured to disappear automatically",
256 "\033cwhen not needed because all is visible.",
257 "\033cJust try it...",
259 "\033cYou can horizontaly scroll with cursor keys,",
260 "\033cor going on the right and left of the list",
261 "\033cwhile selecting with the mouse.",
262 "\033cTry just clicking on the left/right borders !",
264 "\033cYou can change columns widths just dragging",
265 "\033cthe vertical separator between columns titles",
266 "\033c(try it using the balancing qualifier too).",
268 "\033cYou can change columns order just dragging",
269 "\033cthe column titles.",
271 "\033cThere is builtin copy to clipboard stuff",
272 "\033cand classic char selection capability.",
274 "\033cTry the Demo program to test all that...",
277 "\033r\033bGive some feedback about it ! :-)",
279 "**************************************************************************************************",
284 // static arrays which we fill up later on
285 static const char *Pages
[6];
286 static const char *RS_ColWidthDrag
[4];
287 static const char *RS_VSB
[4];
288 static const char *RS_HSB
[5];
289 static const char *RS_Menu
[4];
290 static const char *RS_MultiSelects
[3];
291 static const char *RS_DragTypes
[4];
292 static const char *functions_names
[20];
294 static LONG
DeadKeyConvert(struct NListviews_MCP_Data
*data
,struct KeyBinding
*key
)
296 char *text
= data
->rawtext
;
298 UWORD qual
= key
->kb_Qualifier
& KBQUAL_MASK
;
299 UWORD same
= key
->kb_Qualifier
& KBSYM_MASK
;
305 { if ((qual
& KBQUALIFIER_CAPS
) && (same
& KBSYM_CAPS
))
306 strlcat(text
, (char *)"caps ", sizeof(data
->rawtext
));
307 else if ((qual
& KBQUALIFIER_SHIFT
) && (same
& KBSYM_SHIFT
))
308 { strlcat(text
, (char *)"shift ", sizeof(data
->rawtext
));
309 if (qual
& IEQUALIFIER_CAPSLOCK
) strlcat(text
, (char *)"capslock ", sizeof(data
->rawtext
));
312 { if (qual
& IEQUALIFIER_LSHIFT
) strlcat(text
, (char *)"lshift ", sizeof(data
->rawtext
));
313 if (qual
& IEQUALIFIER_RSHIFT
) strlcat(text
, (char *)"rshift ", sizeof(data
->rawtext
));
314 if (qual
& IEQUALIFIER_CAPSLOCK
) strlcat(text
, (char *)"capslock ", sizeof(data
->rawtext
));
316 if (qual
& IEQUALIFIER_CONTROL
) strlcat(text
, (char *)"control ", sizeof(data
->rawtext
));
317 if ((qual
& KBQUALIFIER_ALT
) && (same
& KBSYM_ALT
))
318 strlcat(text
, (char *)"alt ", sizeof(data
->rawtext
));
320 { if (qual
& IEQUALIFIER_LALT
) strlcat(text
, (char *)"lalt ", sizeof(data
->rawtext
));
321 if (qual
& IEQUALIFIER_RALT
) strlcat(text
, (char *)"ralt ", sizeof(data
->rawtext
));
323 if (qual
& IEQUALIFIER_LCOMMAND
) strlcat(text
, (char *)"lcommand ", sizeof(data
->rawtext
));
324 if (qual
& IEQUALIFIER_RCOMMAND
) strlcat(text
, (char *)"rcommand ", sizeof(data
->rawtext
));
325 if (qual
& IEQUALIFIER_NUMERICPAD
) strlcat(text
, (char *)"numpad ", sizeof(data
->rawtext
));
328 if (!(key
->kb_KeyTag
& 0x00004000) && (key
->kb_Code
!= (UWORD
)~0))
330 switch (key
->kb_Code
& 0x7F)
332 case 0x40 : strlcat(text
,"space", sizeof(data
->rawtext
)); break;
333 case 0x41 : strlcat(text
,"backspace", sizeof(data
->rawtext
)); break;
334 case 0x42 : strlcat(text
,"tab", sizeof(data
->rawtext
)); break;
335 case 0x43 : strlcat(text
,"enter", sizeof(data
->rawtext
)); break;
336 case 0x44 : strlcat(text
,"return", sizeof(data
->rawtext
)); break;
337 case 0x45 : strlcat(text
,"esc", sizeof(data
->rawtext
)); break;
338 case 0x46 : strlcat(text
,"del", sizeof(data
->rawtext
)); break;
339 case 0x4C : strlcat(text
,"up", sizeof(data
->rawtext
)); break;
340 case 0x4D : strlcat(text
,"down", sizeof(data
->rawtext
)); break;
341 case 0x4E : strlcat(text
,"right", sizeof(data
->rawtext
)); break;
342 case 0x4F : strlcat(text
,"left", sizeof(data
->rawtext
)); break;
343 case 0x50 : strlcat(text
,"f1", sizeof(data
->rawtext
)); break;
344 case 0x51 : strlcat(text
,"f2", sizeof(data
->rawtext
)); break;
345 case 0x52 : strlcat(text
,"f3", sizeof(data
->rawtext
)); break;
346 case 0x53 : strlcat(text
,"f4", sizeof(data
->rawtext
)); break;
347 case 0x54 : strlcat(text
,"f5", sizeof(data
->rawtext
)); break;
348 case 0x55 : strlcat(text
,"f6", sizeof(data
->rawtext
)); break;
349 case 0x56 : strlcat(text
,"f7", sizeof(data
->rawtext
)); break;
350 case 0x57 : strlcat(text
,"f8", sizeof(data
->rawtext
)); break;
351 case 0x58 : strlcat(text
,"f9", sizeof(data
->rawtext
)); break;
352 case 0x59 : strlcat(text
,"f10", sizeof(data
->rawtext
)); break;
353 case 0x5F : strlcat(text
,"help", sizeof(data
->rawtext
)); break;
355 data
->ievent
.ie_NextEvent
= NULL
;
356 data
->ievent
.ie_Class
= IECLASS_RAWKEY
;
357 data
->ievent
.ie_SubClass
= 0;
358 data
->ievent
.ie_Code
= key
->kb_Code
;
359 data
->ievent
.ie_Qualifier
= 0;
360 data
->ievent
.ie_position
.ie_addr
= (APTR
) &data
->ievent
;
361 posraw
= RawKeyConvert(&data
->ievent
, keystr
, sizeof(keystr
), 0L);
365 keystr
[posraw
] = '\0';
366 strlcat(text
, keystr
, sizeof(data
->rawtext
));
372 return ((LONG
)strlen(data
->rawtext
));
376 static LONG
NL_SaveKeys(struct NListviews_MCP_Data
*data
)
379 struct KeyBinding
*key
;
381 get(data
->mcp_listkeys
, MUIA_NList_Entries
, &ne
);
384 if((data
->nlkeys
= (struct KeyBinding
*)AllocVecShared(ne
*sizeof(struct KeyBinding
),MEMF_ANY
)))
390 DoMethod(data
->mcp_listkeys
,MUIM_NList_GetEntry
,pos
, &key
);
393 data
->nlkeys
[pos
] = *key
;
394 if (data
->nlkeys
[pos
].kb_KeyTag
& 0x00004000)
395 data
->nlkeys
[pos
].kb_Code
= (UWORD
)~0;
402 data
->nlkeys
[pos
].kb_KeyTag
= 0L;
403 data
->nlkeys
[pos
].kb_Code
= (UWORD
)~0;
404 data
->nlkeys
[pos
].kb_Qualifier
= 0;
406 ne
= ((pos
* sizeof(struct KeyBinding
)) + 3) & 0xFFFFFFFC;
415 static void NL_LoadKeys(Object
*list
,struct KeyBinding
*keys
)
419 set(list
, MUIA_NList_Quiet
, TRUE
);
420 DoMethod(list
,MUIM_NList_Clear
);
421 while (keys
[i
].kb_KeyTag
)
423 DoMethod(list
,MUIM_NList_InsertSingle
,&keys
[i
], MUIV_NList_Insert_Bottom
);
426 set(list
, MUIA_NList_Quiet
, FALSE
);
430 static void NL_UpdateKeys(Object
*list
,struct KeyBinding
*keys
)
433 LONG pos
,posmax
= -1;
434 struct KeyBinding
*key
;
435 set(list
, MUIA_NList_Quiet
, TRUE
);
436 get(list
,MUIA_NList_Entries
,&posmax
);
437 for (i
= 0; keys
[i
].kb_KeyTag
; i
++)
439 for (pos
= 0; pos
< posmax
; pos
++)
441 DoMethod(list
,MUIM_NList_GetEntry
, pos
, &key
);
442 if (key
&& (key
->kb_KeyTag
== keys
[i
].kb_KeyTag
))
446 LONG k1 = (LONG) key->kb_KeyTag;
447 LONG k2 = (LONG) keys[i].kb_KeyTag;
448 kprintf("%lx|pos=%ld key=%lx kt=%lx (== %lx)\n",list,pos,key,k1,k2);
452 LONG k1 = (LONG) key->kb_KeyTag;
453 LONG k2 = (LONG) keys[i].kb_KeyTag;
454 kprintf("%lx|pos=%ld key=%lx kt=%lx (!= %lx)\n",list,pos,key,k1,k2);
459 DoMethod(list
,MUIM_NList_InsertSingle
,&keys
[i
], MUIV_NList_Insert_Bottom
);
461 set(list
, MUIA_NList_Quiet
, FALSE
);
464 HOOKPROTONH(StrObjFunc
, LONG
, Object
*pop
, Object
*str
)
468 get(str
,MUIA_UserData
,&i
);
470 set(pop
,MUIA_List_Active
,i
);
472 set(pop
,MUIA_List_Active
,MUIV_List_Active_Off
);
475 MakeStaticHook(StrObjHook
, StrObjFunc
);
477 HOOKPROTONH(ObjStrFunc
, VOID
, Object
*pop
, Object
*str
)
480 get(pop
,MUIA_List_Active
,&i
);
483 set(str
,MUIA_UserData
,i
);
484 set(str
,MUIA_Text_Contents
,functions_names
[i
]);
488 set(str
,MUIA_UserData
,i
);
489 set(str
,MUIA_Text_Contents
,"");
492 MakeStaticHook(ObjStrHook
, ObjStrFunc
);
495 HOOKPROTONH(WindowFunc
, VOID
, Object
*pop
, Object
*win
)
497 set(win
,MUIA_Window_DefaultObject
,pop
);
499 MakeStaticHook(WindowHook
, WindowFunc
);
502 HOOKPROTONH(TxtFctFunc
, VOID
, Object
*list
, long *val
)
504 Object
*txtfct
= (Object
*) val
[0];
505 struct KeyBinding
*key
= NULL
;
508 get(txtfct
,MUIA_UserData
,&i
);
509 DoMethod(list
,MUIM_NList_GetEntry
,MUIV_NList_GetEntry_Active
, &key
);
512 key
->kb_KeyTag
= keytags
[i
];
513 DoMethod(list
,MUIM_NList_Redraw
,MUIV_NList_Redraw_Active
);
514 get(list
,MUIA_NList_Active
,&i
);
515 set(list
,MUIA_NList_Active
,i
);
518 MakeStaticHook(TxtFctHook
, TxtFctFunc
);
520 HOOKPROTONH(AckFunc
, VOID
, Object
*list
, long *val
)
522 Object
*stringkey
= (Object
*) val
[0];
523 struct KeyBinding
*key
= NULL
;
526 get(stringkey
,MUIA_String_Contents
, &ackstr
);
527 DoMethod(list
,MUIM_NList_GetEntry
,MUIV_NList_GetEntry_Active
, &key
);
532 ix
.ix_Version
= IX_VERSION
;
534 key
->kb_Qualifier
= (ix
.ix_Qualifier
& KBQUAL_MASK
) | ((ix
.ix_QualSame
<< 12) & KBSYM_MASK
);
535 key
->kb_Code
= ix
.ix_Code
;
536 DoMethod(list
,MUIM_NList_Redraw
,MUIV_NList_Redraw_Active
);
539 MakeStaticHook(AckHook
, AckFunc
);
541 HOOKPROTONH(ActiveFunc
, VOID
, Object
*list
, long *val
)
543 struct NListviews_MCP_Data
*data
= (struct NListviews_MCP_Data
*) (val
[0]);
544 /* Object *win = NULL;*/
545 ULONG active
= (ULONG
) (val
[1]);
546 struct KeyBinding
*key
= NULL
;
548 if((LONG
)active
>= 0)
550 DoMethod(list
,MUIM_NList_GetEntry
,MUIV_NList_GetEntry_Active
, &key
);
556 while ((keytags
[i
] > 0) && (keytags
[i
] != key
->kb_KeyTag
))
558 if (keytags
[i
] == key
->kb_KeyTag
)
560 nnset(data
->mcp_stringkey
,MUIA_HotkeyString_Snoop
, FALSE
);
561 nnset(data
->mcp_stringkey
,MUIA_Disabled
, FALSE
);
562 nnset(data
->mcp_snoopkey
,MUIA_Disabled
, FALSE
);
563 nnset(data
->mcp_txtfct
,MUIA_UserData
,i
);
564 nnset(data
->mcp_txtfct
,MUIA_Text_Contents
,functions_names
[i
]);
566 DeadKeyConvert(data
,key
);
567 nnset(data
->mcp_stringkey
,MUIA_String_Contents
, data
->rawtext
);
569 get(list, MUIA_WindowObject, &win);
571 set(win, MUIA_Window_ActiveObject, data->mcp_stringkey);
580 nnset(data
->mcp_txtfct
,MUIA_UserData
,-1);
581 nnset(data
->mcp_txtfct
,MUIA_Text_Contents
,"");
582 nnset(data
->mcp_stringkey
,MUIA_String_Contents
, "");
583 nnset(data
->mcp_stringkey
,MUIA_Disabled
, TRUE
);
584 nnset(data
->mcp_snoopkey
,MUIA_Disabled
, TRUE
);
587 MakeStaticHook(ActiveHook
, ActiveFunc
);
590 HOOKPROTONHNP(DefaultFunc
, VOID
, Object
*list
)
593 NL_LoadKeys(list
,default_keys
);
595 MakeStaticHook(DefaultHook
, DefaultFunc
);
597 HOOKPROTONHNP(UpdateFunc
, VOID
, Object
*list
)
600 NL_UpdateKeys(list
,default_keys
);
602 MakeStaticHook(UpdateHook
, UpdateFunc
);
604 HOOKPROTONHNP(InsertFunc
, VOID
, Object
*list
)
608 struct KeyBinding
*key
;
611 DoMethod(list
,MUIM_NList_GetEntry
,MUIV_NList_GetEntry_Active
, &key
);
614 empty_key
.kb_KeyTag
= keytags
[0];
617 set(list
,MUIA_NList_Quiet
,TRUE
);
618 DoMethod(list
,MUIM_NList_InsertSingle
,key
, MUIV_NList_Insert_Active
);
619 get(list
,MUIA_NList_InsertPosition
,&pos
);
620 set(list
,MUIA_NList_Active
,pos
);
621 set(list
,MUIA_NList_Quiet
,FALSE
);
624 MakeStaticHook(InsertHook
, InsertFunc
);
626 HOOKPROTONH(DisplayFunc
, VOID
, Object
*obj
, struct NList_DisplayMessage
*ndm
)
628 struct KeyBinding
*key
= (struct KeyBinding
*) ndm
->entry
;
629 struct NListviews_MCP_Data
*data
= NULL
;
631 get(obj
,MUIA_UserData
,&data
);
637 ndm
->preparses
[0] = (STRPTR
)"\033r";
639 DeadKeyConvert(data
,key
);
640 ndm
->strings
[0] = data
->rawtext
;
642 ndm
->strings
[1] = (STRPTR
)"\033c=";
645 while ((keytags
[i
] > 0) && (keytags
[i
] != key
->kb_KeyTag
))
647 ndm
->strings
[2] = (STRPTR
)functions_names
[i
];
651 ndm
->preparses
[0] = (STRPTR
)"\033r";
652 ndm
->strings
[0] = (STRPTR
)tr(MSG_HOTKEYS_KEY
);
653 ndm
->strings
[1] = (STRPTR
)"";
654 ndm
->strings
[2] = (STRPTR
)tr(MSG_HOTKEYS_ACTION
);
657 MakeStaticHook(DisplayHook
, DisplayFunc
);
659 HOOKPROTONHNO(ConstructFunc
, APTR
, struct NList_ConstructMessage
*ncm
)
661 struct KeyBinding
*key
= (struct KeyBinding
*) ncm
->entry
;
662 struct KeyBinding
*key2
= (struct KeyBinding
*) AllocVecShared(sizeof(struct KeyBinding
),0L);
667 return ((APTR
) key2
);
669 MakeStaticHook(ConstructHook
, ConstructFunc
);
671 HOOKPROTONHNO(DestructFunc
, VOID
, struct NList_DestructMessage
*ndm
)
673 struct KeyBinding
*key
= (struct KeyBinding
*) ndm
->entry
;
675 FreeVec((void *) key
);
677 MakeStaticHook(DestructHook
, DestructFunc
);
679 static IPTR
mNL_MCP_New(struct IClass
*cl
,Object
*obj
,struct opSet
*msg
)
681 struct NListviews_MCP_Data
*data
;
682 APTR group1
, group2
, group3
, group4
, group5
;
687 static const char infotext1
[] = "\033bNListviews.mcp " LIB_REV_STRING
"\033n (" LIB_DATE
")\n"
688 "Copyright (C) 1996-2001 Gilles Masson\n"
690 static const char infotext2
[] = "\n"
691 "Distributed under the terms of the LGPL2.\n"
693 "For the latest version, check out:\n"
694 "http://www.sf.net/projects/nlist-classes/\n"
697 if(!(obj
= (Object
*)DoSuperMethodA(cl
, obj
,(Msg
) msg
)))
700 data
= INST_DATA(cl
,obj
);
702 group1
= group2
= group3
= group4
= group5
= NULL
;
704 data
->mcp_group
= NULL
;
705 data
->mcp_list1
= NULL
;
706 data
->mcp_list2
= NULL
;
707 data
->mcp_PenTitle
= NULL
;
708 data
->mcp_PenList
= NULL
;
709 data
->mcp_PenSelect
= NULL
;
710 data
->mcp_PenCursor
= NULL
;
711 data
->mcp_PenUnselCur
= NULL
;
712 data
->mcp_PenInactive
= NULL
;
713 data
->mcp_BG_Title
= NULL
;
714 data
->mcp_BG_List
= NULL
;
715 data
->mcp_BG_Select
= NULL
;
716 data
->mcp_BG_Cursor
= NULL
;
717 data
->mcp_BG_UnselCur
= NULL
;
718 data
->mcp_BG_Inactive
= NULL
;
719 data
->mcp_R_Multi
= NULL
;
720 data
->mcp_B_MultiMMB
= NULL
;
721 data
->mcp_R_Drag
= NULL
;
722 data
->mcp_SL_VertInc
= NULL
;
723 data
->mcp_R_HSB
= NULL
;
724 data
->mcp_R_VSB
= NULL
;
725 data
->mcp_B_Smooth
= NULL
;
726 data
->mcp_Font
= NULL
;
727 data
->mcp_Font_Little
= NULL
;
728 data
->mcp_Font_Fixed
= NULL
;
729 data
->mcp_ForcePen
= NULL
;
730 data
->mcp_ColWidthDrag
= NULL
;
731 data
->mcp_PartialCol
= NULL
;
732 data
->mcp_List_Select
= NULL
;
733 data
->mcp_NList_Menu
= NULL
;
734 data
->mcp_PartialChar
= NULL
;
735 data
->mcp_SerMouseFix
= NULL
;
736 data
->mcp_DragLines
= NULL
;
737 data
->mcp_WheelStep
= NULL
;
738 data
->mcp_WheelFast
= NULL
;
739 data
->mcp_WheelMMB
= NULL
;
740 data
->mcp_listkeys
= NULL
;
741 data
->mcp_stringkey
= NULL
;
742 data
->mcp_snoopkey
= NULL
;
743 data
->mcp_insertkey
= NULL
;
744 data
->mcp_removekey
= NULL
;
745 data
->mcp_defaultkeys
= NULL
;
746 data
->mcp_updatekeys
= NULL
;
747 data
->mcp_txtfct
= NULL
;
748 data
->mcp_popstrfct
= NULL
;
749 data
->mcp_poplistfct
= NULL
;
752 data
->mcp_stringkey
= HotkeyStringObject
,
753 StringFrame
, MUIA_CycleChain
, 1,
754 MUIA_HotkeyString_Snoop
, FALSE
,
758 if(data
->mcp_stringkey
== NULL
)
760 data
->mcp_stringkey
= StringObject
,
761 StringFrame
, MUIA_CycleChain
, 1,
765 // create a duplicate of the translated text
766 if((exampleText
= AllocVecShared((strlen(tr(MSG_EXAMPLE_TEXT
))+1)*sizeof(char), MEMF_ANY
)) != NULL
)
772 strcpy(exampleText
, tr(MSG_EXAMPLE_TEXT
));
774 // count the number of lines
776 while((p
= strchr(p
, '\n')) != NULL
)
782 // finally split the text into separate lines
783 if((data
->exampleText
= AllocVecShared((numLines
+2)*sizeof(char *), MEMF_ANY
|MEMF_CLEAR
)) != NULL
)
788 for(line
= 0; line
< numLines
; line
++)
794 data
->exampleText
[line
] = AllocVecShared((strlen(p
)+1)*sizeof(char), MEMF_ANY
);
795 strcpy(data
->exampleText
[line
], p
);
800 FreeVec(exampleText
);
803 mui39
= LIB_VERSION_IS_AT_LEAST(MUIMasterBase
, 20, 0);
805 group1
= GroupObject
,
808 GroupFrameT(tr(MSG_GROUP_EXAMPLE
)),
810 Child
, data
->mcp_list1
= NListviewObject
,
812 MUIA_NList_Title
,"\033cNList / NListview",
813 MUIA_NList_TitleSeparator
, TRUE
,
814 MUIA_NListview_Vert_ScrollBar
, MUIV_NListview_VSB_Default
,
815 MUIA_NListview_Horiz_ScrollBar
, MUIV_NListview_HSB_Default
,
816 MUIA_NList_DefaultObjectOnClick
, TRUE
,
817 MUIA_NList_SourceArray
, data
->exampleText
/*MainTextArray*/,
822 GroupFrameT(tr(MSG_FONTS
)),
824 MUIA_Group_Columns
, 2,
826 MUIA_Weight
,(ULONG
)30,
827 Child
, Label(tr(MSG_NORMAL_FONT
)),
828 Child
, data
->mcp_Font
= PopaslObject
,
829 MUIA_Popstring_String
, String2(0,80),
830 MUIA_Popstring_Button
, PopButton(mui39
== TRUE
? MUII_PopFont
: MUII_PopUp
),
831 MUIA_Popasl_Type
, ASL_FontRequest
,
832 MUIA_ShortHelp
, tr(MSG_NORMAL_FONT_HELP
),
833 ASLFO_TitleText
, tr(MSG_NORMAL_FONT_ASL
),
836 Child
, Label(tr(MSG_SMALL_FONT
)),
837 Child
, data
->mcp_Font_Little
= PopaslObject
,
838 MUIA_Popstring_String
, String2(0,80),
839 MUIA_Popstring_Button
, PopButton(mui39
== TRUE
? MUII_PopFont
: MUII_PopUp
),
840 MUIA_Popasl_Type
, ASL_FontRequest
,
841 MUIA_ShortHelp
, tr(MSG_SMALL_FONT_HELP
),
842 ASLFO_TitleText
, tr(MSG_SMALL_FONT_ASL
),
845 Child
, Label(tr(MSG_FIXED_FONT
)),
846 Child
, data
->mcp_Font_Fixed
= PopaslObject
,
847 MUIA_Popstring_String
, String2(0,80),
848 MUIA_Popstring_Button
, PopButton(mui39
== TRUE
? MUII_PopFont
: MUII_PopUp
),
849 MUIA_Popasl_Type
, ASL_FontRequest
,
850 MUIA_ShortHelp
, tr(MSG_FIXED_FONT_HELP
),
851 ASLFO_TitleText
, tr(MSG_FIXED_FONT_ASL
),
852 ASLFO_FixedWidthOnly
, TRUE
,
855 Child
, Label(tr(MSG_FONT_MARGIN
)),
856 Child
, data
->mcp_SL_VertInc
= SliderObject
,
860 MUIA_Numeric_Value
, 1,
861 MUIA_ShortHelp
, tr(MSG_FONT_MARGIN_HELP
),
869 GroupFrameT(tr(MSG_COLORS
)),
872 MUIA_Group_Columns
, 3,
874 Child
, RectangleObject
,
876 MUIA_Rectangle_HBar
, TRUE
,
877 MUIA_Rectangle_BarTitle
, tr(MSG_TEXTCOLOR
),
880 Child
, RectangleObject
,
882 MUIA_Rectangle_HBar
, TRUE
,
883 MUIA_Rectangle_BarTitle
, tr(MSG_BACKGROUNDCOLOR
),
886 Child
, data
->mcp_PenTitle
= PoppenObject
,
888 MUIA_Window_Title
, tr(MSG_TITLE_PEN_WIN
),
889 MUIA_Draggable
, TRUE
,
890 MUIA_ShortHelp
, tr(MSG_TITLE_PEN_HELP
),
892 Child
, VCenter(Label(tr(MSG_PBG_TITLE
))),
893 Child
, data
->mcp_BG_Title
= PopimageObject
,
895 MUIA_Imageadjust_Type
, MUIV_Imageadjust_Type_Background
,
896 MUIA_Window_Title
, tr(MSG_TITLE_BG_WIN
),
897 MUIA_Draggable
, TRUE
,
898 MUIA_ShortHelp
, tr(MSG_TITLE_BG_HELP
),
901 Child
, data
->mcp_PenList
= PoppenObject
,
903 MUIA_Window_Title
, tr(MSG_LIST_PEN_WIN
),
904 MUIA_Draggable
, TRUE
,
905 MUIA_ShortHelp
, tr(MSG_LIST_PEN_HELP
),
907 Child
, VCenter(Label(tr(MSG_PBG_LIST
))),
908 Child
, data
->mcp_BG_List
= PopimageObject
,
910 MUIA_Imageadjust_Type
, MUIV_Imageadjust_Type_Background
,
911 MUIA_Window_Title
, tr(MSG_LIST_BG_WIN
),
912 MUIA_Draggable
, TRUE
,
913 MUIA_ShortHelp
, tr(MSG_LIST_BG_HELP
),
916 Child
, data
->mcp_PenSelect
= PoppenObject
,
918 MUIA_Window_Title
, tr(MSG_SELECT_PEN_WIN
),
919 MUIA_Draggable
, TRUE
,
920 MUIA_ShortHelp
, tr(MSG_SELECT_PEN_HELP
),
922 Child
, VCenter(Label(tr(MSG_PBG_SELECT
))),
923 Child
, data
->mcp_BG_Select
= PopimageObject
,
925 MUIA_Imageadjust_Type
, MUIV_Imageadjust_Type_Background
,
926 MUIA_Window_Title
, tr(MSG_SELECT_BG_WIN
),
927 MUIA_Draggable
, TRUE
,
928 MUIA_ShortHelp
, tr(MSG_SELECT_BG_HELP
),
931 Child
, data
->mcp_PenCursor
= PoppenObject
,
933 MUIA_Window_Title
, tr(MSG_CURSOR_PEN_WIN
),
934 MUIA_Draggable
, TRUE
,
935 MUIA_ShortHelp
, tr(MSG_CURSOR_PEN_HELP
),
937 Child
, VCenter(Label(tr(MSG_PBG_CURSOR
))),
938 Child
, data
->mcp_BG_Cursor
= PopimageObject
,
940 MUIA_Imageadjust_Type
, MUIV_Imageadjust_Type_Background
,
941 MUIA_Window_Title
, tr(MSG_CURSOR_BG_WIN
),
942 MUIA_Draggable
, TRUE
,
943 MUIA_ShortHelp
, tr(MSG_CURSOR_BG_HELP
),
946 Child
, data
->mcp_PenUnselCur
= PoppenObject
,
948 MUIA_Window_Title
, tr(MSG_UNSEL_PEN_WIN
),
949 MUIA_Draggable
, TRUE
,
950 MUIA_ShortHelp
, tr(MSG_UNSEL_PEN_HELP
),
952 Child
, VCenter(Label(tr(MSG_PBG_UNSEL
))),
953 Child
, data
->mcp_BG_UnselCur
= PopimageObject
,
955 MUIA_Imageadjust_Type
, MUIV_Imageadjust_Type_Background
,
956 MUIA_Window_Title
, tr(MSG_UNSEL_BG_WIN
),
957 MUIA_Draggable
, TRUE
,
958 MUIA_ShortHelp
, tr(MSG_UNSEL_BG_HELP
),
961 Child
, data
->mcp_PenInactive
= PoppenObject
,
963 MUIA_Window_Title
, tr(MSG_INACT_PEN_WIN
),
964 MUIA_Draggable
, TRUE
,
965 MUIA_ShortHelp
, tr(MSG_INACT_PEN_HELP
),
967 Child
, VCenter(Label(tr(MSG_PBG_INACT
))),
968 Child
, data
->mcp_BG_Inactive
= PopimageObject
,
970 MUIA_Imageadjust_Type
, MUIV_Imageadjust_Type_Background
,
971 MUIA_Window_Title
, tr(MSG_INACT_BG_WIN
),
972 MUIA_Draggable
, TRUE
,
973 MUIA_ShortHelp
, tr(MSG_INACT_BG_HELP
),
979 GroupFrameT(tr(MSG_COLOR_OPTIONS
)),
985 Child
, data
->mcp_ForcePen
= ImageObject
,
987 MUIA_InputMode
, MUIV_InputMode_Toggle
,
988 MUIA_Image_Spec
, MUII_CheckMark
,
989 MUIA_Image_FreeVert
, TRUE
,
990 MUIA_Background
, MUII_ButtonBack
,
991 MUIA_ShowSelState
, FALSE
,
993 Child
, Label(tr(MSG_FORCE_SELECT_PEN
)),
994 MUIA_ShortHelp
, tr(MSG_FORCE_SELECT_PEN_HELP
),
1001 RS_VSB
[0] = tr(MSG_VSB_ALWAYS
);
1002 RS_VSB
[1] = tr(MSG_VSB_AUTO
);
1003 RS_VSB
[2] = tr(MSG_VSB_FULLAUTO
);
1006 RS_HSB
[0] = tr(MSG_HSB_ALWAYS
);
1007 RS_HSB
[1] = tr(MSG_HSB_AUTO
);
1008 RS_HSB
[2] = tr(MSG_HSB_FULLAUTO
);
1009 RS_HSB
[3] = tr(MSG_HSB_NONE
);
1012 #if defined(__amigaos3__) || defined(__amigaos4__)
1013 if(LIB_VERSION_IS_AT_LEAST(MUIMasterBase
, 20, 5824))
1015 // MUI4 for AmigaOS is safe for V20.5824+
1016 safeNotifies
= TRUE
;
1018 else if(LIB_VERSION_IS_AT_LEAST(MUIMasterBase
, 20, 2346) && LIBREV(MUIMasterBase
) < 5000)
1020 // MUI3.9 for AmigaOS is safe for V20.2346+
1021 safeNotifies
= TRUE
;
1025 // MUI 3.8 and older version of MUI 3.9 or MUI4 are definitely unsafe
1026 safeNotifies
= FALSE
;
1029 // MorphOS and AROS must be considered unsafe unless someone from the
1030 // MorphOS/AROS team confirms that removing notifies in nested OM_SET
1032 safeNotifies
= FALSE
;
1039 GroupFrameT(tr(MSG_SB_HORIZONTAL
)),
1043 Child
, data
->mcp_R_HSB
= RadioObject
,
1044 MUIA_Radio_Entries
, RS_HSB
,
1045 MUIA_Disabled
, !safeNotifies
,
1047 MUIA_ShortHelp
, tr(MSG_SB_HORIZONTAL_HELP
),
1054 GroupFrameT(tr(MSG_SB_VERTICAL
)),
1058 Child
, data
->mcp_R_VSB
= RadioObject
,
1059 MUIA_Radio_Entries
,RS_VSB
,
1060 MUIA_Disabled
, !safeNotifies
,
1062 MUIA_ShortHelp
, tr(MSG_SB_VERTICAL_HELP
),
1071 GroupFrameT(tr(MSG_SCROLLCONTROL
)),
1077 Child
, data
->mcp_B_Smooth
= ImageObject
,
1079 MUIA_InputMode
, MUIV_InputMode_Toggle
,
1080 MUIA_Image_Spec
, MUII_CheckMark
,
1081 MUIA_Image_FreeVert
, TRUE
,
1082 MUIA_Background
, MUII_ButtonBack
,
1083 MUIA_ShowSelState
, FALSE
,
1085 Child
, Label(tr(MSG_SMOOTH_SCROLLING
)),
1086 MUIA_ShortHelp
, tr(MSG_SMOOTH_SCROLLING_HELP
),
1092 Child
, data
->mcp_WheelMMB
= ImageObject
,
1094 MUIA_InputMode
, MUIV_InputMode_Toggle
,
1095 MUIA_Image_Spec
, MUII_CheckMark
,
1096 MUIA_Image_FreeVert
, TRUE
,
1097 MUIA_Background
, MUII_ButtonBack
,
1098 MUIA_ShowSelState
, FALSE
,
1100 Child
, Label(tr(MSG_MMB_FASTWHEEL
)),
1101 MUIA_ShortHelp
, tr(MSG_MMB_FASTWHEEL_HELP
),
1105 Child
, Label(tr(MSG_WHEEL_STEP
)),
1106 Child
, data
->mcp_WheelStep
= SliderObject
,
1108 MUIA_Numeric_Min
, 1,
1109 MUIA_Numeric_Max
, 10,
1110 MUIA_Numeric_Value
, DEFAULT_WHEELSTEP
,
1111 MUIA_ShortHelp
, tr(MSG_WHEEL_STEP_HELP
),
1114 Child
, Label(tr(MSG_WHEEL_FAST
)),
1115 Child
, data
->mcp_WheelFast
= SliderObject
,
1117 MUIA_Numeric_Min
, 1,
1118 MUIA_Numeric_Max
, 10,
1119 MUIA_Numeric_Value
, DEFAULT_WHEELFAST
,
1120 MUIA_ShortHelp
, tr(MSG_WHEEL_FAST_HELP
),
1131 RS_MultiSelects
[0] = tr(MSG_MULTISELECT_QUAL
);
1132 RS_MultiSelects
[1] = tr(MSG_MULTISELECT_ALWAYS
);
1133 RS_MultiSelects
[2] = NULL
;
1135 RS_DragTypes
[0] = tr(MSG_DRAGTYPE_IMMEDIATE
);
1136 RS_DragTypes
[1] = tr(MSG_DRAGTYPE_BORDERS
);
1137 RS_DragTypes
[2] = tr(MSG_DRAGTYPE_QUALIFIER
);
1138 RS_DragTypes
[3] = NULL
;
1140 RS_ColWidthDrag
[0] = tr(MSG_COLWIDTHDRAG_TITLE
);
1141 RS_ColWidthDrag
[1] = tr(MSG_COLWIDTHDRAG_FULLBAR
);
1142 RS_ColWidthDrag
[2] = tr(MSG_COLWIDTHDRAG_VISIBLE
);
1143 RS_ColWidthDrag
[3] = NULL
;
1145 RS_Menu
[0] = tr(MSG_CMENU_ALWAYS
);
1146 RS_Menu
[1] = tr(MSG_CMENU_TOPONLY
);
1147 RS_Menu
[2] = tr(MSG_CMENU_NEVER
);
1155 GroupFrameT(tr(MSG_MULTISELECT
)),
1162 Child
, data
->mcp_R_Multi
= RadioObject
,
1163 MUIA_Radio_Entries
, RS_MultiSelects
,
1164 MUIA_ShortHelp
, tr(MSG_MULTISELECT_HELP
),
1169 Child
, RectangleObject
,
1171 MUIA_Rectangle_HBar
, TRUE
,
1175 Child
, data
->mcp_List_Select
= ImageObject
,
1177 MUIA_InputMode
, MUIV_InputMode_Toggle
,
1178 MUIA_Image_Spec
, MUII_CheckMark
,
1179 MUIA_Image_FreeVert
, TRUE
,
1180 MUIA_Background
, MUII_ButtonBack
,
1181 MUIA_ShowSelState
, FALSE
,
1182 MUIA_Selected
, TRUE
,
1184 Child
, Label(tr(MSG_MULTISEL_MOVEACTIVE
)),
1185 MUIA_ShortHelp
, tr(MSG_MULTISEL_MOVEACTIVE_HELP
),
1190 Child
, data
->mcp_B_MultiMMB
= ImageObject
,
1192 MUIA_InputMode
, MUIV_InputMode_Toggle
,
1193 MUIA_Image_Spec
, MUII_CheckMark
,
1194 MUIA_Background
, MUII_ButtonBack
,
1195 MUIA_ShowSelState
, FALSE
,
1196 MUIA_Image_FreeVert
,TRUE
,
1198 Child
, Label(tr(MSG_MMB_MULTISEL
)),
1199 MUIA_ShortHelp
, tr(MSG_MMB_MULTISEL_HELP
),
1209 GroupFrameT(tr(MSG_LAYOUT
)),
1214 Child
, data
->mcp_PartialCol
= ImageObject
,
1216 MUIA_InputMode
, MUIV_InputMode_Toggle
,
1217 MUIA_Image_Spec
, MUII_CheckMark
,
1218 MUIA_Image_FreeVert
, TRUE
,
1219 MUIA_Background
, MUII_ButtonBack
,
1220 MUIA_ShowSelState
, FALSE
,
1221 MUIA_Selected
, TRUE
,
1223 Child
, Label(tr(MSG_PARTIAL_COL_MARK
)),
1224 MUIA_ShortHelp
, tr(MSG_PARTIAL_COL_MARK_HELP
),
1229 Child
, data
->mcp_PartialChar
= ImageObject
,
1231 MUIA_InputMode
, MUIV_InputMode_Toggle
,
1232 MUIA_Image_Spec
, MUII_CheckMark
,
1233 MUIA_Image_FreeVert
, TRUE
,
1234 MUIA_Background
, MUII_ButtonBack
,
1235 MUIA_ShowSelState
, FALSE
,
1236 MUIA_Selected
, FALSE
,
1238 Child
, Label(tr(MSG_PARTIAL_CHARS_DRAWN
)),
1239 MUIA_ShortHelp
, tr(MSG_PARTIAL_CHARS_DRAWN_HELP
),
1244 Child
, data
->mcp_VerticalCenteredLines
= ImageObject
,
1246 MUIA_InputMode
, MUIV_InputMode_Toggle
,
1247 MUIA_Image_Spec
, MUII_CheckMark
,
1248 MUIA_Image_FreeVert
, TRUE
,
1249 MUIA_Background
, MUII_ButtonBack
,
1250 MUIA_ShowSelState
, FALSE
,
1251 MUIA_Selected
, FALSE
,
1253 Child
, Label(tr(MSG_VERT_CENTERED
)),
1254 MUIA_ShortHelp
, tr(MSG_VERT_CENTERED_HELP
),
1268 GroupFrameT(tr(MSG_DRAGDROP
)),
1275 Child
, data
->mcp_R_Drag
= RadioObject
,
1276 MUIA_Radio_Entries
, RS_DragTypes
,
1277 MUIA_ShortHelp
, tr(MSG_DRAGTYPE_HELP
),
1282 Child
, RectangleObject
,
1284 MUIA_Rectangle_HBar
, TRUE
,
1289 Child
, Label(tr(MSG_DRAG_LINES
)),
1290 Child
, data
->mcp_DragLines
= SliderObject
,
1291 MUIA_ShortHelp
, tr(MSG_DRAG_LINES_HELP
),
1293 MUIA_Numeric_Min
, 0,
1294 MUIA_Numeric_Max
, 20,
1295 MUIA_Numeric_Value
, DEFAULT_DRAGLINES
,
1300 Child
, data
->mcp_SerMouseFix
= ImageObject
,
1302 MUIA_InputMode
, MUIV_InputMode_Toggle
,
1303 MUIA_Image_Spec
, MUII_CheckMark
,
1304 MUIA_Image_FreeVert
, TRUE
,
1305 MUIA_Background
, MUII_ButtonBack
,
1306 MUIA_ShowSelState
, FALSE
,
1308 Child
, Label(tr(MSG_SERMOUSE_FIX
)),
1309 MUIA_ShortHelp
, tr(MSG_SERMOUSE_FIX_HELP
),
1320 GroupFrameT(tr(MSG_BALANCING_COLS
)),
1324 Child
, data
->mcp_ColWidthDrag
= RadioObject
,
1325 MUIA_Radio_Entries
, RS_ColWidthDrag
,
1327 MUIA_ShortHelp
, tr(MSG_BALANCING_COLS_HELP
),
1337 GroupFrameT(tr(MSG_GROUP_MISC
)),
1338 MUIA_VertWeight
, 10,
1347 Child
, data
->mcp_SelectPointer
= ImageObject
,
1349 MUIA_InputMode
, MUIV_InputMode_Toggle
,
1350 MUIA_Image_Spec
, MUII_CheckMark
,
1351 MUIA_Image_FreeVert
, TRUE
,
1352 MUIA_Background
, MUII_ButtonBack
,
1353 MUIA_ShowSelState
, FALSE
,
1355 Child
, Label(tr(MSG_SELECT_POINTER
)),
1356 MUIA_ShortHelp
, tr(MSG_SELECT_POINTER_HELP
),
1367 Child
, RectangleObject
,
1369 MUIA_Rectangle_HBar
, TRUE
,
1370 MUIA_Rectangle_BarTitle
, tr(MSG_BAR_CONTEXTMENU
),
1372 Child
, data
->mcp_NList_Menu
= RadioObject
,
1373 MUIA_Radio_Entries
,RS_Menu
,
1374 MUIA_ShortHelp
, tr(MSG_DEFAULT_CONTEXT_MENU_HELP
),
1388 functions_names
[0] = tr(MSG_FUNC_MULTISELQUAL
);
1389 functions_names
[1] = tr(MSG_FUNC_DRAGQUAL
);
1390 functions_names
[2] = tr(MSG_FUNC_BALANCEQUAL
);
1391 functions_names
[3] = tr(MSG_FUNC_COPYCLIP
);
1392 functions_names
[4] = tr(MSG_FUNC_DEFCOLWIDTH
);
1393 functions_names
[5] = tr(MSG_FUNC_DEFALLCOLWIDTH
);
1394 functions_names
[6] = tr(MSG_FUNC_DEFORDERCOL
);
1395 functions_names
[7] = tr(MSG_FUNC_DEFALLORDERCOL
);
1396 functions_names
[8] = tr(MSG_FUNC_SELECTTOP
);
1397 functions_names
[9] = tr(MSG_FUNC_SELECTBOTTOM
);
1398 functions_names
[10]= tr(MSG_FUNC_SELECTPAGEUP
);
1399 functions_names
[11]= tr(MSG_FUNC_SELECTPAGEDOWN
);
1400 functions_names
[12]= tr(MSG_FUNC_SELECTUP
);
1401 functions_names
[13]= tr(MSG_FUNC_SELECTDOWN
);
1402 functions_names
[14]= tr(MSG_FUNC_TOGGLEACTIVE
);
1403 functions_names
[15]= tr(MSG_FUNC_FASTWHEELQUAL
);
1404 functions_names
[16]= tr(MSG_FUNC_HORIZWHEELQUAL
);
1405 functions_names
[17]= tr(MSG_FUNC_TITLECLICKQUAL
);
1406 functions_names
[18]= "";
1407 functions_names
[19]= NULL
;
1409 group5
= GroupObject
,
1410 Child
, NListviewObject
,
1412 MUIA_NListview_Vert_ScrollBar
, MUIV_NListview_VSB_Always
,
1413 MUIA_NListview_Horiz_ScrollBar
, MUIV_NListview_HSB_None
,
1414 MUIA_NListview_NList
, data
->mcp_listkeys
= NListObject
,
1415 MUIA_NList_Title
,TRUE
,
1416 MUIA_NList_DragSortable
, TRUE
,
1417 MUIA_NList_Format
, "W=100 NOBAR,NOBAR,W=100 NOBAR",
1418 MUIA_NList_DisplayHook2
, &DisplayHook
,
1419 MUIA_NList_ConstructHook2
, &ConstructHook
,
1420 MUIA_NList_DestructHook2
, &DestructHook
,
1421 MUIA_NList_MinColSortable
, 10,
1425 Child
, GroupObject
,MUIA_Group_Horiz
,TRUE
,
1427 Child
, GroupObject
,MUIA_Group_Horiz
,TRUE
,
1428 Child
, data
->mcp_stringkey
,
1429 Child
, data
->mcp_snoopkey
= ToggleButtonCycle(tr(MSG_SNOOP
), FALSE
, TRUE
, tr(MSG_SNOOP_KEY
)),
1432 Child
, BalanceObject
, End
,
1434 Child
, GroupObject
,MUIA_Group_Horiz
,TRUE
,
1435 Child
, TextObject
, MUIA_Text_Contents
, "=", MUIA_Text_SetMax
, TRUE
, End
,
1436 Child
, data
->mcp_popstrfct
= PopobjectObject
,
1437 MUIA_InputMode
, MUIV_InputMode_None
,
1438 MUIA_Popstring_String
, data
->mcp_txtfct
= TextObject
,
1440 MUIA_Background
, MUII_TextBack
,
1441 MUIA_Text_Contents
, " ",
1444 MUIA_Popstring_Button
, PopButton(MUII_PopUp
),
1445 MUIA_Popobject_StrObjHook
, &StrObjHook
,
1446 MUIA_Popobject_ObjStrHook
, &ObjStrHook
,
1447 MUIA_Popobject_WindowHook
, &WindowHook
,
1448 MUIA_Popobject_Object
, data
->mcp_poplistfct
= ListviewObject
,
1449 MUIA_Listview_List
, ListObject
,
1451 MUIA_List_SourceArray
, functions_names
,
1459 Child
, GroupObject
,MUIA_Group_Horiz
,TRUE
,
1460 Child
, data
->mcp_insertkey
= SimpleButtonCycle(tr(MSG_BUTTON_INSERT
), tr(MSG_BUTTON_INSERT_HELP
)),
1461 Child
, data
->mcp_removekey
= SimpleButtonCycle(tr(MSG_BUTTON_REMOVE
), tr(MSG_BUTTON_REMOVE_HELP
)),
1462 Child
, data
->mcp_updatekeys
= SimpleButtonCycle(tr(MSG_BUTTON_UPDATEKEYS
), tr(MSG_BUTTON_UPDATEKEYS_HELP
)),
1463 Child
, data
->mcp_defaultkeys
= SimpleButtonCycle(tr(MSG_BUTTON_DEFAULTKEYS
), tr(MSG_BUTTON_DEFAULTKEYS_HELP
)),
1468 Pages
[0] = tr(MSG_PAGE_FONTS
);
1469 Pages
[1] = tr(MSG_PAGE_COLORS
);
1470 Pages
[2] = tr(MSG_PAGE_SCROLLING
);
1471 Pages
[3] = tr(MSG_PAGE_OPTIONS
);
1472 Pages
[4] = tr(MSG_PAGE_KEYBINDINGS
);
1474 data
->mcp_group
= VGroup
,
1476 Child
, RegisterObject
,
1477 MUIA_Register_Titles
, Pages
,
1478 MUIA_Register_Frame
, TRUE
,
1486 Child
, CrawlingObject
,
1488 MUIA_FixHeightTxt
, infotext1
,
1489 MUIA_Background
, "m1",
1492 MUIA_Text_Copy
, FALSE
,
1493 MUIA_Text_PreParse
, "\033c",
1494 MUIA_Text_Contents
, infotext1
,
1498 MUIA_Text_Copy
, FALSE
,
1499 MUIA_Text_PreParse
, "\033c",
1500 MUIA_Text_Contents
, infotext2
,
1504 MUIA_Text_Copy
, FALSE
,
1505 MUIA_Text_PreParse
, "\033c",
1506 MUIA_Text_Contents
, infotext1
,
1512 if(!data
->mcp_group
)
1514 CoerceMethod(cl
, obj
, OM_DISPOSE
);
1518 DoMethod(obj
, OM_ADDMEMBER
, data
->mcp_group
);
1520 set(data
->mcp_stringkey
,MUIA_String_AttachedList
,data
->mcp_listkeys
);
1521 set(data
->mcp_listkeys
,MUIA_UserData
,data
);
1523 DoMethod(data
->mcp_listkeys
,MUIM_Notify
,MUIA_NList_Active
, MUIV_EveryTime
,
1524 data
->mcp_listkeys
, 3, MUIM_CallHook
, &ActiveHook
,data
,MUIV_TriggerValue
);
1526 DoMethod(data
->mcp_listkeys
,MUIM_Notify
,MUIA_NList_DoubleClick
, MUIV_EveryTime
,
1527 MUIV_Notify_Window
, 3, MUIM_Set
, MUIA_Window_ActiveObject
, data
->mcp_stringkey
);
1529 DoMethod(data
->mcp_poplistfct
,MUIM_Notify
,MUIA_Listview_DoubleClick
,TRUE
,
1530 data
->mcp_popstrfct
,2,MUIM_Popstring_Close
,TRUE
);
1532 DoMethod(data
->mcp_txtfct
, MUIM_Notify
, MUIA_Text_Contents
, MUIV_EveryTime
,
1533 data
->mcp_listkeys
, 3, MUIM_CallHook
, &TxtFctHook
,data
->mcp_txtfct
);
1535 DoMethod(data
->mcp_snoopkey
, MUIM_Notify
, MUIA_Selected
, TRUE
,
1536 MUIV_Notify_Window
, 3, MUIM_Set
, MUIA_Window_ActiveObject
, data
->mcp_stringkey
);
1538 DoMethod(data
->mcp_snoopkey
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1539 data
->mcp_stringkey
, 3, MUIM_Set
, MUIA_HotkeyString_Snoop
, MUIV_TriggerValue
);
1541 DoMethod(data
->mcp_stringkey
, MUIM_Notify
, MUIA_String_Contents
, MUIV_EveryTime
,
1542 data
->mcp_snoopkey
, 3, MUIM_Set
, MUIA_Selected
, FALSE
);
1544 DoMethod(data
->mcp_stringkey
, MUIM_Notify
, MUIA_String_Acknowledge
, MUIV_EveryTime
,
1545 data
->mcp_listkeys
, 3, MUIM_CallHook
, &AckHook
,data
->mcp_stringkey
);
1547 DoMethod(data
->mcp_insertkey
,MUIM_Notify
, MUIA_Pressed
, FALSE
,
1548 data
->mcp_listkeys
, 3, MUIM_CallHook
, &InsertHook
);
1550 DoMethod(data
->mcp_removekey
,MUIM_Notify
, MUIA_Pressed
, FALSE
,
1551 data
->mcp_listkeys
, 2,MUIM_NList_Remove
,MUIV_NList_Remove_Active
);
1553 DoMethod(data
->mcp_defaultkeys
,MUIM_Notify
, MUIA_Pressed
, FALSE
,
1554 data
->mcp_listkeys
, 3, MUIM_CallHook
, &DefaultHook
);
1556 DoMethod(data
->mcp_updatekeys
,MUIM_Notify
, MUIA_Pressed
, FALSE
,
1557 data
->mcp_listkeys
, 3, MUIM_CallHook
, &UpdateHook
);
1559 // in case we are running for a newer MUI version we can register
1560 // our mcc gadgets accordingly
1561 if(MUIMasterBase
->lib_Version
>= 20)
1563 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_PenTitle
, MUICFG_NList_Pen_Title
, 1, tr(MSG_TITLE_PEN_WIN
));
1564 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_PenList
, MUICFG_NList_Pen_List
, 1, tr(MSG_LIST_PEN_WIN
));
1565 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_PenSelect
, MUICFG_NList_Pen_Select
, 1, tr(MSG_SELECT_PEN_WIN
));
1566 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_PenCursor
, MUICFG_NList_Pen_Cursor
, 1, tr(MSG_CURSOR_PEN_WIN
));
1567 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_PenUnselCur
, MUICFG_NList_Pen_UnselCur
, 1, tr(MSG_UNSEL_PEN_WIN
));
1568 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_PenInactive
, MUICFG_NList_Pen_Inactive
, 1, tr(MSG_INACT_PEN_WIN
));
1570 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_BG_Title
, MUICFG_NList_BG_Title
, 1, tr(MSG_TITLE_BG_WIN
));
1571 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_BG_List
, MUICFG_NList_BG_List
, 1, tr(MSG_LIST_BG_WIN
));
1572 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_BG_Select
, MUICFG_NList_BG_Select
, 1, tr(MSG_SELECT_BG_WIN
));
1573 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_BG_Cursor
, MUICFG_NList_BG_Cursor
, 1, tr(MSG_CURSOR_BG_WIN
));
1574 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_BG_UnselCur
, MUICFG_NList_BG_UnselCur
, 1, tr(MSG_UNSEL_BG_WIN
));
1575 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_BG_Inactive
, MUICFG_NList_BG_Inactive
, 1, tr(MSG_INACT_BG_WIN
));
1577 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_Font
, MUICFG_NList_Font
, 1, tr(MSG_NORMAL_FONT
));
1578 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_Font_Little
, MUICFG_NList_Font_Little
, 1, tr(MSG_SMALL_FONT
));
1579 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_Font_Fixed
, MUICFG_NList_Font_Fixed
, 1, tr(MSG_FIXED_FONT
));
1581 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_SL_VertInc
, MUICFG_NList_VertInc
, 1, tr(MSG_FONT_MARGIN
));
1582 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_R_Drag
, MUICFG_NList_DragType
, 1, tr(MSG_DRAGDROP
));
1584 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_R_Multi
, MUICFG_NList_MultiSelect
, 1, tr(MSG_MULTISELECT
));
1586 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_R_VSB
, MUICFG_NListview_VSB
, 1, tr(MSG_SB_VERTICAL
));
1587 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_R_HSB
, MUICFG_NListview_HSB
, 1, tr(MSG_SB_HORIZONTAL
));
1589 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_B_Smooth
, MUICFG_NList_Smooth
, 1, tr(MSG_SMOOTH_SCROLLING
));
1590 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_ForcePen
, MUICFG_NList_ForcePen
, 1, tr(MSG_FORCE_SELECT_PEN
));
1591 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_ColWidthDrag
, MUICFG_NList_ColWidthDrag
, 1, tr(MSG_BALANCING_COLS
));
1592 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_PartialCol
, MUICFG_NList_PartialCol
, 1, tr(MSG_PARTIAL_COL_MARK
));
1593 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_List_Select
, MUICFG_NList_List_Select
, 1, tr(MSG_MULTISEL_MOVEACTIVE
));
1594 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_NList_Menu
, MUICFG_NList_Menu
, 1, tr(MSG_BAR_CONTEXTMENU
));
1595 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_PartialChar
, MUICFG_NList_PartialChar
, 1, tr(MSG_PARTIAL_CHARS_DRAWN
));
1597 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_SerMouseFix
, MUICFG_NList_SerMouseFix
, 1, tr(MSG_SERMOUSE_FIX
));
1598 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_listkeys
, MUICFG_NList_Keys
, 1, tr(MSG_PAGE_KEYBINDINGS
));
1599 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_DragLines
, MUICFG_NList_DragLines
, 1, tr(MSG_DRAG_LINES
));
1600 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_VerticalCenteredLines
, MUICFG_NList_VCenteredLines
, 1, tr(MSG_VERT_CENTERED
));
1601 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_SelectPointer
,MUICFG_NList_SelectPointer
, 1, tr(MSG_SELECT_POINTER
));
1603 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_WheelStep
, MUICFG_NList_WheelStep
, 1, tr(MSG_WHEEL_STEP
));
1604 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_WheelFast
, MUICFG_NList_WheelFast
, 1, tr(MSG_WHEEL_FAST
));
1605 DoMethod(obj
, MUIM_Mccprefs_RegisterGadget
, data
->mcp_WheelMMB
, MUICFG_NList_WheelMMB
, 1, tr(MSG_MMB_FASTWHEEL
));
1611 static IPTR
mNL_MCP_Dispose(struct IClass
*cl
, Object
*obj
, Msg msg
)
1613 struct NListviews_MCP_Data
*data
= INST_DATA(cl
, obj
);
1615 if(data
->exampleText
!= NULL
)
1619 while(data
->exampleText
[i
] != NULL
)
1621 FreeVec(data
->exampleText
[i
]);
1625 FreeVec(data
->exampleText
);
1628 return DoSuperMethodA(cl
, obj
, msg
);
1631 IPTR
mNL_MCP_ConfigToGadgets(struct IClass
*cl
,Object
*obj
,struct MUIP_Settingsgroup_ConfigToGadgets
*msg
)
1633 struct NListviews_MCP_Data
*data
= INST_DATA(cl
, obj
);
1635 D(DBF_STARTUP
, "configToGadgets");
1637 LOAD_DATASPEC(data
->mcp_PenTitle
, MUIA_Pendisplay_Spec
, MUICFG_NList_Pen_Title
, DEFAULT_PEN_TITLE
);
1638 LOAD_DATASPEC(data
->mcp_PenList
, MUIA_Pendisplay_Spec
, MUICFG_NList_Pen_List
, DEFAULT_PEN_LIST
);
1639 LOAD_DATASPEC(data
->mcp_PenSelect
, MUIA_Pendisplay_Spec
, MUICFG_NList_Pen_Select
, DEFAULT_PEN_SELECT
);
1640 LOAD_DATASPEC(data
->mcp_PenCursor
, MUIA_Pendisplay_Spec
, MUICFG_NList_Pen_Cursor
, DEFAULT_PEN_CURSOR
);
1641 LOAD_DATASPEC(data
->mcp_PenUnselCur
,MUIA_Pendisplay_Spec
, MUICFG_NList_Pen_UnselCur
,DEFAULT_PEN_UNSELCUR
);
1642 LOAD_DATASPEC(data
->mcp_PenInactive
,MUIA_Pendisplay_Spec
, MUICFG_NList_Pen_Inactive
,DEFAULT_PEN_INACTIVE
);
1644 LOAD_DATASPEC(data
->mcp_BG_Title
, MUIA_Imagedisplay_Spec
,MUICFG_NList_BG_Title
, DEFAULT_BG_TITLE
);
1645 LOAD_DATASPEC(data
->mcp_BG_List
, MUIA_Imagedisplay_Spec
,MUICFG_NList_BG_List
, DEFAULT_BG_LIST
);
1646 LOAD_DATASPEC(data
->mcp_BG_Select
, MUIA_Imagedisplay_Spec
,MUICFG_NList_BG_Select
, DEFAULT_BG_SELECT
);
1647 LOAD_DATASPEC(data
->mcp_BG_Cursor
, MUIA_Imagedisplay_Spec
,MUICFG_NList_BG_Cursor
, DEFAULT_BG_CURSOR
);
1648 LOAD_DATASPEC(data
->mcp_BG_UnselCur
,MUIA_Imagedisplay_Spec
,MUICFG_NList_BG_UnselCur
, DEFAULT_BG_UNSELCUR
);
1649 LOAD_DATASPEC(data
->mcp_BG_Inactive
,MUIA_Imagedisplay_Spec
,MUICFG_NList_BG_Inactive
, DEFAULT_BG_INACTIVE
);
1651 LOAD_DATALONG(data
->mcp_SL_VertInc
, MUIA_Numeric_Value
, MUICFG_NList_VertInc
, DEFAULT_VERT_INC
);
1653 LOAD_DATALONG(data
->mcp_B_Smooth
, MUIA_Selected
, MUICFG_NList_Smooth
, DEFAULT_SMOOTHSCROLL
);
1655 LOAD_DATAFONT(data
->mcp_Font
, MUICFG_NList_Font
);
1656 LOAD_DATAFONT(data
->mcp_Font_Little
,MUICFG_NList_Font_Little
);
1657 LOAD_DATAFONT(data
->mcp_Font_Fixed
, MUICFG_NList_Font_Fixed
);
1661 LONG num
= DEFAULT_DRAGTYPE
;
1662 if((ptrd
= (LONG
*) DoMethod(msg
->configdata
, MUIM_Dataspace_Find
, MUICFG_NList_DragType
)))
1664 if (*ptrd
== MUIV_NList_DragType_Qualifier
)
1666 else if (*ptrd
== MUIV_NList_DragType_Borders
)
1671 set(data
->mcp_R_Drag
,MUIA_Radio_Active
, num
);
1677 LONG num
= DEFAULT_CWD
;
1678 if((ptrd
= (LONG
*) DoMethod(msg
->configdata
, MUIM_Dataspace_Find
, MUICFG_NList_ColWidthDrag
)))
1682 else if (*ptrd
== 2)
1687 set(data
->mcp_ColWidthDrag
,MUIA_Radio_Active
, num
);
1692 LONG num
= DEFAULT_MULTISELECT
;
1694 if((ptrd
= (LONG
*) DoMethod(msg
->configdata
, MUIM_Dataspace_Find
, MUICFG_NList_MultiSelect
)))
1697 if ((num
& MUIV_NList_MultiSelect_MMB_On
) == MUIV_NList_MultiSelect_MMB_On
)
1699 set(data
->mcp_B_MultiMMB
, MUIA_Selected
, TRUE
);
1703 set(data
->mcp_B_MultiMMB
, MUIA_Selected
, FALSE
);
1706 if (num
== MUIV_NList_MultiSelect_Always
)
1710 set(data
->mcp_R_Multi
,MUIA_Radio_Active
, num
);
1715 LONG num
= DEFAULT_HSB
;
1717 if((ptrd
= (LONG
*) DoMethod(msg
->configdata
, MUIM_Dataspace_Find
, MUICFG_NListview_HSB
)))
1720 if ((num
< 1) || (num
> 4))
1724 set(data
->mcp_R_HSB
,MUIA_Radio_Active
, num
);
1729 LONG num
= DEFAULT_VSB
;
1731 if((ptrd
= (LONG
*) DoMethod(msg
->configdata
, MUIM_Dataspace_Find
, MUICFG_NListview_VSB
)))
1734 if ((num
< 1) || (num
> 3))
1737 set(data
->mcp_R_VSB
,MUIA_Radio_Active
, num
);
1742 LONG num
= DEFAULT_FORCEPEN
;
1743 if((ptrd
= (LONG
*) DoMethod(msg
->configdata
, MUIM_Dataspace_Find
, MUICFG_NList_ForcePen
)))
1750 set(data
->mcp_ForcePen
, MUIA_Selected
, num
);
1753 LOAD_DATALONG(data
->mcp_DragLines
, MUIA_Numeric_Value
, MUICFG_NList_DragLines
, DEFAULT_DRAGLINES
);
1754 LOAD_DATALONG(data
->mcp_VerticalCenteredLines
, MUIA_Selected
, MUICFG_NList_VCenteredLines
, DEFAULT_VCENTERED
);
1755 LOAD_DATALONG(data
->mcp_SelectPointer
, MUIA_Selected
, MUICFG_NList_SelectPointer
, DEFAULT_SELECTPOINTER
);
1756 LOAD_DATALONG(data
->mcp_WheelStep
, MUIA_Numeric_Value
, MUICFG_NList_WheelStep
, DEFAULT_WHEELSTEP
);
1757 LOAD_DATALONG(data
->mcp_WheelFast
, MUIA_Numeric_Value
, MUICFG_NList_WheelFast
, DEFAULT_WHEELFAST
);
1758 LOAD_DATALONG(data
->mcp_WheelMMB
, MUIA_Selected
, MUICFG_NList_WheelMMB
, DEFAULT_WHEELMMB
);
1762 LONG num
= DEFAULT_SERMOUSEFIX
;
1763 if((ptrd
= (LONG
*) DoMethod(msg
->configdata
, MUIM_Dataspace_Find
, MUICFG_NList_SerMouseFix
)))
1770 set(data
->mcp_SerMouseFix
, MUIA_Selected
, num
);
1775 LONG num
= DEFAULT_LIST_SELECT
;
1776 if((ptrd
= (LONG
*) DoMethod(msg
->configdata
, MUIM_Dataspace_Find
, MUICFG_NList_List_Select
)))
1783 set(data
->mcp_List_Select
, MUIA_Selected
, num
);
1788 LONG num
= DEFAULT_PARTIALCOL
;
1789 if((ptrd
= (LONG
*) DoMethod(msg
->configdata
, MUIM_Dataspace_Find
, MUICFG_NList_PartialCol
)))
1796 set(data
->mcp_PartialCol
, MUIA_Selected
, num
);
1801 LONG num
= DEFAULT_PARTIALCHAR
;
1802 if((ptrd
= (LONG
*) DoMethod(msg
->configdata
, MUIM_Dataspace_Find
, MUICFG_NList_PartialChar
)))
1809 set(data
->mcp_PartialChar
, MUIA_Selected
, num
);
1814 LONG num
= DEFAULT_CMENU
;
1815 if((ptrd
= (LONG
*)DoMethod(msg
->configdata
, MUIM_Dataspace_Find
, MUICFG_NList_Menu
)) != NULL
)
1817 if(*ptrd
== (LONG
)MUIV_NList_ContextMenu_TopOnly
)
1819 else if(*ptrd
== (LONG
)MUIV_NList_ContextMenu_Never
)
1822 set(data
->mcp_NList_Menu
, MUIA_Radio_Active
, num
);
1827 struct KeyBinding
*keys
= default_keys
;
1829 if((ptrd
= (LONG
*) DoMethod(msg
->configdata
, MUIM_Dataspace_Find
, MUICFG_NList_Keys
)))
1830 keys
= (struct KeyBinding
*) ptrd
;
1832 NL_LoadKeys(data
->mcp_listkeys
,keys
);
1839 IPTR
mNL_MCP_GadgetsToConfig(struct IClass
*cl
,Object
*obj
,struct MUIP_Settingsgroup_GadgetsToConfig
*msg
)
1841 struct NListviews_MCP_Data
*data
= INST_DATA(cl
, obj
);
1843 D(DBF_STARTUP
, "GadgetsToConfig");
1845 SAVE_DATASPEC(data
->mcp_PenTitle
, MUIA_Pendisplay_Spec
, MUICFG_NList_Pen_Title
);
1846 SAVE_DATASPEC(data
->mcp_PenList
, MUIA_Pendisplay_Spec
, MUICFG_NList_Pen_List
);
1847 SAVE_DATASPEC(data
->mcp_PenSelect
, MUIA_Pendisplay_Spec
, MUICFG_NList_Pen_Select
);
1848 SAVE_DATASPEC(data
->mcp_PenCursor
, MUIA_Pendisplay_Spec
, MUICFG_NList_Pen_Cursor
);
1849 SAVE_DATASPEC(data
->mcp_PenUnselCur
,MUIA_Pendisplay_Spec
, MUICFG_NList_Pen_UnselCur
);
1850 SAVE_DATASPEC(data
->mcp_PenInactive
,MUIA_Pendisplay_Spec
, MUICFG_NList_Pen_Inactive
);
1852 SAVE_DATASPEC2(data
->mcp_BG_Title
, MUIA_Imagedisplay_Spec
,MUICFG_NList_BG_Title
);
1853 SAVE_DATASPEC2(data
->mcp_BG_List
, MUIA_Imagedisplay_Spec
,MUICFG_NList_BG_List
);
1854 SAVE_DATASPEC2(data
->mcp_BG_Select
, MUIA_Imagedisplay_Spec
,MUICFG_NList_BG_Select
);
1855 SAVE_DATASPEC2(data
->mcp_BG_Cursor
, MUIA_Imagedisplay_Spec
,MUICFG_NList_BG_Cursor
);
1856 SAVE_DATASPEC2(data
->mcp_BG_UnselCur
,MUIA_Imagedisplay_Spec
,MUICFG_NList_BG_UnselCur
);
1857 SAVE_DATASPEC2(data
->mcp_BG_Inactive
,MUIA_Imagedisplay_Spec
,MUICFG_NList_BG_Inactive
);
1859 SAVE_DATALONG(data
->mcp_SL_VertInc
, MUIA_Numeric_Value
, MUICFG_NList_VertInc
);
1861 SAVE_DATALONG(data
->mcp_B_Smooth
, MUIA_Selected
, MUICFG_NList_Smooth
);
1863 SAVE_DATAFONT(data
->mcp_Font
, MUICFG_NList_Font
);
1864 SAVE_DATAFONT(data
->mcp_Font_Little
,MUICFG_NList_Font_Little
);
1865 SAVE_DATAFONT(data
->mcp_Font_Fixed
, MUICFG_NList_Font_Fixed
);
1869 get(data
->mcp_R_Drag
, MUIA_Radio_Active
, &ptrd
);
1871 num
= MUIV_NList_DragType_Qualifier
;
1873 num
= MUIV_NList_DragType_Borders
;
1875 num
= MUIV_NList_DragType_Immediate
;
1876 DoMethod(msg
->configdata
, MUIM_Dataspace_Add
, &num
, sizeof(num
), MUICFG_NList_DragType
);
1881 get(data
->mcp_ColWidthDrag
, MUIA_Radio_Active
, &ptrd
);
1883 DoMethod(msg
->configdata
, MUIM_Dataspace_Add
, &num
, sizeof(num
), MUICFG_NList_ColWidthDrag
);
1888 get(data
->mcp_R_Multi
, MUIA_Radio_Active
, &ptrd
);
1890 num
= MUIV_NList_MultiSelect_Always
;
1892 num
= MUIV_NList_MultiSelect_Shifted
;
1893 get(data
->mcp_B_MultiMMB
, MUIA_Selected
, &ptrd
);
1895 num
|= MUIV_NList_MultiSelect_MMB_On
;
1897 num
|= MUIV_NList_MultiSelect_MMB_Off
;
1898 DoMethod(msg
->configdata
, MUIM_Dataspace_Add
, &num
, sizeof(num
), MUICFG_NList_MultiSelect
);
1903 get(data
->mcp_R_HSB
, MUIA_Radio_Active
, &ptrd
);
1905 DoMethod(msg
->configdata
, MUIM_Dataspace_Add
, &num
, sizeof(num
), MUICFG_NListview_HSB
);
1909 get(data
->mcp_R_VSB
, MUIA_Radio_Active
, &ptrd
);
1911 DoMethod(msg
->configdata
, MUIM_Dataspace_Add
, &num
, sizeof(num
), MUICFG_NListview_VSB
);
1916 get(data
->mcp_ForcePen
, MUIA_Selected
, &ptrd
);
1921 DoMethod(msg
->configdata
, MUIM_Dataspace_Add
, &num
, sizeof(num
), MUICFG_NList_ForcePen
);
1924 SAVE_DATALONG(data
->mcp_DragLines
, MUIA_Numeric_Value
, MUICFG_NList_DragLines
);
1925 SAVE_DATALONG(data
->mcp_VerticalCenteredLines
, MUIA_Selected
, MUICFG_NList_VCenteredLines
);
1926 SAVE_DATALONG(data
->mcp_SelectPointer
,MUIA_Selected
, MUICFG_NList_SelectPointer
);
1927 SAVE_DATALONG(data
->mcp_WheelStep
, MUIA_Numeric_Value
, MUICFG_NList_WheelStep
);
1928 SAVE_DATALONG(data
->mcp_WheelFast
, MUIA_Numeric_Value
, MUICFG_NList_WheelFast
);
1929 SAVE_DATALONG(data
->mcp_WheelMMB
, MUIA_Selected
, MUICFG_NList_WheelMMB
);
1933 get(data
->mcp_SerMouseFix
, MUIA_Selected
, &ptrd
);
1938 DoMethod(msg
->configdata
, MUIM_Dataspace_Add
, &num
, sizeof(num
), MUICFG_NList_SerMouseFix
);
1943 get(data
->mcp_List_Select
, MUIA_Selected
, &ptrd
);
1948 DoMethod(msg
->configdata
, MUIM_Dataspace_Add
, &num
, sizeof(num
), MUICFG_NList_List_Select
);
1953 get(data
->mcp_PartialCol
, MUIA_Selected
, &ptrd
);
1958 DoMethod(msg
->configdata
, MUIM_Dataspace_Add
, &num
, sizeof(num
), MUICFG_NList_PartialCol
);
1963 get(data
->mcp_PartialChar
, MUIA_Selected
, &ptrd
);
1968 DoMethod(msg
->configdata
, MUIM_Dataspace_Add
, &num
, sizeof(num
), MUICFG_NList_PartialChar
);
1972 LONG ptrd
=0,num
= MUIV_NList_ContextMenu_Always
;
1973 get(data
->mcp_NList_Menu
, MUIA_Radio_Active
, &ptrd
);
1975 num
= MUIV_NList_ContextMenu_TopOnly
;
1977 num
= MUIV_NList_ContextMenu_Never
;
1978 DoMethod(msg
->configdata
, MUIM_Dataspace_Add
, &num
, sizeof(num
), MUICFG_NList_Menu
);
1982 LONG sk
= NL_SaveKeys(data
);
1985 DoMethod(msg
->configdata
, MUIM_Dataspace_Add
, data
->nlkeys
, sk
, MUICFG_NList_Keys
);
1986 FreeVec((void *) data
->nlkeys
);
1987 data
->nlkeys
= NULL
;
1995 static IPTR
mNL_MCP_Get(struct IClass
*cl
,Object
*obj
,Msg msg
)
1997 IPTR
*store
= ((struct opGet
*)msg
)->opg_Storage
;
1999 switch (((struct opGet
*)msg
)->opg_AttrID
)
2002 *store
= LIB_VERSION
;
2006 *store
= LIB_REVISION
;
2010 return (DoSuperMethodA(cl
,obj
,msg
));
2013 DISPATCHER(_DispatcherP
)
2015 switch (msg
->MethodID
)
2017 case OM_NEW
: return(mNL_MCP_New(cl
,obj
,(APTR
)msg
));
2018 case OM_DISPOSE
: return(mNL_MCP_Dispose(cl
,obj
,(APTR
)msg
));
2019 case OM_GET
: return(mNL_MCP_Get(cl
,obj
,(APTR
)msg
));
2020 case MUIM_Settingsgroup_ConfigToGadgets
: return(mNL_MCP_ConfigToGadgets(cl
,obj
,(APTR
)msg
));
2021 case MUIM_Settingsgroup_GadgetsToConfig
: return(mNL_MCP_GadgetsToConfig(cl
,obj
,(APTR
)msg
));
2024 return(DoSuperMethodA(cl
,obj
,msg
));