revert between 56095 -> 55830 in arch
[AROS.git] / workbench / classes / zune / nlist / nlisttree_mcp / NListtree.c
blobb0e435a4d88cd415ef65fd8fa5daec8a2da7f0e1
1 /***************************************************************************
3 NListtree.mcc - New Listtree MUI Custom Class
4 Copyright (C) 1999-2001 by Carsten Scholling
5 Copyright (C) 2001-2014 NList 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 NList classes Support Site: http://www.sf.net/projects/nlist-classes
19 $Id$
21 ***************************************************************************/
23 #if defined(__AROS__)
24 #define MUI_OBSOLETE 1
25 #endif
28 ** Includes
30 #include <stdlib.h>
31 #include <string.h>
32 #include <stdio.h>
34 #include <libraries/mui.h>
35 #include <utility/hooks.h>
36 #include <clib/alib_protos.h>
37 #include <proto/muimaster.h>
38 #include <proto/intuition.h>
39 #include <proto/locale.h>
40 #include <proto/exec.h>
42 #include <mui/NFloattext_mcc.h>
43 #include <mui/NListview_mcc.h>
44 #include <mui/NList_mcc.h>
46 #include "private.h"
47 #include "version.h"
49 #include "locale.h"
51 #include "muiextra.h"
53 // some undocumented MUI tags we are going to use
54 #ifndef MUIA_Imagedisplay_UseDefSize
55 #define MUIA_Imagedisplay_UseDefSize 0x8042186dUL /* V11 i.. BOOL */
56 #endif
57 #ifndef MUIA_Slider_Level
58 #define MUIA_Slider_Level 0x8042ae3aUL /* V4 isg LONG */
59 #endif
60 #ifndef MUIA_Slider_Min
61 #define MUIA_Slider_Min 0x8042e404UL /* V4 isg LONG */
62 #endif
63 #ifndef MUIA_Slider_Max
64 #define MUIA_Slider_Max 0x8042d78aUL /* V4 isg LONG */
65 #endif
67 struct SampleArray
69 const char *name;
70 UWORD flags;
74 ** Sample
76 static const struct SampleArray sa[] =
78 { "root1", 0 },
80 { "comp", TNF_LIST | TNF_OPEN },
81 { "sys", TNF_LIST | TNF_OPEN },
82 { "amiga", TNF_LIST | TNF_OPEN },
83 { "misc", 0x8000 },
84 { "mac", TNF_LIST },
85 { "system", 0x8000 },
87 { "root2", 0 },
89 { "de", TNF_LIST | TNF_OPEN },
90 { "comm", TNF_LIST },
91 { "software", TNF_LIST },
92 { "ums", 0x8000 },
93 { "comp", TNF_LIST | TNF_OPEN },
94 { "sys", TNF_LIST | TNF_OPEN },
95 { "amiga", TNF_LIST },
96 { "misc", 0x8000 },
97 { "tech", 0x8000 },
98 { "amiga", 0x8000 },
100 { "m", TNF_LIST },
101 { "i", TNF_LIST },
102 { "c", TNF_LIST },
103 { "h", TNF_LIST },
104 { "e", TNF_LIST },
105 { "l", TNF_LIST },
106 { "a", TNF_LIST },
107 { "n", TNF_LIST },
108 { "g", TNF_LIST },
109 { "e", TNF_LIST },
110 { "l", TNF_LIST },
111 { "o", 0 },
113 { "end", TNF_LIST },
114 { "of", TNF_LIST },
115 { "tree", 0 },
117 { NULL, 0 }
120 /*****************************************************************************\
121 *******************************************************************************
123 ** Helpful object related functions.
125 *******************************************************************************
126 \*****************************************************************************/
128 static VOID DrawSampleTree( Object *ltobj )
130 struct MUI_NListtree_TreeNode *tn1, *tn2, *tn3;
131 WORD i = 0;
133 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], MUIV_NListtree_Insert_ListNode_Root, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
135 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], MUIV_NListtree_Insert_ListNode_Root, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
136 tn2 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
137 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn2, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
138 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
139 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn2, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
140 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
142 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], MUIV_NListtree_Insert_ListNode_Root, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
144 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], MUIV_NListtree_Insert_ListNode_Root, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
145 tn2 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
146 tn2 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn2, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
147 tn2 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn2, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
148 tn3 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
149 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn3, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
150 tn2 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
151 tn3 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn2, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
152 tn3 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn2, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
153 tn3 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
155 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], MUIV_NListtree_Insert_ListNode_Root, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
156 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
157 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
158 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
159 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
160 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
161 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
162 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
163 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
164 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
165 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
166 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
168 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], MUIV_NListtree_Insert_ListNode_Root, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
169 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
170 tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++;
174 STATIC VOID TransferValues(struct NListtreeP_Data *data)
176 nnset(data->NLT_Sample, MUIA_NListtree_Quiet, TRUE);
178 SetAttrs(data->NLT_Sample, MUICFG_NListtree_ImageSpecClosed, xget(data->PI_ImageClosed, MUIA_Imagedisplay_Spec),
179 MUICFG_NListtree_ImageSpecOpen, xget(data->PI_ImageOpen, MUIA_Imagedisplay_Spec),
180 MUICFG_NListtree_ImageSpecFolder, xget(data->PI_ImageFolder, MUIA_Imagedisplay_Spec),
181 MUICFG_NListtree_PenSpecLines, xget(data->PP_LinePen, MUIA_Pendisplay_Spec),
182 MUICFG_NListtree_PenSpecShadow, xget(data->PP_ShadowPen, MUIA_Pendisplay_Spec),
183 MUICFG_NListtree_PenSpecGlow, xget(data->PP_GlowPen, MUIA_Pendisplay_Spec),
184 MUICFG_NListtree_RememberStatus, xget(data->CH_RememberStatus, MUIA_Selected),
185 MUICFG_NListtree_IndentWidth, xget(data->SL_IndentWidth, MUIA_Slider_Level),
186 MUICFG_NListtree_OpenAutoScroll, xget(data->CH_OpenAutoScroll, MUIA_Selected),
187 MUICFG_NListtree_LineType, xget(data->CY_LineType, MUIA_Cycle_Active),
188 MUICFG_NListtree_UseFolderImage, xget(data->CH_UseFolderImage, MUIA_Selected),
189 TAG_DONE);
191 nnset(data->NLT_Sample, MUIA_NListtree_Quiet, FALSE);
193 return;
198 /*****************************************************************************\
199 *******************************************************************************
201 ** Standard class related functions.
203 *******************************************************************************
204 \*****************************************************************************/
206 HOOKPROTONHNO(dspfunc, LONG, struct MUIP_NListtree_DisplayMessage *msg)
208 static const char *t1 = "\033bNewsgroups";
209 static const char *t2 = "\033bFlags";
210 static const char *t3 = "subscribed";
211 static const char *t4 = "\0";
212 static const char *t5 = "\033bCnt";
213 static char buf[10];
215 if ( msg->TreeNode != NULL )
218 ** The user data is a pointer to a SampleArray struct.
220 struct SampleArray *a = (struct SampleArray *)msg->TreeNode->tn_User;
222 snprintf(buf, sizeof(buf), "%3ld", (unsigned long)msg->Array[-1]);
224 *msg->Array++ = (STRPTR)a->name;
225 *msg->Array++ = (STRPTR)((a->flags & 0x8000) ? t3 : t4);
226 *msg->Array++ = buf;
228 else
230 *msg->Array++ = (STRPTR)t1;
231 *msg->Array++ = (STRPTR)t2;
232 *msg->Array++ = (STRPTR)t5;
235 return( 0 );
237 MakeStaticHook(dsphook, dspfunc);
239 static VOID ValuesChanged(struct NListtreeP_Data *data)
241 nnset(data->PP_LinePen, MUIA_Disabled, xget(data->CY_LineType, MUIA_Cycle_Active) == MUICFGV_NListtree_LineType_Disabled);
242 nnset(data->PP_ShadowPen, MUIA_Disabled, xget(data->CY_LineType, MUIA_Cycle_Active) != MUICFGV_NListtree_LineType_Shadow && xget(data->CY_LineType, MUIA_Cycle_Active) != MUICFGV_NListtree_LineType_Glow);
243 nnset(data->PP_GlowPen, MUIA_Disabled, xget(data->CY_LineType, MUIA_Cycle_Active) != MUICFGV_NListtree_LineType_Glow);
245 nnset(data->PI_ImageFolder, MUIA_Disabled, xget(data->CH_UseFolderImage, MUIA_Selected) == FALSE);
247 return;
250 HOOKPROTONHNO(ValuesChangedFunc, VOID, IPTR *para)
252 ValuesChanged((struct NListtreeP_Data *)para[0]);
254 MakeStaticHook(ValuesChangedHook, ValuesChangedFunc);
256 static IPTR _NewP( struct IClass *cl, Object *obj, Msg msg )
258 struct NListtreeP_Data *data;
259 static const char *CY_LineTypes_Entries[6];
260 static const char infotext1[] = "\033bNListtree.mcp " LIB_REV_STRING "\033n (" LIB_DATE ")\n"
261 "Copyright (C) 1999-2001 Carsten Scholling\n"
262 LIB_COPYRIGHT;
263 static const char infotext2[] = "\n"
264 "Distributed under the terms of the LGPL2.\n"
265 "\n"
266 "For the latest version, check out:\n"
267 "http://www.sf.net/projects/nlist-classes/\n"
268 "\n";
270 static unsigned char msg_closed_key;
271 static unsigned char msg_open_key;
272 static unsigned char msg_lines_key;
273 static unsigned char msg_shadow_key;
274 static unsigned char msg_glow_key;
275 static unsigned char msg_linetypes_key;
276 static unsigned char msg_indentwidth_key;
277 static unsigned char msg_remember_status_key;
278 static unsigned char msg_open_autoscroll_key;
279 static unsigned char msg_bt_expand_key;
280 static unsigned char msg_bt_collapse_key;
281 static unsigned char msg_folder_key;
282 static unsigned char msg_folderimage_key;
284 ENTER();
286 if( !( obj = (Object *)DoSuperMethodA( cl, obj, msg ) ) )
288 RETURN(0);
289 return( 0 );
293 ** Init data.
295 data = INST_DATA( cl, obj );
297 CY_LineTypes_Entries[0] = tr(MSG_LINETYPE_DISABLED);
298 CY_LineTypes_Entries[1] = tr(MSG_LINETYPE_NORMAL);
299 CY_LineTypes_Entries[2] = tr(MSG_LINETYPE_DOTTED);
300 CY_LineTypes_Entries[3] = tr(MSG_LINETYPE_SHADOW);
301 CY_LineTypes_Entries[4] = tr(MSG_LINETYPE_GLOW);
302 CY_LineTypes_Entries[5] = NULL;
304 msg_closed_key = tr(MSG_BUTTON_SHORTCUT_CLOSED)[0];
305 msg_open_key = tr(MSG_BUTTON_SHORTCUT_OPEN)[0];
306 msg_lines_key = tr(MSG_BUTTON_SHORTCUT_LINES)[0];
307 msg_shadow_key = tr(MSG_BUTTON_SHORTCUT_SHADOW)[0];
308 msg_glow_key = tr(MSG_BUTTON_SHORTCUT_GLOW)[0];
309 msg_linetypes_key = tr(MSG_BUTTON_SHORTCUT_LINETYPES)[0];
310 msg_indentwidth_key = tr(MSG_BUTTON_SHORTCUT_INDENTWIDTH)[0];
311 msg_remember_status_key = tr(MSG_BUTTON_SHORTCUT_REMEMBER)[0];
312 msg_open_autoscroll_key = tr(MSG_BUTTON_SHORTCUT_AUTOSCROLL)[0];
313 msg_bt_expand_key = tr(MSG_BUTTON_SHORTCUT_EXPAND)[0];
314 msg_bt_collapse_key = tr(MSG_BUTTON_SHORTCUT_COLLAPSE)[0];
315 msg_folder_key = tr(MSG_BUTTON_SHORTCUT_FOLDER)[0];
316 msg_folderimage_key = tr(MSG_BUTTON_SHORTCUT_FOLDERIMAGE)[0];
319 ** Preferences group.
321 data->GR_Prefs = VGroup,
322 MUIA_Group_VertSpacing, 5,
324 Child, HGroup,
327 ** Images and Lines
329 Child, VGroup,
331 Child, HGroup, GroupFrameT(tr(MSG_GROUP_IMAGES_COLORS)),
332 MUIA_HorizWeight, 1,
334 Child, VGroup,
336 Child, FreeKeyCLabel(tr(MSG_BUTTON_LABEL_CLOSED), msg_closed_key),
337 Child, data->PI_ImageClosed = PopimageObject,
338 MUIA_Imagedisplay_UseDefSize, TRUE,
339 MUIA_Imageadjust_Type, MUIV_Imageadjust_Type_Image,
340 MUIA_ControlChar, msg_closed_key,
341 MUIA_CycleChain, TRUE,
342 MUIA_Draggable, TRUE,
343 MUIA_Window_Title, tr(MSG_WIN_TITLE_CLOSED_IMAGE),
344 MUIA_ShortHelp, tr(MSG_HELP_CLOSED_IMAGE),
345 End,
348 Child, FreeKeyCLabel(tr(MSG_BUTTON_LABEL_OPEN), msg_open_key),
349 Child, data->PI_ImageOpen = PopimageObject,
350 MUIA_Imagedisplay_UseDefSize, TRUE,
351 MUIA_Imageadjust_Type, MUIV_Imageadjust_Type_Image,
352 MUIA_ControlChar, msg_open_key,
353 MUIA_CycleChain, TRUE,
354 MUIA_Draggable, TRUE,
355 MUIA_Window_Title, tr(MSG_WIN_TITLE_OPEN_IMAGE),
356 MUIA_ShortHelp, tr(MSG_HELP_OPEN_IMAGE),
357 End,
359 Child, FreeKeyCLabel(tr(MSG_BUTTON_LABEL_FOLDER), msg_folder_key),
360 Child, data->PI_ImageFolder = PopimageObject,
361 MUIA_Imagedisplay_UseDefSize, TRUE,
362 MUIA_Imageadjust_Type, MUIV_Imageadjust_Type_Image,
363 MUIA_ControlChar, msg_folder_key,
364 MUIA_CycleChain, TRUE,
365 MUIA_Draggable, TRUE,
366 MUIA_Disabled, MUICFGV_NListtree_UseFolderImage_Default == FALSE,
367 MUIA_Window_Title, tr(MSG_WIN_TITLE_FOLDER_IMAGE),
368 MUIA_ShortHelp, tr(MSG_HELP_FOLDER_IMAGE),
369 End,
371 End,
374 Child, VGroup,
376 Child, FreeKeyCLabel(tr(MSG_BUTTON_LABEL_LINES), msg_lines_key),
377 Child, data->PP_LinePen = PoppenObject,
378 MUIA_Disabled, MUICFGV_NListtree_LineType_Default == MUICFGV_NListtree_LineType_Disabled,
379 MUIA_ControlChar, msg_lines_key,
380 MUIA_CycleChain, TRUE,
381 MUIA_Window_Title, tr(MSG_WIN_TITLE_LINES_COLOR),
382 MUIA_ShortHelp, tr(MSG_HELP_LINES_COLOR),
383 End,
385 Child, FreeKeyCLabel(tr(MSG_BUTTON_LABEL_SHADOW), msg_shadow_key),
386 Child, data->PP_ShadowPen = PoppenObject,
387 MUIA_Disabled, MUICFGV_NListtree_LineType_Default != MUICFGV_NListtree_LineType_Shadow,
388 MUIA_ControlChar, msg_shadow_key,
389 MUIA_CycleChain, TRUE,
390 MUIA_Window_Title, tr(MSG_WIN_TITLE_SHADOW_COLOR),
391 MUIA_ShortHelp, tr(MSG_HELP_SHADOW_COLOR),
392 End,
394 Child, FreeKeyCLabel(tr(MSG_BUTTON_LABEL_GLOW), msg_glow_key),
395 Child, data->PP_GlowPen = MUI_NewObject( MUIC_Poppen,
396 MUIA_Disabled, MUICFGV_NListtree_LineType_Default != MUICFGV_NListtree_LineType_Glow,
397 MUIA_ControlChar, msg_glow_key,
398 MUIA_CycleChain, TRUE,
399 MUIA_Window_Title, tr(MSG_WIN_TITLE_GLOW_COLOR),
400 MUIA_ShortHelp, tr(MSG_HELP_GLOW_COLOR),
401 End,
403 End,
405 End,
407 Child, HGroup, GroupFrameT(tr(MSG_GROUP_STYLE)),
409 Child, ColGroup( 2 ),
411 Child, KeyLabel(tr(MSG_BUTTON_LABEL_LINETYPES), msg_linetypes_key),
412 Child, data->CY_LineType = CycleObject,
413 MUIA_Cycle_Entries, CY_LineTypes_Entries,
414 MUIA_Cycle_Active, MUICFGV_NListtree_LineType_Default,
415 MUIA_CycleChain, TRUE,
416 MUIA_ControlChar, msg_linetypes_key,
417 MUIA_ShortHelp, tr(MSG_HELP_LINETYPES),
418 End,
420 Child, KeyLabel(tr(MSG_BUTTON_LABEL_FOLDERIMAGE), msg_folderimage_key),
421 Child, HGroup,
422 Child, data->CH_UseFolderImage = ImageObject,
423 ImageButtonFrame,
424 MUIA_Image_Spec, MUII_CheckMark,
425 MUIA_InputMode, MUIV_InputMode_Toggle,
426 MUIA_Selected, MUICFGV_NListtree_UseFolderImage_Default,
427 MUIA_ShowSelState, FALSE,
428 MUIA_ControlChar, msg_folderimage_key,
429 MUIA_Background, MUII_ButtonBack,
430 MUIA_CycleChain, TRUE,
431 MUIA_ShortHelp, tr(MSG_HELP_FOLDERIMAGE),
432 End,
433 Child, HVSpace,
434 End,
436 Child, KeyLabel(tr(MSG_BUTTON_LABEL_INDENTWIDTH), msg_indentwidth_key),
437 Child, data->SL_IndentWidth = SliderObject,
438 MUIA_Group_Horiz, TRUE,
439 MUIA_Slider_Min, 0,
440 MUIA_Slider_Max, 16,
441 MUIA_Slider_Level, MUICFGV_NListtree_IndentWidth_Default,
442 MUIA_Numeric_Format, "%ldpx",
443 MUIA_CycleChain, TRUE,
444 MUIA_ControlChar, msg_indentwidth_key,
445 MUIA_ShortHelp, tr(MSG_HELP_INDENTWIDTH),
446 End,
448 Child, KeyLabel(tr(MSG_BUTTON_LABEL_REMEMBER), msg_remember_status_key),
449 Child, HGroup,
450 Child, data->CH_RememberStatus = ImageObject,
451 ImageButtonFrame,
452 MUIA_Image_Spec, MUII_CheckMark,
453 MUIA_InputMode, MUIV_InputMode_Toggle,
454 MUIA_Selected, MUICFGV_NListtree_RememberStatus_Default,
455 MUIA_ShowSelState, FALSE,
456 MUIA_ControlChar, msg_remember_status_key,
457 MUIA_Background, MUII_ButtonBack,
458 MUIA_CycleChain, TRUE,
459 MUIA_ShortHelp, tr(MSG_HELP_REMEMBER),
460 End,
461 Child, HVSpace,
462 End,
464 Child, KeyLabel(tr(MSG_BUTTON_LABEL_AUTOSCROLL), msg_open_autoscroll_key),
465 Child, HGroup,
466 Child, data->CH_OpenAutoScroll = ImageObject,
467 ImageButtonFrame,
468 MUIA_Image_Spec, MUII_CheckMark,
469 MUIA_InputMode, MUIV_InputMode_Toggle,
470 MUIA_Selected, MUICFGV_NListtree_OpenAutoScroll_Default,
471 MUIA_ShowSelState, FALSE,
472 MUIA_ControlChar, msg_open_autoscroll_key,
473 MUIA_Background, MUII_ButtonBack,
474 MUIA_CycleChain, TRUE,
475 MUIA_ShortHelp, tr(MSG_HELP_AUTOSCROLL),
476 End,
477 Child, HVSpace,
478 End,
480 End,
482 End,
484 End,
488 ** Example
490 Child, VGroup, GroupFrameT(tr(MSG_TAB_EXAMPLE)),
491 MUIA_HorizWeight, 99,
493 Child, NListviewObject,
494 MUIA_ShortHelp, tr(MSG_HELP_LISTVIEW_EXAMPLE),
495 MUIA_NListview_NList, data->NLT_Sample = NListtreeObject,
496 MUIA_Frame, MUIV_Frame_InputList,
497 MUIA_CycleChain, TRUE,
498 MUIA_NListtree_IsMCP, TRUE,
499 MUIA_NListtree_DisplayHook, &dsphook,
500 MUIA_NListtree_CompareHook, MUIV_NListtree_CompareHook_LeavesTop,
501 MUIA_NListtree_DoubleClick, MUIV_NListtree_DoubleClick_All,
502 MUIA_NListtree_EmptyNodes, FALSE,
503 MUIA_NListtree_TreeColumn, 0,
504 MUIA_NListtree_Title, TRUE,
505 MUIA_NListtree_Format, ",",
506 End,
507 End,
509 Child, HGroup,
510 Child, data->BT_Sample_Expand = KeyButton(tr(MSG_BUTTON_LABEL_EXPAND), msg_bt_expand_key),
511 Child, data->BT_Sample_Collapse = KeyButton(tr(MSG_BUTTON_LABEL_COLLAPSE), msg_bt_collapse_key),
512 End,
514 End,
516 End,
518 Child, CrawlingObject,
519 TextFrame,
520 MUIA_FixHeightTxt, infotext1,
521 MUIA_Background, "m1",
523 Child, TextObject,
524 MUIA_Text_Copy, FALSE,
525 MUIA_Text_PreParse, "\033c",
526 MUIA_Text_Contents, infotext1,
527 End,
529 Child, TextObject,
530 MUIA_Text_Copy, FALSE,
531 MUIA_Text_PreParse, "\033c",
532 MUIA_Text_Contents, infotext2,
533 End,
535 Child, TextObject,
536 MUIA_Text_Copy, FALSE,
537 MUIA_Text_PreParse, "\033c",
538 MUIA_Text_Contents, infotext1,
539 End,
540 End,
542 End;
544 if ( data->GR_Prefs == NULL )
546 CoerceMethod( cl, obj, OM_DISPOSE );
547 return( 0 );
550 DrawSampleTree( data->NLT_Sample );
552 DoMethod( obj, OM_ADDMEMBER, data->GR_Prefs );
556 ** Open/close all nodes
559 DoMethod( data->BT_Sample_Expand, MUIM_Notify, MUIA_Pressed, FALSE,
560 data->NLT_Sample, 4, MUIM_NListtree_Open, MUIV_NListtree_Open_ListNode_Root, MUIV_NListtree_Open_TreeNode_All, 0 );
562 DoMethod( data->BT_Sample_Collapse, MUIM_Notify, MUIA_Pressed, FALSE,
563 data->NLT_Sample, 4, MUIM_NListtree_Close, MUIV_NListtree_Close_ListNode_Root, MUIV_NListtree_Close_TreeNode_All, 0 );
566 ** Open/closed node and special images
568 DoMethod( data->PI_ImageClosed, MUIM_Notify, MUIA_Imagedisplay_Spec, MUIV_EveryTime,
569 data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_ImageSpecClosed, MUIV_TriggerValue );
571 DoMethod( data->PI_ImageOpen, MUIM_Notify, MUIA_Imagedisplay_Spec, MUIV_EveryTime,
572 data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_ImageSpecOpen, MUIV_TriggerValue );
574 DoMethod( data->PI_ImageFolder, MUIM_Notify, MUIA_Imagedisplay_Spec, MUIV_EveryTime,
575 data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_ImageSpecFolder, MUIV_TriggerValue );
578 ** Colors
581 DoMethod( data->PP_LinePen, MUIM_Notify, MUIA_Pendisplay_Spec, MUIV_EveryTime,
582 data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_PenSpecLines, MUIV_TriggerValue );
584 DoMethod( data->PP_ShadowPen, MUIM_Notify, MUIA_Pendisplay_Spec, MUIV_EveryTime,
585 data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_PenSpecShadow, MUIV_TriggerValue );
587 DoMethod( data->PP_GlowPen, MUIM_Notify, MUIA_Pendisplay_Spec, MUIV_EveryTime,
588 data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_PenSpecGlow, MUIV_TriggerValue );
591 ** Values
593 DoMethod( data->CH_RememberStatus, MUIM_Notify, MUIA_Selected, MUIV_EveryTime,
594 data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_RememberStatus, MUIV_TriggerValue );
596 DoMethod( data->SL_IndentWidth, MUIM_Notify, MUIA_Slider_Level, MUIV_EveryTime,
597 data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_IndentWidth, MUIV_TriggerValue );
599 DoMethod( data->CH_OpenAutoScroll, MUIM_Notify, MUIA_Selected, MUIV_EveryTime,
600 data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_OpenAutoScroll, MUIV_TriggerValue );
602 DoMethod( data->CY_LineType, MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime,
603 data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_LineType, MUIV_TriggerValue );
605 DoMethod( data->CH_UseFolderImage, MUIM_Notify, MUIA_Selected, MUIV_EveryTime,
606 data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_UseFolderImage, MUIV_TriggerValue );
608 // connect some values to the changedhook so that disabled status things
609 // get updated
610 DoMethod(data->CH_UseFolderImage, MUIM_Notify, MUIA_Selected, MUIV_EveryTime,
611 data->NLT_Sample, 4, MUIM_CallHook, &ValuesChangedHook, data);
612 DoMethod( data->CY_LineType, MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime,
613 data->NLT_Sample, 4, MUIM_CallHook, &ValuesChangedHook, data);
615 // in case we are running for a newer MUI version we can register
616 // our mcc gadgets accordingly
617 if(MUIMasterBase->lib_Version >= 20)
619 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->PI_ImageClosed, MUICFG_NListtree_ImageSpecClosed, 1, "");
620 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->PI_ImageOpen, MUICFG_NListtree_ImageSpecOpen, 1, "");
621 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->PI_ImageFolder, MUICFG_NListtree_ImageSpecFolder, 1, "");
622 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->PP_LinePen, MUICFG_NListtree_PenSpecLines, 1, "");
623 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->PP_ShadowPen, MUICFG_NListtree_PenSpecShadow, 1, "");
624 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->PP_GlowPen, MUICFG_NListtree_PenSpecGlow, 1, "");
625 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->CH_RememberStatus,MUICFG_NListtree_RememberStatus, 1, "");
626 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->SL_IndentWidth, MUICFG_NListtree_IndentWidth, 1, "");
627 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->CH_OpenAutoScroll,MUICFG_NListtree_OpenAutoScroll, 1, "");
628 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->CY_LineType, MUICFG_NListtree_LineType, 1, "");
629 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->CH_UseFolderImage,MUICFG_NListtree_UseFolderImage, 1, "");
632 return((IPTR)obj);
636 static IPTR _DisposeP( struct IClass *cl, Object *obj, Msg msg )
638 struct NListtreeP_Data *data = INST_DATA( cl, obj );
639 ULONG result;
641 ENTER();
643 DoMethod( obj, OM_REMMEMBER, data->GR_Prefs );
645 if ( data->GR_Prefs )
646 MUI_DisposeObject( data->GR_Prefs );
648 result = DoSuperMethodA( cl, obj, msg );
650 RETURN(result);
651 return result;
655 static IPTR _SetupP( struct IClass *cl, Object *obj, struct MUIP_Setup *msg )
657 struct NListtreeP_Data *data = INST_DATA( cl, obj );
659 ENTER();
661 if(!DoSuperMethodA(cl, obj, (Msg)msg))
663 RETURN(FALSE);
664 return( FALSE );
668 ** Values
669 ** We set the values here directly to the NL, because
670 ** notification is only done, if values != old values.
672 TransferValues( data );
674 RETURN(TRUE);
675 return( TRUE );
678 static IPTR _ConfigToGadgets( struct IClass *cl, Object *obj, struct MUIP_Settingsgroup_ConfigToGadgets *msg )
680 struct NListtreeP_Data *data = INST_DATA(cl, obj);
681 Object *pdobj, *idobj;
682 struct MUI_ImageSpec *is;
683 struct MUI_PenSpec *pen = NULL;
684 IPTR d;
686 ENTER();
689 ** Create objects
691 pdobj = MUI_NewObject( MUIC_Pendisplay, TAG_DONE );
692 idobj = MUI_NewObject( MUIC_Imagedisplay, TAG_DONE );
694 D(DBF_ALWAYS, "pdobj: 0x%08lx, idobj: 0x%08lx", pdobj, idobj);
698 ** Set images
700 if((is = (struct MUI_ImageSpec *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_ImageSpecClosed)))
702 set( data->PI_ImageClosed, MUIA_Imagedisplay_Spec, is );
704 D(DBF_ALWAYS, "Closed node image: '%s'", (STRPTR)is);
706 else
708 if ( idobj )
710 DoMethod( idobj, MUIM_Set, MUIA_Imagedisplay_Spec, MUICFGV_NListtree_ImageSpecClosed_Default );
712 get( idobj, MUIA_Imagedisplay_Spec, &is );
713 set( data->PI_ImageClosed, MUIA_Imagedisplay_Spec, is );
715 D(DBF_ALWAYS, "Closed node image: '%s'", (STRPTR)is);
720 if((is = (struct MUI_ImageSpec *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_ImageSpecOpen)))
722 set( data->PI_ImageOpen, MUIA_Imagedisplay_Spec, is );
724 D(DBF_ALWAYS, "Open node image: '%s'", (STRPTR)is);
726 else
728 if ( idobj )
730 DoMethod( idobj, MUIM_Set, MUIA_Imagedisplay_Spec, MUICFGV_NListtree_ImageSpecOpen_Default );
732 get( idobj, MUIA_Imagedisplay_Spec, &is );
733 set( data->PI_ImageOpen, MUIA_Imagedisplay_Spec, is );
735 D(DBF_ALWAYS, "Open node image: '%s'", (STRPTR)is);
740 if((is = (struct MUI_ImageSpec *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_ImageSpecFolder)))
742 set( data->PI_ImageFolder, MUIA_Imagedisplay_Spec, is );
744 D(DBF_ALWAYS, "folder node image: '%s'", (STRPTR)is);
746 else
748 if ( idobj )
750 DoMethod( idobj, MUIM_Set, MUIA_Imagedisplay_Spec, MUICFGV_NListtree_ImageSpecFolder_Default );
752 get( idobj, MUIA_Imagedisplay_Spec, &is );
753 set( data->PI_ImageFolder, MUIA_Imagedisplay_Spec, is );
755 D(DBF_ALWAYS, "folder node image: '%s'", (STRPTR)is);
761 ** Set colors
763 if((d = DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_PenSpecLines)))
765 set( data->PP_LinePen, MUIA_Pendisplay_Spec, d );
767 D(DBF_ALWAYS, "Line color: '%s'", (STRPTR)d);
769 else
771 if( pdobj )
773 DoMethod( pdobj, MUIM_Pendisplay_SetMUIPen, MUICFGV_NListtree_PenSpecLines_Default );
775 get( pdobj, MUIA_Pendisplay_Spec, &pen );
776 set( data->PP_LinePen, MUIA_Pendisplay_Spec, pen );
778 D(DBF_ALWAYS, "Line color: '%s'", pen);
782 if((d = DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_PenSpecShadow)))
784 set( data->PP_ShadowPen, MUIA_Pendisplay_Spec, d );
786 D(DBF_ALWAYS, "Shadow color: '%s'", (STRPTR)d);
788 else
790 if( pdobj )
792 DoMethod( pdobj, MUIM_Pendisplay_SetMUIPen, MUICFGV_NListtree_PenSpecShadow_Default );
794 get( pdobj, MUIA_Pendisplay_Spec, &pen );
795 set( data->PP_ShadowPen, MUIA_Pendisplay_Spec, pen );
797 D(DBF_ALWAYS, "Shadow color: '%s'", pen);
801 if((d = DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_PenSpecGlow)))
803 set( data->PP_GlowPen, MUIA_Pendisplay_Spec, d );
805 D(DBF_ALWAYS, "Glow color: '%s'", (STRPTR)d);
807 else
809 if( pdobj )
811 DoMethod( pdobj, MUIM_Pendisplay_SetMUIPen, MUICFGV_NListtree_PenSpecGlow_Default );
813 get( pdobj, MUIA_Pendisplay_Spec, &pen );
814 set( data->PP_GlowPen, MUIA_Pendisplay_Spec, pen );
816 D(DBF_ALWAYS, "Glow color: '%s'", pen);
821 ** Set values
823 if((d = DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_LineType)))
825 set( data->CY_LineType, MUIA_Cycle_Active, atoi( (STRPTR)d ) );
826 ValuesChanged(data);
828 D(DBF_ALWAYS, "LineType: %ld", atoi( (STRPTR)d ));
830 else
832 set( data->CY_LineType, MUIA_Cycle_Active, MUICFGV_NListtree_LineType_Default );
833 ValuesChanged(data);
835 D(DBF_ALWAYS, "Style: %ld", 0);
838 if((d = DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_IndentWidth)))
840 set( data->SL_IndentWidth, MUIA_Slider_Level, atoi( (STRPTR)d ) );
842 D(DBF_ALWAYS, "IndentWidth: %ld", atoi( (STRPTR)d ));
844 else
846 set( data->SL_IndentWidth, MUIA_Slider_Level, MUICFGV_NListtree_IndentWidth_Default );
848 D(DBF_ALWAYS, "IndentWidth: %ld", MUICFGV_NListtree_IndentWidth_Default);
851 if((d = DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_RememberStatus)))
853 set( data->CH_RememberStatus, MUIA_Selected, atoi( (STRPTR)d ) );
855 D(DBF_ALWAYS, "RememberStatus: %ld", atoi( (STRPTR)d ));
857 else
859 set( data->CH_RememberStatus, MUIA_Selected, MUICFGV_NListtree_RememberStatus_Default );
861 D(DBF_ALWAYS, "RememberStatus: %ld", MUICFGV_NListtree_RememberStatus_Default);
864 if((d = DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_OpenAutoScroll)))
866 set( data->CH_OpenAutoScroll, MUIA_Selected, atoi( (STRPTR)d ) );
868 D(DBF_ALWAYS, "OpenAutoScroll: %ld", atoi( (STRPTR)d ));
870 else
872 set( data->CH_OpenAutoScroll, MUIA_Selected, MUICFGV_NListtree_OpenAutoScroll_Default );
874 D(DBF_ALWAYS, "OpenAutoScroll: %ld", MUICFGV_NListtree_OpenAutoScroll_Default);
877 if((d = DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_UseFolderImage)))
879 set( data->CH_UseFolderImage, MUIA_Selected, atoi( (STRPTR)d ) );
881 D(DBF_ALWAYS, "UseFolderImage: %ld", atoi( (STRPTR)d ));
883 else
885 set( data->CH_UseFolderImage, MUIA_Selected, MUICFGV_NListtree_UseFolderImage_Default );
887 D(DBF_ALWAYS, "UseFolderImage: %ld", MUICFGV_NListtree_UseFolderImage_Default);
891 ** Dispose created objects
893 if( pdobj )
894 MUI_DisposeObject( pdobj );
895 if( idobj )
896 MUI_DisposeObject( idobj );
898 RETURN(0);
899 return( 0 );
903 static IPTR _GadgetsToConfig( struct IClass *cl, Object *obj, struct MUIP_Settingsgroup_GadgetsToConfig *msg )
905 struct NListtreeP_Data *data = INST_DATA( cl, obj );
906 char buf[8];
907 IPTR d=0;
909 ENTER();
912 ** Images
914 get( data->PI_ImageClosed, MUIA_Imagedisplay_Spec, &d );
915 if( d != 0)
916 DoMethod( msg->configdata, MUIM_Dataspace_Add, d, strlen((char *)d)+1, MUICFG_NListtree_ImageSpecClosed );
918 D(DBF_ALWAYS, "Image closed: '%s'", (STRPTR)d);
921 get( data->PI_ImageOpen, MUIA_Imagedisplay_Spec, &d );
922 if(d != 0)
923 DoMethod( msg->configdata, MUIM_Dataspace_Add, d, strlen((char *)d)+1, MUICFG_NListtree_ImageSpecOpen );
925 D(DBF_ALWAYS, "Image open: '%s'", (STRPTR)d);
928 get( data->PI_ImageFolder, MUIA_Imagedisplay_Spec, &d );
929 if(d != 0)
930 DoMethod( msg->configdata, MUIM_Dataspace_Add, d, strlen((char *)d)+1, MUICFG_NListtree_ImageSpecFolder );
932 D(DBF_ALWAYS, "Image folder: '%s'", (STRPTR)d);
936 ** Colors
938 get( data->PP_LinePen, MUIA_Pendisplay_Spec, &d );
939 if(d != 0)
940 DoMethod( msg->configdata, MUIM_Dataspace_Add, d, strlen((char *)d)+1, MUICFG_NListtree_PenSpecLines );
942 D(DBF_ALWAYS, "Line color: '%s'", (STRPTR)d);
945 get( data->PP_ShadowPen, MUIA_Pendisplay_Spec, &d );
946 if(d != 0)
947 DoMethod( msg->configdata, MUIM_Dataspace_Add, d, strlen((char *)d)+1, MUICFG_NListtree_PenSpecShadow );
949 D(DBF_ALWAYS, "Shadow color: '%s'", (STRPTR)d);
952 get( data->PP_GlowPen, MUIA_Pendisplay_Spec, &d );
953 if(d != 0)
954 DoMethod( msg->configdata, MUIM_Dataspace_Add, d, strlen((char *)d)+1, MUICFG_NListtree_PenSpecGlow );
956 D(DBF_ALWAYS, "Glow color: '%s'", (STRPTR)d);
959 ** Values
963 get( data->CH_RememberStatus, MUIA_Selected, &d );
964 snprintf(buf, sizeof(buf), "%d", (int)d);
965 DoMethod( msg->configdata, MUIM_Dataspace_Add, buf, strlen(buf)+1, MUICFG_NListtree_RememberStatus );
967 D(DBF_ALWAYS, "RememberStatus: %ld", d);
970 get( data->SL_IndentWidth, MUIA_Slider_Level, &d );
971 snprintf(buf, sizeof(buf), "%d", (int)d);
972 DoMethod( msg->configdata, MUIM_Dataspace_Add, buf, strlen(buf)+1, MUICFG_NListtree_IndentWidth );
974 D(DBF_ALWAYS, "IndentWidth: %ld", d);
976 get( data->CH_OpenAutoScroll, MUIA_Selected, &d );
977 snprintf(buf, sizeof(buf), "%d", (int)d);
978 DoMethod( msg->configdata, MUIM_Dataspace_Add, buf, strlen(buf)+1, MUICFG_NListtree_OpenAutoScroll );
980 D(DBF_ALWAYS, "OpenAutoScroll: %ld", d);
982 get( data->CY_LineType, MUIA_Cycle_Active, &d );
983 snprintf(buf, sizeof(buf), "%d", (int)d);
984 DoMethod( msg->configdata, MUIM_Dataspace_Add, buf, strlen(buf)+1, MUICFG_NListtree_LineType );
986 D(DBF_ALWAYS, "LineType: %ld", d);
988 get( data->CH_UseFolderImage, MUIA_Selected, &d );
989 snprintf(buf, sizeof(buf), "%d", (int)d);
990 DoMethod( msg->configdata, MUIM_Dataspace_Add, buf, strlen(buf)+1, MUICFG_NListtree_UseFolderImage );
992 D(DBF_ALWAYS, "UseFolderImage: %ld", d);
994 RETURN(0);
995 return( 0 );
999 static IPTR _HandleInputP( struct IClass *cl, Object *obj, struct MUIP_HandleInput *msg )
1001 if( msg->imsg )
1003 switch( msg->imsg->Class )
1005 case IDCMP_INTUITICKS:
1006 break;
1010 return( DoSuperMethodA( cl, obj, (Msg)msg ) );
1013 DISPATCHER(_DispatcherP)
1015 switch(msg->MethodID)
1017 case OM_NEW: return(_NewP(cl, obj, (APTR)msg));
1018 case OM_DISPOSE: return(_DisposeP(cl, obj, (APTR)msg));
1020 case MUIM_Setup: return(_SetupP(cl, obj, (APTR)msg));
1021 case MUIM_HandleInput: return(_HandleInputP(cl, obj, (APTR)msg));
1023 case MUIM_Settingsgroup_ConfigToGadgets: return(_ConfigToGadgets(cl, obj, (APTR)msg));
1024 case MUIM_Settingsgroup_GadgetsToConfig: return(_GadgetsToConfig(cl, obj, (APTR)msg));
1027 return( DoSuperMethodA( cl, obj, msg ) );