1 /***************************************************************************
3 NList.mcc - New List MUI Custom Class
4 Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0
5 0x9d5100C0 to 0x9d5100FF
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 <clib/alib_protos.h>
30 #include <proto/graphics.h>
31 #include <proto/utility.h>
32 #include <proto/exec.h>
33 #include <proto/intuition.h>
37 #include "NList_func.h"
39 #include "NListviews_mcp.h"
40 #include "NListview_mcc.h"
42 extern const struct Hook NL_ConstructHook_String
;
43 extern const struct Hook NL_DestructHook_String
;
45 #define SET_PEN(var_dest,test_init) \
47 tag->ti_Tag = TAG_IGNORE; \
48 if(data->SETUP == TRUE) \
50 test_init = tag->ti_Data; \
51 obtain_pen(obj, &(var_dest), (struct MUI_PenSpec *)tag->ti_Data); \
56 #define SET_BG(var_dest,test_init) \
58 tag->ti_Tag = TAG_IGNORE; \
60 /* catch possible MUII_#? values, these must be used directly */ \
61 if(tag->ti_Data <= 0x00000100) \
63 var_dest = (IPTR)tag->ti_Data; \
67 strlcpy(var_dest##Buffer, (STRPTR)tag->ti_Data, sizeof(var_dest##Buffer)); \
68 var_dest = (IPTR)var_dest##Buffer; \
76 IPTR
mNL_AskMinMax(struct IClass
*cl
,Object
*obj
,struct MUIP_AskMinMax
*msg
)
78 struct NLData
*data
= INST_DATA(cl
,obj
);
79 LONG vinc
= data
->vinc
;
83 * LONG minwidth = _minwidth(obj);
84 * LONG minheight = _minheight(obj);
85 * LONG maxwidth = _maxwidth(obj);
86 * LONG maxheight = _maxheight(obj);
87 * LONG defwidth = _defwidth(obj);
88 * LONG defheight = _defheight(obj);
90 * D(bug("%lx|mNL_AskMinMax() %ld,%ld %ld,%ld %ld,%ld \n",obj,minwidth,minheight,defwidth,defheight,maxwidth,maxheight));
91 * DoSuperMethodA(cl,obj,(Msg) msg);
97 /*D(bug("%lx|mNL_AskMinMax() 1 \n",obj));*/
98 DoSuperMethodA(cl
,obj
,(Msg
) msg
);
99 /*D(bug("%lx|mNL_AskMinMax() 2 \n",obj));*/
101 data
->font
= _font(obj
);
102 data
->vinc
= data
->font
->tf_YSize
+ data
->addvinc
;
103 if (data
->NList_MinLineHeight
> data
->vinc
)
104 data
->vinc
= data
->NList_MinLineHeight
;
105 if (data
->MinImageHeight
> data
->vinc
)
106 data
->vinc
= data
->MinImageHeight
;
110 if ((vinc
> 1) && (vinc
!= data
->vinc
))
112 DO_NOTIFY(NTF_LineHeight
);
115 if (((data
->NList_SourceArray
== 2) || data
->VirtGroup
) && (data
->NList_Entries
> 0))
116 { struct RastPort
*tmprp2
= NULL
;
117 if ((data
->NList_AdjustWidth
== -1) && !data
->nodraw
&&
118 (tmprp2
= (struct RastPort
*) AllocVecShared(sizeof(struct RastPort
),0)))
119 { struct RastPort
*tmprp
= data
->rp
;
120 struct TextFont
*tmpfont
;
123 data
->rp
= &(_screen(obj
)->RastPort
);
124 *tmprp2
= *(data
->rp
);
126 tmpfont
= data
->rp
->Font
;
127 data
->font
= _font(obj
);
128 data
->pens
= _pens(obj
);
129 data
->voff
= data
->font
->tf_Baseline
+ (data
->vinc
- data
->font
->tf_YSize
+ 1)/2;
130 { struct TextExtent te
;
132 SetSoftStyle(data
->rp
, FSF_BOLD
|FSF_ITALIC
, STYLE_MASK
);
133 TextExtent(data
->rp
, "m", 1, &te
);
134 if (data
->hinc
< te
.te_Width
)
135 data
->hinc
= te
.te_Width
;
136 SetSoftStyle(data
->rp
, FSF_BOLD
|FSF_ITALIC
, STYLE_MASK
);
137 TextExtent(data
->rp
, "M", 1, &te
);
138 if (data
->hinc
< te
.te_Width
)
139 data
->hinc
= te
.te_Width
;
140 SetSoftStyle(data
->rp
, FSF_BOLD
|FSF_ITALIC
, STYLE_MASK
);
141 TextExtent(data
->rp
, "w", 1, &te
);
142 if (data
->hinc
< te
.te_Width
)
143 data
->hinc
= te
.te_Width
;
144 SetSoftStyle(data
->rp
, FSF_BOLD
|FSF_ITALIC
, STYLE_MASK
);
145 TextExtent(data
->rp
, "W", 1, &te
);
146 if (data
->hinc
< te
.te_Width
)
147 data
->hinc
= te
.te_Width
;
148 SetSoftStyle(data
->rp
, 0, STYLE_MASK
);
149 TextExtent(data
->rp
, " ", 1, &te
);
150 data
->spacesize
= te
.te_Width
;
152 data
->tabsize
= data
->spacesize
* data
->NList_TabSize
;
153 if (data
->tabsize
< 4)
158 AllWidthColumns(data
);
160 data
->NList_AdjustWidth
= 0;
162 for (column
= 0;column
< data
->numcols
;column
++)
163 { data
->NList_AdjustWidth
+= data
->cols
[column
].c
->colwidthmax
;
164 if (column
< data
->numcols
-1)
165 delta
+= data
->cols
[column
].c
->delta
;
167 if (data
->NList_AdjustWidth
< 2)
168 data
->NList_AdjustWidth
= -1;
170 data
->NList_AdjustWidth
+= delta
;
171 if (data
->rp
->Font
!=tmpfont
)
172 SetFont(data
->rp
,tmpfont
);
176 if (data
->NList_AdjustHeight
)
177 { if (data
->NList_Title
)
178 data
->NList_AdjustHeight
= ((data
->NList_Entries
+1) * data
->vinc
) + 1;
180 data
->NList_AdjustHeight
= (data
->NList_Entries
* data
->vinc
) + 1;
181 if (data
->NList_AdjustHeight
== 0)
182 data
->NList_AdjustHeight
= -1;
183 DONE_NOTIFY(NTF_MinMax
);
185 if (data
->NList_SourceArray
== 2)
186 data
->NList_SourceArray
= 1;
189 *D(bug("%lx|AskMinMax1 MiW=%ld DeW=%ld MaW=%ld MiH=%ld DeH=%ld MaH=%ld\n",obj,
190 * (LONG)msg->MinMaxInfo->MinWidth,(LONG)msg->MinMaxInfo->DefWidth,(LONG)msg->MinMaxInfo->MaxWidth,
191 * (LONG)msg->MinMaxInfo->MinHeight,(LONG)msg->MinMaxInfo->DefHeight,(LONG)msg->MinMaxInfo->MaxHeight));
193 if ((data
->NList_AdjustWidth
> 0) &&
194 ((data
->VirtGroup
|| (_screen(obj
)->Width
*3/4 > data
->NList_AdjustWidth
)) && (30 < data
->NList_AdjustWidth
)))
195 { msg
->MinMaxInfo
->MinWidth
+= data
->NList_AdjustWidth
;
196 msg
->MinMaxInfo
->DefWidth
+= data
->NList_AdjustWidth
;
197 msg
->MinMaxInfo
->MaxWidth
+= data
->NList_AdjustWidth
;
198 /*D(bug("%lx|1 AdjustWidth=%ld\n",obj,data->NList_AdjustWidth));*/
200 else if (data
->NList_AdjustWidth
> 0)
201 { if (_screen(obj
)->Width
*3/4 > data
->NList_AdjustWidth
)
202 msg
->MinMaxInfo
->MinWidth
+= data
->NList_AdjustWidth
;
204 msg
->MinMaxInfo
->MinWidth
+= 30;
205 msg
->MinMaxInfo
->DefWidth
+= data
->NList_AdjustWidth
;
206 if (30 < data
->NList_AdjustWidth
)
207 msg
->MinMaxInfo
->MaxWidth
+= data
->NList_AdjustWidth
;
209 msg
->MinMaxInfo
->MaxWidth
+= MUI_MAXMAX
;
210 /*D(bug("%lx|2 AdjustWidth=%ld\n",obj,data->NList_AdjustWidth));*/
213 { msg
->MinMaxInfo
->MinWidth
+= 30;
214 msg
->MinMaxInfo
->DefWidth
+= 300;
215 msg
->MinMaxInfo
->MaxWidth
+= MUI_MAXMAX
;
216 /*D(bug("%lx|3 AdjustWidth=%ld\n",obj,300));*/
218 if ((data
->NList_AdjustHeight
> 0) &&
219 ((data
->VirtGroup
|| (_screen(obj
)->Height
*3/4 > data
->NList_AdjustHeight
)) && ((data
->vinc
* 3) < data
->NList_AdjustHeight
)))
220 { msg
->MinMaxInfo
->MinHeight
+= data
->NList_AdjustHeight
;
221 msg
->MinMaxInfo
->DefHeight
+= data
->NList_AdjustHeight
;
222 msg
->MinMaxInfo
->MaxHeight
+= data
->NList_AdjustHeight
;
223 /*D(bug("%lx|1 AdjustHeight=%ld\n",obj,data->NList_AdjustHeight));*/
225 else if (data
->NList_AdjustHeight
> 0)
227 if (_screen(obj
)->Height
*3/4 > data
->NList_AdjustHeight
)
228 msg
->MinMaxInfo
->MinHeight
+= data
->NList_AdjustHeight
;
230 msg
->MinMaxInfo
->MinHeight
+= (data
->vinc
* 3);
231 msg
->MinMaxInfo
->DefHeight
+= data
->NList_AdjustHeight
;
232 if ((data
->vinc
* 3) < data
->NList_AdjustHeight
)
233 msg
->MinMaxInfo
->MaxHeight
+= data
->NList_AdjustHeight
;
235 msg
->MinMaxInfo
->MaxHeight
+= MUI_MAXMAX
;
236 /*D(bug("%lx|2 AdjustHeight=%ld\n",obj,data->NList_AdjustHeight));*/
239 { msg
->MinMaxInfo
->MinHeight
+= (data
->vinc
* 3);
240 msg
->MinMaxInfo
->DefHeight
+= 200;
241 msg
->MinMaxInfo
->MaxHeight
+= MUI_MAXMAX
;
242 /*D(bug("%lx|3 AdjustHeight=%ld\n",obj,200));*/
244 if (data
->NList_TitleSeparator
&& data
->NList_Title
)
245 { msg
->MinMaxInfo
->MinHeight
+= 2;
246 msg
->MinMaxInfo
->DefHeight
+= 2;
247 msg
->MinMaxInfo
->MaxHeight
+= 2;
250 *D(bug("%lx|AskMinMax2 MiW=%ld DeW=%ld MaW=%ld MiH=%ld DeH=%ld MaH=%ld\n",obj,
251 * (LONG)msg->MinMaxInfo->MinWidth,(LONG)msg->MinMaxInfo->DefWidth,(LONG)msg->MinMaxInfo->MaxWidth,
252 * (LONG)msg->MinMaxInfo->MinHeight,(LONG)msg->MinMaxInfo->DefHeight,(LONG)msg->MinMaxInfo->MaxHeight));
255 if (!WANTED_NOTIFY(NTF_MinMaxNoDraw
))
256 data
->do_draw_all
= data
->do_draw_title
= data
->do_draw
= TRUE
;
262 IPTR
mNL_Notify(struct IClass
*cl
,Object
*obj
,struct MUIP_Notify
*msg
)
264 struct NLData
*data
= INST_DATA(cl
,obj
);
265 switch(msg
->TrigAttr
)
267 case MUIA_NListview_Horiz_ScrollBar
:
269 data
->scrollersobj
= msg
->DestObj
;
272 case MUIA_NList_Horiz_First
:
273 WANT_NOTIFY(NTF_HSB
);
276 case MUIA_NList_Horiz_Entries
:
277 case MUIA_NList_Horiz_Visible
:
278 case MUIA_NList_HorizDeltaFactor
:
281 case MUIA_NList_Prop_First
:
282 WANT_NOTIFY(NTF_VSB
);
283 if (msg
->DestObj
&& !data
->VertPropObject
)
287 // check if MUIA_Prop_First exists
288 if(GetAttr(MUIA_Prop_First
, msg
->DestObj
, &val
) != FALSE
)
289 data
->VertPropObject
= msg
->DestObj
;
292 if (data
->VertPropObject
)
294 set(data
->VertPropObject
,MUIA_Prop_DoSmooth
, data
->NList_Smooth
);
298 case MUIA_NList_VertDeltaFactor
:
299 case MUIA_NList_Prop_Entries
:
300 case MUIA_NList_Prop_Visible
:
303 case MUIA_List_Prop_First
:
304 if (msg
->DestObj
&& !data
->VertPropObject
)
308 // check if there exists a MUIA_Prop_First attribute
309 if(GetAttr(MUIA_Prop_First
, msg
->DestObj
, &val
) != FALSE
)
310 data
->VertPropObject
= msg
->DestObj
;
312 if (data
->VertPropObject
)
314 struct List
*childlist
;
316 if((childlist
= (struct List
*)xget(data
->VertPropObject
, MUIA_Group_ChildList
)))
318 Object
*object_state
= (Object
*)childlist
->lh_Head
;
321 while((child
= NextObject(&object_state
)))
323 // check if there exists a MUIA_Prop_First attribute
324 if(GetAttr(MUIA_Prop_First
, msg
->DestObj
, &val
) != FALSE
)
326 data
->VertPropObject
= msg
->DestObj
;
331 DoMethod(obj
, MUIM_Notify
, MUIA_NList_Prop_Entries
,MUIV_EveryTime
,
332 data
->VertPropObject
, 3, MUIM_NoNotifySet
,MUIA_Prop_Entries
,MUIV_TriggerValue
);
333 DoMethod(obj
, MUIM_Notify
, MUIA_NList_Prop_Visible
,MUIV_EveryTime
,
334 data
->VertPropObject
, 3, MUIM_NoNotifySet
,MUIA_Prop_Visible
,MUIV_TriggerValue
);
335 DoMethod(obj
, MUIM_Notify
, MUIA_NList_Prop_First
,MUIV_EveryTime
,
336 data
->VertPropObject
, 3, MUIM_NoNotifySet
,MUIA_Prop_First
,MUIV_TriggerValue
);
337 DoMethod(data
->VertPropObject
, MUIM_Notify
, MUIA_Prop_First
,MUIV_EveryTime
,
338 obj
, 3, MUIM_NoNotifySet
,MUIA_NList_Prop_First
,MUIV_TriggerValue
);
339 DoMethod(obj
, MUIM_Notify
, MUIA_NList_VertDeltaFactor
,MUIV_EveryTime
,
340 data
->VertPropObject
, 3, MUIM_NoNotifySet
,MUIA_Prop_DeltaFactor
,MUIV_TriggerValue
);
341 set(data
->VertPropObject
,MUIA_Prop_DoSmooth
, data
->NList_Smooth
);
346 case MUIA_List_Prop_Entries
:
347 case MUIA_List_Prop_Visible
:
350 case MUIA_NList_First
:
351 WANT_NOTIFY(NTF_First
);
354 case MUIA_NList_Entries
:
355 WANT_NOTIFY(NTF_Entries
);
358 case MUIA_NList_Active
:
359 WANT_NOTIFY(NTF_Active
);
362 case MUIA_List_Active
:
363 WANT_NOTIFY(NTF_L_Active
);
366 case MUIA_NList_SelectChange
:
367 WANT_NOTIFY(NTF_Select
);
370 case MUIA_Listview_SelectChange
:
371 WANT_NOTIFY(NTF_LV_Select
);
374 case MUIA_NList_EntryClick
:
375 WANT_NOTIFY(NTF_EntryClick
);
378 case MUIA_NList_MultiClick
:
379 WANT_NOTIFY(NTF_Multiclick
);
382 case MUIA_NList_MultiClickAlone
:
383 WANT_NOTIFY(NTF_MulticlickAlone
);
386 case MUIA_NList_DoubleClick
:
387 msg
->TrigVal
= MUIV_EveryTime
;
388 WANT_NOTIFY(NTF_Doubleclick
);
391 case MUIA_Listview_DoubleClick
:
392 WANT_NOTIFY(NTF_LV_Doubleclick
);
395 case MUIA_NList_TitleClick
:
396 WANT_NOTIFY(NTF_TitleClick
);
399 case MUIA_NList_TitleClick2
:
400 WANT_NOTIFY(NTF_TitleClick2
);
403 case MUIA_NList_ButtonClick
:
404 WANT_NOTIFY(NTF_ButtonClick
);
407 case MUIA_NList_LineHeight
:
408 WANT_NOTIFY(NTF_LineHeight
);
411 case MUIA_NList_DragSortInsert
:
412 WANT_NOTIFY(NTF_DragSortInsert
);
415 case MUIA_NList_InsertPosition
:
416 WANT_NOTIFY(NTF_Insert
);
419 case MUIA_NList_Columns
:
420 WANT_NOTIFY(NTF_Columns
);
424 * D(bug("%lx|NL: Notify(0x%lx,0x%lx) ??? \n",obj,(long) msg->TrigAttr,(long) msg->TrigVal));
427 return (DoSuperMethodA(cl
,obj
,(Msg
) msg
));
431 IPTR
mNL_Set(struct IClass
*cl
,Object
*obj
,Msg msg
)
433 struct NLData
*data
= INST_DATA(cl
,obj
);
435 LONG do_things
= TRUE
;
436 struct TagItem
*tags
,*tag
;
438 for(tags
= ((struct opSet
*)msg
)->ops_AttrList
; (tag
= (struct TagItem
*)NextTagItem((APTR
)&tags
));)
442 case MUIA_Background
:
443 case MUIA_Group_Forward
:
446 case MUIA_NList_Visible
:
447 tag
->ti_Tag
= TAG_IGNORE
;
451 case MUIA_ShortHelp
: // RHP: Added for Special Shorthelp
454 data
->NList_ShortHelp
= (STRPTR
)tag
->ti_Data
;
458 case MUIA_ContextMenu
:
461 data
->NList_ContextMenu
= data
->ContextMenu
= (LONG
)tag
->ti_Data
;
463 if (data
->SETUP
&& (data
->NList_ContextMenu
== (LONG
)MUIV_NList_ContextMenu_Default
))
466 data
->ContextMenu
= MUIV_NList_ContextMenu_Always
;
468 if (DoMethod(obj
, MUIM_GetConfigItem
, MUICFG_NList_Menu
, &ptrd
))
472 case MUIV_NList_ContextMenu_TopOnly
:
473 case MUIV_NList_ContextMenu_Always
:
474 case MUIV_NList_ContextMenu_Never
:
475 data
->ContextMenu
= *ptrd
;
480 if ((data
->ContextMenu
== (LONG
)MUIV_NList_ContextMenu_TopOnly
) ||
481 (data
->ContextMenu
== (LONG
)MUIV_NList_ContextMenu_Never
))
483 else if (data
->ContextMenu
== (LONG
)MUIV_NList_ContextMenu_Always
)
484 tag
->ti_Data
= MUIV_NList_ContextMenu_Always
;
485 else if (((data
->ContextMenu
& 0x9d510030) == 0x9d510030) && (data
->numcols
<= 1))
488 data
->ContextMenuOn
= (LONG
) tag
->ti_Data
;
490 case MUIA_List_Active
:
491 if (!NOTIFYING(NTF_L_Active
))
492 NL_List_Active(data
,(long) tag
->ti_Data
,tag
,data
->NList_List_Select
,FALSE
,0);
493 NOTIFY_END(NTF_L_Active
);
494 DONE_NOTIFY(NTF_L_Active
);
496 case MUIA_NList_Active
:
497 // D(DBF_ALWAYS, "MUIA_NList_Active %ld was %ld %ld %ld",tag->ti_Data,data->NList_Active,NOTIFYING(NTF_Active),WANTED_NOTIFY(NTF_Active));
498 if (!NOTIFYING(NTF_Active
))
499 NL_List_Active(data
,(long) tag
->ti_Data
,tag
,data
->NList_List_Select
,FALSE
,0);
500 NOTIFY_END(NTF_Active
);
501 DONE_NOTIFY(NTF_Active
);
503 case MUIA_List_First
:
504 case MUIA_NList_First
:
507 NL_List_First(data
,(long) tag
->ti_Data
,tag
);
508 data
->ScrollBarsTime
= SCROLLBARSTIME
;
510 DONE_NOTIFY(NTF_First
);
512 case MUIA_NListview_Horiz_ScrollBar
: break;
513 case MUIA_List_Visible
: break;
514 case MUIA_List_Entries
: break;
515 case MUIA_NList_Entries
: break;
516 case MUIA_List_Quiet
:
517 case MUIA_NList_Quiet
:
518 data
->display_ptr
= NULL
;
519 data
->parse_column
= -1;
520 if (tag
->ti_Data
== (ULONG
)MUIV_NList_Quiet_Visual
)
522 else if (tag
->ti_Data
)
526 tag
->ti_Tag
= TAG_IGNORE
;
528 case MUIA_List_Prop_Entries
:
529 case MUIA_List_Prop_Visible
:
530 case MUIA_List_Prop_First
:
531 tag
->ti_Tag
= TAG_IGNORE
;
533 case MUIA_NList_Prop_Entries
:
534 data
->old_prop_entries
= tag
->ti_Data
;
536 case MUIA_NList_Prop_Visible
:
537 data
->old_prop_visible
= tag
->ti_Data
;
539 case MUIA_NList_Prop_First
:
540 if (!WANTED_NOTIFY(NTF_VSB
))
541 tag
->ti_Tag
= TAG_IGNORE
;
542 else if (((tag
->ti_Data
/ data
->vinc
) != (ULONG
)(data
->NList_Prop_First
/ data
->vinc
)) ||
543 (data
->NList_Smooth
&& (tag
->ti_Data
!= (ULONG
)data
->NList_Prop_First_Prec
)))
544 { LONG dobit
= tag
->ti_Data
- data
->old_prop_first
;
545 LONG Prop_FirstReal
= -100;
546 data
->old_prop_first
= tag
->ti_Data
;
548 dobit
= ((dobit
>= 0) ? dobit
: -dobit
) - data
->NList_Prop_Visible
;
549 dobit
= (dobit
>= 0) ? dobit
: -dobit
;
550 if ((dobit
>= 2) && !data
->drawall_dobit
)
551 data
->drawall_dobit
= 2;
553 NOWANT_NOTIFY(NTF_VSB
);
555 if(data
->VertPropObject
)
556 Prop_FirstReal
= (LONG
)xget(data
->VertPropObject
, MUIA_Prop_TrueFirst
);
558 data
->NList_Prop_First_Real
= tag
->ti_Data
;
559 if ((!data
->NList_Smooth
) || ((!data
->NList_First_Incr
) && (!data
->NList_AffFirst_Incr
) &&
560 ((data
->NList_Prop_First_Prec
- (LONG
)tag
->ti_Data
== data
->vinc
) ||
561 (data
->NList_Prop_First_Prec
- (LONG
)tag
->ti_Data
== -data
->vinc
) ||
562 (Prop_FirstReal
== data
->NList_Prop_First_Real
))))
564 lpfirst
= (data
->NList_Prop_First_Real
/ data
->vinc
) * data
->vinc
;
565 if ((lpfirst
> (data
->NList_Prop_Entries
- data
->NList_Prop_Visible
)) &&
566 (lpfirst
> data
->NList_Prop_First_Real
))
567 lpfirst
= data
->NList_Prop_Entries
- data
->NList_Prop_Visible
;
570 data
->NList_Prop_First
= (lpfirst
/ data
->vinc
) * data
->vinc
;
571 data
->NList_Prop_First_Real
= data
->NList_Prop_First
;
572 data
->NList_Prop_Add
= 0;
573 lpfirst
= data
->NList_Prop_First
/ data
->vinc
;
575 if (data
->NList_First
!= lpfirst
)
577 DO_NOTIFY(NTF_First
);
580 data
->NList_First
= lpfirst
;
581 data
->NList_First_Incr
= 0;
582 data
->NList_Prop_Wait
= 2;
583 if ((data
->NList_Prop_First_Real
- data
->NList_Prop_First_Prec
< -20) || (data
->NList_Prop_First_Real
- data
->NList_Prop_First_Prec
> 20))
584 data
->ScrollBarsTime
= SCROLLBARSTIME
;
585 if ((data
->NList_First
<= 0) || (data
->NList_First
+ data
->NList_Visible
>= data
->NList_Entries
))
586 data
->drawall_dobit
= 0;
590 { LONG lfirst
,lincr
,add
,add2
;
592 add
= data
->NList_Prop_First_Real
- data
->NList_Prop_First_Prec
;
593 if ((add
< -5) || (add
> 5))
594 data
->ScrollBarsTime
= SCROLLBARSTIME
;
596 if (((data
->NList_Prop_First_Real
< data
->NList_Prop_First_Prec
) &&
597 (data
->NList_Prop_First_Real
< data
->NList_Prop_First
)) ||
598 ((data
->NList_Prop_First_Real
> data
->NList_Prop_First_Prec
) &&
599 (data
->NList_Prop_First_Real
> data
->NList_Prop_First
)))
601 add2
= data
->NList_Prop_First_Real
- data
->NList_Prop_First
;
602 if (((add2
> 0) && ((add
* 2) < add2
)) ||
603 ((add2
< 0) && ((add
* 2) > add2
)))
604 data
->NList_Prop_First
+= (add
* 2);
606 data
->NList_Prop_First
= data
->NList_Prop_First_Real
;
608 lfirst
= data
->NList_Prop_First
/ data
->vinc
;
609 lincr
= data
->NList_Prop_First
% data
->vinc
;
610 if (((add
< -1) || (add
> 1)) &&
611 ((data
->NList_First
!= lfirst
) || (data
->NList_First_Incr
!= lincr
)))
612 { data
->NList_Prop_Add
= add
;
613 data
->NList_Prop_Wait
= 1;
615 if (data
->NList_First
!= lfirst
)
617 DO_NOTIFY(NTF_First
);
620 data
->NList_First
= lfirst
;
621 data
->NList_First_Incr
= lincr
;
624 else if ((lfirst
* data
->vinc
) == data
->NList_Prop_First
)
625 { data
->NList_Prop_Add
= 0;
626 data
->NList_Prop_Wait
= 1;
628 if (data
->NList_First
!= lfirst
)
630 DO_NOTIFY(NTF_First
);
633 data
->NList_First
= lfirst
;
634 data
->NList_First_Incr
= lincr
;
638 { if ((add
< 0) && (data
->NList_Prop_Add
> -2))
639 data
->NList_Prop_Add
= -2;
640 else if ((add
> 0) && (data
->NList_Prop_Add
< 2))
641 data
->NList_Prop_Add
= 2;
645 data
->NList_Prop_Add
= add
;
647 if (data
->drawall_dobit
== 2)
648 data
->drawall_dobit
= 0;
649 WANT_NOTIFY(NTF_VSB
);
651 data
->NList_Prop_First_Prec
= tag
->ti_Data
;
652 if ((tag
->ti_Tag
== MUIA_NList_Prop_First
) || (tag
->ti_Tag
== MUIA_List_Prop_First
))
653 data
->old_prop_first
= tag
->ti_Data
;
655 case MUIA_NList_Horiz_Entries
:
656 data
->old_horiz_entries
= tag
->ti_Data
;
658 case MUIA_NList_Horiz_Visible
:
659 data
->old_horiz_visible
= tag
->ti_Data
;
662 case MUIA_NList_Horiz_First
:
666 data
->old_horiz_first
= tag
->ti_Data
;
667 NL_List_Horiz_First(data
,(long) tag
->ti_Data
,tag
);
668 data
->ScrollBarsTime
= SCROLLBARSTIME
;
670 if (tag
->ti_Tag
== MUIA_NList_Horiz_First
)
671 data
->old_horiz_first
= tag
->ti_Data
;
675 case MUIA_List_Title
:
676 case MUIA_NList_Title
:
677 data
->display_ptr
= NULL
;
678 if (tag
->ti_Data
&& !data
->NList_Title
)
679 { data
->NList_Title
= (char *) tag
->ti_Data
;
680 NL_SetColsAdd(data
,-1,TRUE
);
683 else if (!tag
->ti_Data
&& data
->NList_Title
)
684 { NL_SetColsRem(data
,-1);
685 data
->NList_Title
= NULL
;
688 else if (tag
->ti_Data
&& data
->NList_Title
)
689 { NL_SetColsRem(data
,-1);
690 data
->NList_Title
= (char *) tag
->ti_Data
;
691 NL_SetColsAdd(data
,-1,TRUE
);
695 case MUIA_NList_TitleSeparator
:
696 data
->display_ptr
= NULL
;
697 data
->NList_TitleSeparator
= (LONG
) tag
->ti_Data
;
700 case 0x8042C53E : /* sent by Listview, has same value as its MUIA_Listview_Input */
702 case MUIA_Listview_Input
:
703 case MUIA_NList_Input
:
705 { if (!data
->NList_Input
)
706 { data
->NList_Input
= TRUE
;
707 nnset(obj
,MUIA_Frame
, MUIV_Frame_InputList
);
711 else if (data
->NList_Input
)
713 data
->NList_Input
= FALSE
;
714 set_Active(MUIV_NList_Active_Off
);
715 NL_UnSelectAll(data
,-1);
716 nnset(data
->this,MUIA_Frame
, MUIV_Frame_ReadList
);
720 case MUIA_Listview_MultiSelect
:
721 case MUIA_NList_MultiSelect
:
722 { BOOL reactive
= FALSE
;
723 if (data
->multiselect
== MUIV_NList_MultiSelect_None
)
725 switch ((LONG
) tag
->ti_Data
)
726 { case MUIV_NList_MultiSelect_None
:
727 data
->multiselect
= data
->NList_MultiSelect
= MUIV_NList_MultiSelect_None
;
728 set_Active(MUIV_NList_Active_Off
);
729 NL_UnSelectAll(data
,-1);
731 case MUIV_NList_MultiSelect_Default
:
732 data
->NList_MultiSelect
= MUIV_NList_MultiSelect_Default
;
735 if (data
->SETUP
&& DoMethod(obj
, MUIM_GetConfigItem
, MUICFG_NList_MultiSelect
, (SIPTR
) (&multisel
)))
736 data
->multiselect
= *multisel
& 0x0007;
738 data
->multiselect
= MUIV_NList_MultiSelect_Shifted
;
741 case MUIV_NList_MultiSelect_Shifted
:
742 case MUIV_NList_MultiSelect_Always
:
743 data
->multiselect
= data
->NList_MultiSelect
= (LONG
) tag
->ti_Data
;
746 if (reactive
&& (data
->multiselect
!= MUIV_NList_MultiSelect_None
) &&
747 (data
->NList_Active
>= 0) && (data
->NList_Active
< data
->NList_Entries
))
748 { NL_UnSelectAll(data
,data
->NList_Active
);
749 data
->selectmode
= MUIV_NList_Select_On
;
750 NL_List_Active(data
,data
->NList_Active
,NULL
,data
->selectmode
,TRUE
,0);
754 case MUIA_List_DragSortable
:
755 case MUIA_NList_DragSortable
:
756 data
->NList_DragSortable
= (LONG
) tag
->ti_Data
;
757 tag
->ti_Tag
= TAG_IGNORE
;
758 if (data
->NList_DragSortable
)
759 { if (data
->drag_type
== MUIV_NList_DragType_None
)
761 if (data
->SETUP
&& DoMethod(obj
, MUIM_GetConfigItem
, MUICFG_NList_DragType
, &ptrd
))
762 data
->drag_type
= *ptrd
;
764 data
->drag_type
= MUIV_NList_DragType_Immediate
;
767 else if (data
->NList_DragType
== MUIV_NList_DragType_None
)
768 data
->drag_type
= MUIV_NList_DragType_None
;
769 nnset(obj
,MUIA_Dropable
,data
->NList_Dropable
);
771 case MUIA_Listview_DragType
:
772 case MUIA_NList_DragType
:
773 data
->NList_DragType
= (LONG
) tag
->ti_Data
;
774 tag
->ti_Tag
= TAG_IGNORE
;
775 if (data
->NList_DragType
== MUIV_NList_DragType_Default
)
777 if (data
->SETUP
&& DoMethod(obj
, MUIM_GetConfigItem
, MUICFG_NList_DragType
, &ptrd
))
778 data
->drag_type
= *ptrd
;
780 data
->drag_type
= MUIV_NList_DragType_Immediate
;
783 data
->drag_type
= data
->NList_DragType
;
785 case MUIA_NList_DragColOnly
:
786 data
->NList_DragColOnly
= (LONG
) tag
->ti_Data
;
788 case MUIA_List_ShowDropMarks
:
789 case MUIA_NList_ShowDropMarks
:
790 data
->NList_ShowDropMarks
= (LONG
) tag
->ti_Data
;
791 if (data
->NList_DragSortable
)
792 data
->NList_ShowDropMarks
= TRUE
;
793 tag
->ti_Tag
= TAG_IGNORE
;
795 case MUIA_Draggable
:
796 /*D(bug("%lx|set(MUIA_Draggable,%lx) \n",obj,tag->ti_Data));*/
797 tag
->ti_Tag
= TAG_IGNORE
;
798 if (tag
->ti_Data
&& (data
->drag_type
== MUIV_NList_DragType_None
))
800 data
->NList_DragType
= MUIV_NList_DragType_Default
;
801 if (data
->SETUP
&& DoMethod(obj
, MUIM_GetConfigItem
, MUICFG_NList_DragType
, &ptrd
))
802 data
->drag_type
= *ptrd
;
804 data
->drag_type
= MUIV_NList_DragType_Immediate
;
806 else if (!tag
->ti_Data
)
807 data
->NList_DragType
= data
->drag_type
= MUIV_NList_DragType_None
;
810 data
->NList_Dropable
= tag
->ti_Data
;
811 if (data
->NList_Dropable
|| data
->NList_DragSortable
)
814 tag
->ti_Data
= FALSE
;
816 case MUIA_List_ConstructHook
:
817 case MUIA_NList_ConstructHook
:
818 /*D(bug("%lx|set_ConstructHook=0x%lx \n",obj,tag->ti_Data));*/
819 if (tag
->ti_Data
== (ULONG
)MUIV_NList_ConstructHook_String
)
820 data
->NList_ConstructHook
= (struct Hook
*) &NL_ConstructHook_String
;
822 data
->NList_ConstructHook
= (struct Hook
*) tag
->ti_Data
;
823 data
->NList_ConstructHook2
= FALSE
;
824 data
->do_setcols
= data
->do_updatesb
= data
->do_wwrap
= TRUE
;
825 data
->display_ptr
= NULL
;
827 case MUIA_NList_ConstructHook2
:
828 data
->NList_ConstructHook
= (struct Hook
*) tag
->ti_Data
;
829 data
->NList_ConstructHook2
= TRUE
;
830 data
->do_setcols
= data
->do_updatesb
= data
->do_wwrap
= TRUE
;
831 data
->display_ptr
= NULL
;
833 case MUIA_List_DestructHook
:
834 case MUIA_NList_DestructHook
:
835 /*D(bug("%lx|set_DestructHook=0x%lx \n",obj,tag->ti_Data));*/
836 if (tag
->ti_Data
== (ULONG
)MUIV_NList_DestructHook_String
)
837 data
->NList_DestructHook
= (struct Hook
*) &NL_DestructHook_String
;
839 data
->NList_DestructHook
= (struct Hook
*) tag
->ti_Data
;
840 data
->NList_DestructHook2
= FALSE
;
841 data
->do_setcols
= data
->do_updatesb
= data
->do_wwrap
= TRUE
;
842 data
->display_ptr
= NULL
;
844 case MUIA_NList_DestructHook2
:
845 data
->NList_DestructHook
= (struct Hook
*) tag
->ti_Data
;
846 data
->NList_DestructHook2
= TRUE
;
847 data
->do_setcols
= data
->do_updatesb
= data
->do_wwrap
= TRUE
;
848 data
->display_ptr
= NULL
;
850 case MUIA_List_CompareHook
:
851 case MUIA_NList_CompareHook
:
852 /*D(bug("%lx|set_CompareHook=0x%lx \n",obj,tag->ti_Data));*/
853 data
->NList_CompareHook
= (struct Hook
*) tag
->ti_Data
;
854 data
->NList_CompareHook2
= FALSE
;
856 case MUIA_NList_CompareHook2
:
857 data
->NList_CompareHook
= (struct Hook
*) tag
->ti_Data
;
858 data
->NList_CompareHook2
= TRUE
;
860 case MUIA_List_DisplayHook
:
861 case MUIA_NList_DisplayHook
:
862 /*D(bug("%lx|set_DisplayHook=0x%lx \n",obj,tag->ti_Data));*/
863 data
->NList_DisplayHook
= (struct Hook
*) tag
->ti_Data
;
864 data
->NList_DisplayHook2
= FALSE
;
865 data
->do_setcols
= data
->do_updatesb
= data
->do_wwrap
= TRUE
;
866 data
->display_ptr
= NULL
;
868 case MUIA_NList_DisplayHook2
:
869 data
->NList_DisplayHook
= (struct Hook
*) tag
->ti_Data
;
870 data
->NList_DisplayHook2
= TRUE
;
871 data
->do_setcols
= data
->do_updatesb
= data
->do_wwrap
= TRUE
;
872 data
->display_ptr
= NULL
;
874 case MUIA_List_MultiTestHook
:
875 case MUIA_NList_MultiTestHook
:
876 /*D(bug("%lx|set_MultiTestHook=0x%lx \n",obj,tag->ti_Data));*/
877 data
->NList_MultiTestHook
= (struct Hook
*) tag
->ti_Data
;
879 case MUIA_NList_CopyEntryToClipHook
:
880 data
->NList_CopyEntryToClipHook
= (struct Hook
*) tag
->ti_Data
;
881 data
->NList_CopyEntryToClipHook2
= FALSE
;
883 case MUIA_NList_CopyEntryToClipHook2
:
884 data
->NList_CopyEntryToClipHook
= (struct Hook
*) tag
->ti_Data
;
885 data
->NList_CopyEntryToClipHook2
= TRUE
;
887 case MUIA_NList_CopyColumnToClipHook
:
888 data
->NList_CopyColumnToClipHook
= (struct Hook
*) tag
->ti_Data
;
889 data
->NList_CopyColumnToClipHook2
= FALSE
;
891 case MUIA_NList_CopyColumnToClipHook2
:
892 data
->NList_CopyColumnToClipHook
= (struct Hook
*) tag
->ti_Data
;
893 data
->NList_CopyColumnToClipHook2
= TRUE
;
895 case MUIA_Listview_DoubleClick
:
896 WANT_NOTIFY(NTF_LV_Doubleclick
);
898 case MUIA_NList_EntryClick
:
899 WANT_NOTIFY(NTF_EntryClick
);
901 case MUIA_NList_MultiClick
:
902 WANT_NOTIFY(NTF_Multiclick
);
904 case MUIA_NList_MultiClickAlone
:
905 WANT_NOTIFY(NTF_MulticlickAlone
);
907 case MUIA_NList_DoubleClick
:
908 WANT_NOTIFY(NTF_Doubleclick
);
910 case MUIA_NList_TitleClick
:
911 /*D(bug("set(%lx,NList_TitleClick,%lx)\n",obj,tag->ti_Data));*/
912 WANT_NOTIFY(NTF_TitleClick
);
914 case MUIA_NList_TitleClick2
:
915 /*D(bug("set(%lx,NList_TitleClick2,%lx)\n",obj,tag->ti_Data));*/
916 WANT_NOTIFY(NTF_TitleClick2
);
918 case MUIA_Listview_SelectChange
:
919 WANT_NOTIFY(NTF_LV_Select
);
921 case MUIA_NList_SelectChange
:
922 WANT_NOTIFY(NTF_Select
);
924 case MUIA_NList_TitlePen
:
925 SET_PEN(data
->NList_TitlePen
,data
->Pen_Title_init
);
927 case MUIA_NList_ListPen
:
928 SET_PEN(data
->NList_ListPen
,data
->Pen_List_init
);
930 case MUIA_NList_SelectPen
:
931 SET_PEN(data
->NList_SelectPen
,data
->Pen_Select_init
);
933 case MUIA_NList_CursorPen
:
934 SET_PEN(data
->NList_CursorPen
,data
->Pen_Cursor_init
);
936 case MUIA_NList_UnselCurPen
:
937 SET_PEN(data
->NList_UnselCurPen
,data
->Pen_UnselCur_init
);
939 case MUIA_NList_InactivePen
:
940 SET_PEN(data
->NList_InactivePen
,data
->Pen_Inactive_init
);
942 case MUIA_NList_TitleBackground
:
943 SET_BG(data
->NList_TitleBackGround
,data
->BG_Title_init
);
945 case MUIA_NList_ListBackground
:
946 SET_BG(data
->NList_ListBackGround
,data
->BG_List_init
);
948 case MUIA_NList_SelectBackground
:
949 SET_BG(data
->NList_SelectBackground
,data
->BG_Select_init
);
951 case MUIA_NList_CursorBackground
:
952 SET_BG(data
->NList_CursorBackground
,data
->BG_Cursor_init
);
954 case MUIA_NList_UnselCurBackground
:
955 SET_BG(data
->NList_UnselCurBackground
,data
->BG_UnselCur_init
);
957 case MUIA_NList_InactiveBackground
:
958 SET_BG(data
->NList_InactiveBackground
,data
->BG_Inactive_init
);
961 case MUIA_NList_DefaultObjectOnClick
:
962 data
->NList_DefaultObjectOnClick
= (LONG
) tag
->ti_Data
;
965 case MUIA_NList_ActiveObjectOnClick
:
967 data
->NList_ActiveObjectOnClick
= (BOOL
)tag
->ti_Data
;
968 if(data
->NList_ActiveObjectOnClick
)
970 // disable that the object will automatically get a border when
971 // the ActiveObjectOnClick option is active
972 _flags(obj
) |= (1<<7);
973 if(data
->nlistviewobj
!= NULL
)
974 _flags(data
->nlistviewobj
) |= (1<<7);
978 // enable that the object will automatically get a border when
979 // the ActiveObjectOnClick option is active
980 _flags(obj
) &= ~(1<<7);
981 if(data
->nlistviewobj
!= NULL
)
982 _flags(data
->nlistviewobj
) &= ~(1<<7);
987 case MUIA_List_MinLineHeight
:
988 case MUIA_NList_MinLineHeight
:
989 data
->NList_MinLineHeight
= (LONG
) tag
->ti_Data
;
990 if (data
->NList_MinLineHeight
<= 0)
991 { data
->addvinc
= -data
->NList_MinLineHeight
;
994 else if ((data
->NList_MinLineHeight
!= data
->vinc
) &&
995 (data
->NList_MinLineHeight
> data
->font
->tf_YSize
) &&
996 (data
->NList_MinLineHeight
> data
->MinImageHeight
))
997 { data
->addvinc
= DEFAULT_VERT_INC
;
1000 if (DoMethod(obj
, MUIM_GetConfigItem
, MUICFG_NList_VertInc
, &ptrd
))
1001 data
->addvinc
= *ptrd
;
1006 case MUIA_NList_ForcePen
:
1007 data
->NList_ForcePen
= (LONG
) tag
->ti_Data
;
1008 tag
->ti_Tag
= TAG_IGNORE
;
1009 if (data
->NList_ForcePen
== MUIV_NList_ForcePen_Default
)
1011 if (data
->SETUP
&& DoMethod(obj
, MUIM_GetConfigItem
, MUICFG_NList_ForcePen
, &ptrd
))
1012 data
->ForcePen
= *ptrd
;
1014 data
->ForcePen
= MUIV_NList_ForcePen_Off
;
1017 data
->ForcePen
= data
->NList_ForcePen
;
1020 case MUIA_List_Format
:
1021 case MUIA_NList_Format
:
1022 data
->NList_Format
= (char *) tag
->ti_Data
;
1023 if (data
->NList_Format
)
1024 NL_Read_Format(data
,data
->NList_Format
,(tag
->ti_Tag
== MUIA_List_Format
));
1026 NL_Read_Format(data
, (char *)"",(tag
->ti_Tag
== MUIA_List_Format
));
1027 Make_Active_Visible
;
1030 case MUIA_NList_MakeActive
:
1031 data
->NList_MakeActive
= tag
->ti_Data
;
1033 case MUIA_NList_KeepActive
:
1034 data
->NList_KeepActive
= tag
->ti_Data
;
1036 case MUIA_NList_TypeSelect
:
1038 NL_UnSelectAll(data
,FALSE
);
1039 UnSelectCharSel(data
,FALSE
);
1040 data
->NList_TypeSelect
= (LONG
) tag
->ti_Data
;
1041 NL_UnSelectAll(data
,FALSE
);
1042 UnSelectCharSel(data
,FALSE
);
1043 set_Active(MUIV_NList_Active_Off
);
1047 case MUIA_Listview_DefClickColumn
:
1048 case MUIA_NList_DefClickColumn
:
1049 data
->NList_DefClickColumn
= (LONG
) tag
->ti_Data
;
1051 case MUIA_NList_AutoCopyToClip
:
1052 data
->NList_AutoCopyToClip
= (LONG
) tag
->ti_Data
;
1054 case MUIA_NList_AutoClip
:
1055 data
->NList_AutoClip
= (BOOL
)tag
->ti_Data
;
1057 case MUIA_NList_TabSize
:
1058 data
->NList_TabSize
= (LONG
) tag
->ti_Data
;
1061 case MUIA_NList_SkipChars
:
1062 data
->NList_SkipChars
= (char *) tag
->ti_Data
;
1065 case MUIA_NList_WordSelectChars
:
1066 data
->NList_WordSelectChars
= (char *) tag
->ti_Data
;
1068 case MUIA_NList_DisplayRecall
:
1069 data
->display_ptr
= NULL
;
1071 case MUIA_List_AutoVisible
:
1072 case MUIA_NList_AutoVisible
:
1073 data
->NList_AutoVisible
= (LONG
) tag
->ti_Data
;
1075 case MUIA_NList_EntryValueDependent
:
1076 data
->NList_EntryValueDependent
= (LONG
) tag
->ti_Data
;
1078 case MUIA_NList_SortType
:
1079 data
->NList_SortType
= (LONG
) tag
->ti_Data
;
1080 /*D(bug("set(%lx,NList_SortType,%lx)\n",obj,tag->ti_Data));*/
1082 case MUIA_NList_SortType2
:
1083 data
->NList_SortType2
= (LONG
) tag
->ti_Data
;
1084 /*D(bug("set(%lx,NList_SortType2,%lx)\n",obj,tag->ti_Data));*/
1086 case MUIA_NList_PrivateData
:
1087 data
->NList_PrivateData
= (APTR
) tag
->ti_Data
;
1089 case MUIA_NList_VertDeltaFactor
:
1090 data
->old_prop_delta
= tag
->ti_Data
;
1092 case MUIA_NList_HorizDeltaFactor
:
1093 data
->old_horiz_delta
= tag
->ti_Data
;
1095 case MUIA_NList_MinColSortable
:
1096 data
->NList_MinColSortable
= tag
->ti_Data
;
1098 case MUIA_NList_Imports
:
1099 data
->NList_Imports
= tag
->ti_Data
;
1101 case MUIA_NList_Exports
:
1102 data
->NList_Exports
= tag
->ti_Data
;
1104 case MUIA_NList_TitleMark
:
1105 if (data
->NList_TitleMark
!= (LONG
)tag
->ti_Data
)
1106 { if (((data
->NList_TitleMark
& MUIV_NList_TitleMark_TypeMask
) == MUIV_NList_TitleMark_None
) &&
1107 ((data
->NList_TitleMark2
& MUIV_NList_TitleMark2_TypeMask
) == MUIV_NList_TitleMark2_None
) &&
1108 ((tag
->ti_Data
& MUIV_NList_TitleMark_TypeMask
) != MUIV_NList_TitleMark_None
))
1111 for (column
= 0;column
< data
->numcols
;column
++)
1112 { if (data
->cols
[column
].c
->userwidth
< 0)
1113 data
->cols
[column
].c
->colwidthbiggestptr
= -2;
1115 data
->do_setcols
= TRUE
;
1116 /* NL_SetColsAdd(data,-1,TRUE);*/
1117 /* data->do_draw = data->do_draw_all = data->do_parse = data->do_setcols = data->do_updatesb = data->do_wwrap = TRUE;*/
1119 data
->NList_TitleMark
= tag
->ti_Data
;
1120 /*D(bug("set(%lx,NList_TitleMark,%lx)\n",obj,tag->ti_Data));*/
1121 data
->display_ptr
= NULL
;
1122 data
->do_draw_title
= TRUE
;
1126 case MUIA_NList_TitleMark2
:
1127 if (data
->NList_TitleMark2
!= (LONG
)tag
->ti_Data
)
1128 { if (((data
->NList_TitleMark
& MUIV_NList_TitleMark_TypeMask
) == MUIV_NList_TitleMark_None
) &&
1129 ((data
->NList_TitleMark2
& MUIV_NList_TitleMark2_TypeMask
) == MUIV_NList_TitleMark2_None
) &&
1130 ((tag
->ti_Data
& MUIV_NList_TitleMark2_TypeMask
) != MUIV_NList_TitleMark2_None
))
1133 for (column
= 0;column
< data
->numcols
;column
++)
1134 { if (data
->cols
[column
].c
->userwidth
< 0)
1135 data
->cols
[column
].c
->colwidthbiggestptr
= -2;
1137 data
->do_setcols
= TRUE
;
1138 /* NL_SetColsAdd(data,-1,TRUE);*/
1139 /* data->do_draw = data->do_draw_all = data->do_parse = data->do_setcols = data->do_updatesb = data->do_wwrap = TRUE;*/
1141 data
->NList_TitleMark2
= tag
->ti_Data
;
1142 /*D(bug("set(%lx,NList_TitleMark2,%lx)\n",obj,tag->ti_Data));*/
1143 data
->display_ptr
= NULL
;
1144 data
->do_draw_title
= TRUE
;
1148 case MUIA_NList_Columns
:
1149 /*D(bug("set(%lx,MUIA_NList_Columns,%lx)\n",obj,tag->ti_Data));*/
1151 { NL_Columns(data
,(BYTE
*) tag
->ti_Data
);
1152 DONE_NOTIFY(NTF_Columns
);
1155 case MUIA_Disabled
:
1157 data
->NList_Disabled
= 1;
1159 { if (data
->NList_Disabled
)
1160 { data
->do_draw_all
= data
->do_draw_title
= data
->do_draw
= TRUE
;
1162 data
->NList_Disabled
= FALSE
;
1164 /*D(bug("%lx|Disabled=%ld\n",obj,data->NList_Disabled));*/
1168 data
->NList_Font
= tag
->ti_Data
;
1171 case MUIA_NList_KeyUpFocus
:
1172 data
->NList_KeyUpFocus
= (Object
*)tag
->ti_Data
;
1175 case MUIA_NList_KeyDownFocus
:
1176 data
->NList_KeyDownFocus
= (Object
*)tag
->ti_Data
;
1179 case MUIA_NList_KeyLeftFocus
:
1180 data
->NList_KeyLeftFocus
= (Object
*)tag
->ti_Data
;
1183 case MUIA_NList_KeyRightFocus
:
1184 data
->NList_KeyRightFocus
= (Object
*)tag
->ti_Data
;
1187 case MUIA_NList_IgnoreSpecialChars
:
1188 data
->NList_IgnoreSpecialChars
= (char *)tag
->ti_Data
;
1197 * case MUIA_FillArea :
1201 * D(bug("NL: Set(TAG_IGNORE,0x%lx) \n",(long) tag->ti_Data));
1204 * D(bug("%lx|NL: Set(0x%lx,0x%lx) ??? \n",obj,(long) tag->ti_Tag,(long) tag->ti_Data));
1208 retval
= DoSuperMethodA(cl
,obj
,msg
);
1210 /* do_notifies(NTF_AllChanges|NTF_MinMax);*/
1214 //$$$Sensei: major cleanup: return value variable wasn't needed. The same as store. It just takes stack space.
1215 // Some NList attributes (namely MUIA_NList_DragColOnly) wasn't returning TRUE after
1216 // getting so DoSuperMethodA() was called on them, result probably was undefined!
1217 // (It depends on what superclass do in OM_GET, if it clear storage data for undefined
1218 // attributes, it could cause problems...
1219 // Fixed msg type to correct one.
1220 IPTR
mNL_Get(struct IClass
*cl
,Object
*obj
,struct opGet
*msg
)
1222 struct NLData
*data
= INST_DATA( cl
, obj
);
1224 switch (((struct opGet
*)msg
)->opg_AttrID
)
1226 case MUIA_Listview_SelectChange
:
1227 case MUIA_NList_SelectChange
:
1228 case MUIA_Listview_DoubleClick
: *msg
->opg_Storage
= (ULONG
) TRUE
; return( TRUE
);
1229 case MUIA_NList_DoubleClick
: *msg
->opg_Storage
= (ULONG
) data
->click_line
; return( TRUE
);
1230 case MUIA_NList_MultiClick
: *msg
->opg_Storage
= (ULONG
) data
->multiclick
+ 1; return( TRUE
);
1231 case MUIA_NList_MultiClickAlone
: *msg
->opg_Storage
= (ULONG
) abs( data
->multiclickalone
); return( TRUE
);
1232 case MUIA_NList_EntryClick
: *msg
->opg_Storage
= (ULONG
) data
->click_line
; return( TRUE
);
1233 case MUIA_List_InsertPosition
:
1234 case MUIA_NList_InsertPosition
:
1235 case MUIA_NList_DragSortInsert
: *msg
->opg_Storage
= (ULONG
) data
->NList_LastInserted
; return( TRUE
);
1236 case MUIA_List_First
:
1237 case MUIA_NList_First
: *msg
->opg_Storage
= (ULONG
) data
->NList_First
; return( TRUE
);
1238 case MUIA_List_Visible
:
1239 case MUIA_NList_Visible
: *msg
->opg_Storage
= (ULONG
) ( data
->SHOW
? data
->NList_Visible
: -1 ); return( TRUE
);
1240 case MUIA_List_Entries
:
1241 case MUIA_NList_Entries
: *msg
->opg_Storage
= (ULONG
) data
->NList_Entries
; return( TRUE
);
1242 case MUIA_List_Active
:
1243 case MUIA_NList_Active
: *msg
->opg_Storage
= (ULONG
) data
->NList_Active
; return( TRUE
);
1244 case MUIA_NList_Horiz_First
: *msg
->opg_Storage
= (ULONG
) data
->NList_Horiz_First
; return( TRUE
);
1245 case MUIA_NList_Horiz_Visible
: *msg
->opg_Storage
= (ULONG
) data
->NList_Horiz_Visible
; return( TRUE
);
1246 case MUIA_NList_Horiz_Entries
: *msg
->opg_Storage
= (ULONG
) data
->NList_Horiz_Entries
; return( TRUE
);
1247 case MUIA_NList_Prop_First
:
1248 case MUIA_List_Prop_First
: *msg
->opg_Storage
= (ULONG
) data
->NList_Prop_First
; return( TRUE
);
1249 case MUIA_NList_Prop_Visible
:
1250 case MUIA_List_Prop_Visible
: *msg
->opg_Storage
= (ULONG
) data
->NList_Prop_Visible
; return( TRUE
);
1251 case MUIA_NList_Prop_Entries
:
1252 case MUIA_List_Prop_Entries
: *msg
->opg_Storage
= (ULONG
) data
->NList_Prop_Entries
; return( TRUE
);
1253 case MUIA_NList_VertDeltaFactor
: *msg
->opg_Storage
= (ULONG
) data
->vinc
; return( TRUE
);
1254 case MUIA_NList_HorizDeltaFactor
: *msg
->opg_Storage
= (ULONG
) data
->hinc
; return( TRUE
);
1255 case MUIA_NListview_Horiz_ScrollBar
: *msg
->opg_Storage
= (ULONG
) 0; return( TRUE
);
1256 case MUIA_NListview_Vert_ScrollBar
: *msg
->opg_Storage
= (ULONG
) 0; return( TRUE
);
1257 case MUIA_NList_TitlePen
: *msg
->opg_Storage
= (ULONG
) data
->NList_TitlePen
; return( TRUE
);
1258 case MUIA_NList_ListPen
: *msg
->opg_Storage
= (ULONG
) data
->NList_ListPen
; return( TRUE
);
1259 case MUIA_NList_SelectPen
: *msg
->opg_Storage
= (ULONG
) data
->NList_SelectPen
; return( TRUE
);
1260 case MUIA_NList_CursorPen
: *msg
->opg_Storage
= (ULONG
) data
->NList_CursorPen
; return( TRUE
);
1261 case MUIA_NList_UnselCurPen
: *msg
->opg_Storage
= (ULONG
) data
->NList_UnselCurPen
; return( TRUE
);
1262 case MUIA_NList_InactivePen
: *msg
->opg_Storage
= (ULONG
) data
->NList_InactivePen
; return( TRUE
);
1263 case MUIA_NList_TitleBackground
: *msg
->opg_Storage
= (ULONG
) data
->NList_TitleBackGround
; return( TRUE
);
1264 case MUIA_NList_ListBackground
: *msg
->opg_Storage
= (ULONG
) data
->NList_ListBackGround
; return( TRUE
);
1265 case MUIA_NList_SelectBackground
: *msg
->opg_Storage
= (ULONG
) data
->NList_SelectBackground
; return( TRUE
);
1266 case MUIA_NList_CursorBackground
: *msg
->opg_Storage
= (ULONG
) data
->NList_CursorBackground
; return( TRUE
);
1267 case MUIA_NList_UnselCurBackground
: *msg
->opg_Storage
= (ULONG
) data
->NList_UnselCurBackground
; return( TRUE
);
1268 case MUIA_NList_InactiveBackground
: *msg
->opg_Storage
= (ULONG
) data
->NList_InactiveBackground
; return( TRUE
);
1269 case MUIA_Listview_Input
:
1270 case MUIA_NList_Input
: *msg
->opg_Storage
= (ULONG
) data
->NList_Input
; return( TRUE
);
1271 case MUIA_List_Format
:
1272 case MUIA_NList_Format
: *msg
->opg_Storage
= (IPTR
) data
->NList_Format
; return( TRUE
);
1273 case MUIA_List_Title
:
1274 case MUIA_NList_Title
: *msg
->opg_Storage
= (IPTR
) data
->NList_Title
; return( TRUE
);
1275 case MUIA_NList_TitleSeparator
: *msg
->opg_Storage
= (ULONG
) data
->NList_TitleSeparator
; return( TRUE
);
1276 case MUIA_List_DragSortable
:
1277 case MUIA_NList_DragSortable
: *msg
->opg_Storage
= (ULONG
) data
->NList_DragSortable
; return( TRUE
);
1278 case MUIA_Listview_DragType
:
1279 case MUIA_NList_DragType
: *msg
->opg_Storage
= (ULONG
) data
->NList_DragType
; return( TRUE
);
1280 case MUIA_NList_DragColOnly
: *msg
->opg_Storage
= (ULONG
) data
->NList_DragColOnly
; return( TRUE
);
1281 case MUIA_List_ShowDropMarks
:
1282 case MUIA_NList_ShowDropMarks
: *msg
->opg_Storage
= (ULONG
) data
->NList_ShowDropMarks
; return( TRUE
);
1283 case MUIA_List_DropMark
:
1284 case MUIA_NList_DropMark
:
1285 if ((data
->marktype
& MUIV_NList_DropType_Mask
) == MUIV_NList_DropType_Below
)
1286 *msg
->opg_Storage
= (LONG
) data
->NList_DropMark
+ 1;
1288 *msg
->opg_Storage
= (LONG
) data
->NList_DropMark
;
1290 case MUIA_NList_DropType
:
1291 if ((data
->marktype
& MUIV_NList_DropType_Mask
) == MUIV_NList_DropType_Below
)
1292 *msg
->opg_Storage
= (LONG
) (data
->marktype
& ~MUIV_NList_DropType_Mask
) | MUIV_NList_DropType_Above
;
1294 *msg
->opg_Storage
= (LONG
) data
->marktype
;
1296 case MUIA_Listview_DefClickColumn
:
1297 case MUIA_NList_DefClickColumn
: *msg
->opg_Storage
= (ULONG
) data
->NList_DefClickColumn
; return( TRUE
);
1298 case MUIA_Listview_ClickColumn
:
1299 case MUIA_NList_ClickColumn
:
1300 { struct MUI_NList_TestPos_Result res
;
1301 res
.char_number
= -2;
1302 NL_List_TestPos(data
,MUI_MAXMAX
,MUI_MAXMAX
,&res
);
1303 *msg
->opg_Storage
= (LONG
) res
.column
;
1306 case MUIA_NList_TitleClick
: *msg
->opg_Storage
= (ULONG
) data
->TitleClick
; return( TRUE
);
1307 case MUIA_NList_TitleClick2
: *msg
->opg_Storage
= (ULONG
) data
->TitleClick2
; return( TRUE
);
1308 case MUIA_NList_ForcePen
: *msg
->opg_Storage
= (ULONG
) data
->ForcePen
; return( TRUE
);
1309 case MUIA_List_AutoVisible
:
1310 case MUIA_NList_AutoVisible
: *msg
->opg_Storage
= (ULONG
) data
->NList_AutoVisible
; return( TRUE
);
1311 case MUIA_NList_TabSize
: *msg
->opg_Storage
= (ULONG
) data
->NList_TabSize
; return( TRUE
);
1312 case MUIA_NList_SkipChars
: *msg
->opg_Storage
= (IPTR
) data
->NList_SkipChars
; return( TRUE
);
1313 case MUIA_NList_WordSelectChars
: *msg
->opg_Storage
= (IPTR
) data
->NList_WordSelectChars
; return( TRUE
);
1314 case MUIA_NList_EntryValueDependent
: *msg
->opg_Storage
= (ULONG
) data
->NList_EntryValueDependent
; return( TRUE
);
1315 case MUIA_NList_SortType
: *msg
->opg_Storage
= (ULONG
) data
->NList_SortType
; return( TRUE
);
1316 case MUIA_NList_SortType2
: *msg
->opg_Storage
= (ULONG
) data
->NList_SortType2
; return( TRUE
);
1317 case MUIA_NList_ButtonClick
: *msg
->opg_Storage
= (ULONG
) data
->NList_ButtonClick
; return( TRUE
);
1318 case MUIA_NList_MinColSortable
: *msg
->opg_Storage
= (ULONG
) data
->NList_MinColSortable
; return( TRUE
);
1319 case MUIA_NList_Columns
: *msg
->opg_Storage
= (IPTR
) NL_Columns(data
,NULL
); return( TRUE
);
1320 case MUIA_NList_Imports
: *msg
->opg_Storage
= (ULONG
) data
->NList_Imports
; return( TRUE
);
1321 case MUIA_NList_Exports
: *msg
->opg_Storage
= (ULONG
) data
->NList_Exports
; return( TRUE
);
1322 case MUIA_NList_TitleMark
: *msg
->opg_Storage
= (ULONG
) data
->NList_TitleMark
; return( TRUE
);
1323 case MUIA_NList_TitleMark2
: *msg
->opg_Storage
= (ULONG
) data
->NList_TitleMark2
; return( TRUE
);
1324 case MUIA_NList_AutoClip
: *msg
->opg_Storage
= (ULONG
) data
->NList_AutoClip
; return(TRUE
);
1325 case MUIA_NList_PrivateData
: *msg
->opg_Storage
= (IPTR
) data
->NList_PrivateData
; return(TRUE
);
1327 case MUIA_NList_IgnoreSpecialChars
: *msg
->opg_Storage
= (IPTR
)data
->NList_IgnoreSpecialChars
; return(TRUE
);
1329 case MUIA_NList_DefaultObjectOnClick
: *msg
->opg_Storage
= (IPTR
)data
->NList_DefaultObjectOnClick
; return(TRUE
);
1330 case MUIA_NList_ActiveObjectOnClick
: *msg
->opg_Storage
= (IPTR
)data
->NList_ActiveObjectOnClick
; return(TRUE
);
1332 case MUIA_NList_KeyUpFocus
: *msg
->opg_Storage
= (IPTR
)data
->NList_KeyUpFocus
; return(TRUE
);
1333 case MUIA_NList_KeyDownFocus
: *msg
->opg_Storage
= (IPTR
)data
->NList_KeyDownFocus
; return(TRUE
);
1334 case MUIA_NList_KeyLeftFocus
: *msg
->opg_Storage
= (IPTR
)data
->NList_KeyLeftFocus
; return(TRUE
);
1335 case MUIA_NList_KeyRightFocus
: *msg
->opg_Storage
= (IPTR
)data
->NList_KeyRightFocus
; return(TRUE
);
1337 case MUIA_Version
: *msg
->opg_Storage
= (ULONG
) LIB_VERSION
; return(TRUE
);
1338 case MUIA_Revision
: *msg
->opg_Storage
= (ULONG
) LIB_REVISION
; return(TRUE
);
1340 // Asking the superclass always yields MUIA_Disabled==FALSE even for really disabled lists.
1341 // Hence we return our own internal value, because NList intercepts MUIA_Disabled during
1343 case MUIA_Disabled
: *msg
->opg_Storage
= data
->NList_Disabled
? TRUE
: FALSE
; return(TRUE
);
1346 return(DoSuperMethodA(cl
, obj
, (Msg
)msg
));
1350 /* Cut-n-pasted from bottom of function.
1351 LONG *store = ((struct opGet *)msg)->opg_Storage;
1354 case MUIA_NList_MultiClickAlone:
1355 if (data->multiclickalone < 0)
1356 *store = -data->multiclickalone;
1358 *store = data->multiclickalone;
1360 retval = DoSuperMethodA(cl,obj,msg);
1366 * D(bug("NL: Get(0x%lx)=0x%lx \n",(long) ((struct opGet *)msg)->opg_AttrID, (long) *store));
1368 * D(bug("NL: Get(0x%lx)=???? \n",(long) ((struct opGet *)msg)->opg_AttrID));