2 Copyright © 2002-2015, The AROS Development Team. All rights reserved.
6 #include <aros/debug.h>
8 #include <clib/alib_protos.h>
9 #include <proto/utility.h>
10 #include <proto/intuition.h>
11 #include <proto/muimaster.h>
15 extern struct Library
*MUIMasterBase
;
17 struct MUI_ListviewData
22 /****** Listview.mui/MUIA_Listview_DefClickColumn ****************************
25 * MUIA_Listview_DefClickColumn -- (V7) [ISG], LONG
28 * The default value to be returned for MUIA_Listview_ClickColumn when a
29 * list entry is "double clicked" by pressing the "press" key (usually
30 * return/enter). The default default is zero.
33 * MUIA_Listview_ClickColumn
35 ******************************************************************************
39 /****** Listview.mui/MUIA_Listview_DoubleClick *******************************
42 * MUIA_Listview_DoubleClick -- (V4) [I.G], BOOL
45 * Set to TRUE when a list entry is double-clicked or the "press" key
46 * (usually return/enter) is received.
49 * MUIA_Listview_ClickColumn, MUIA_Listview_DefClickColumn,
50 * MUIA_Listview_SelectChange
52 ******************************************************************************
56 /**************************************************************************
58 **************************************************************************/
59 IPTR
Listview__OM_NEW(struct IClass
*cl
, Object
*obj
, struct opSet
*msg
)
61 struct MUI_ListviewData
*data
;
62 struct TagItem
*tag
, *tags
;
64 (Object
*) GetTagData(MUIA_Listview_List
, (IPTR
) NULL
,
70 obj
= (Object
*) DoSuperNewTags(cl
, obj
, NULL
,
71 MUIA_Group_Horiz
, TRUE
,
74 MUIA_Group_Spacing
, 0,
76 TAG_MORE
, msg
->ops_AttrList
);
81 data
= INST_DATA(cl
, obj
);
84 /* parse initial taglist, forward to list */
85 for (tags
= msg
->ops_AttrList
; (tag
= NextTagItem(&tags
));)
89 case MUIA_Listview_DoubleClick
:
90 case MUIA_Listview_Input
:
91 case MUIA_Listview_MultiSelect
:
92 case MUIA_Listview_ScrollerPos
:
93 set(list
, tag
->ti_Tag
, tag
->ti_Data
);
101 /**************************************************************************
103 **************************************************************************/
104 IPTR
Listview__OM_GET(struct IClass
*cl
, Object
*obj
, struct opGet
*msg
)
106 /* small macro to simplify return value storage */
107 #define STORE *(msg->opg_Storage)
108 struct MUI_ListviewData
*data
= INST_DATA(cl
, obj
);
110 switch (msg
->opg_AttrID
)
112 case MUIA_List_CompareHook
:
113 case MUIA_List_ConstructHook
:
114 case MUIA_List_DestructHook
:
115 case MUIA_List_DisplayHook
:
116 case MUIA_List_VertProp_First
:
117 case MUIA_List_Format
:
118 case MUIA_List_VertProp_Entries
:
119 case MUIA_List_VertProp_Visible
:
120 case MUIA_List_Active
:
121 case MUIA_List_First
:
122 case MUIA_List_Visible
:
123 case MUIA_List_Entries
:
124 case MUIA_List_Quiet
:
125 case MUIA_Listview_ClickColumn
:
126 case MUIA_Listview_DoubleClick
:
127 case MUIA_Listview_SelectChange
:
128 return GetAttr(msg
->opg_AttrID
, data
->list
, msg
->opg_Storage
);
130 case MUIA_Listview_List
:
131 STORE
= (IPTR
) data
->list
;
135 return DoSuperMethodA(cl
, obj
, (Msg
) msg
);
139 static IPTR
RedirectNotify(struct IClass
*cl
, Object
*obj
, Msg msg
,
142 struct MUI_ListviewData
*data
= INST_DATA(cl
, obj
);
146 case MUIA_List_Active
:
147 case MUIA_List_AutoVisible
:
148 case MUIA_List_CompareHook
:
149 case MUIA_List_ConstructHook
:
150 case MUIA_List_DestructHook
:
151 case MUIA_List_DisplayHook
:
152 case MUIA_List_DragSortable
:
153 case MUIA_List_DropMark
:
154 case MUIA_List_Entries
:
155 case MUIA_List_First
:
156 case MUIA_List_Format
:
157 case MUIA_List_InsertPosition
:
158 case MUIA_List_MultiTestHook
:
159 case MUIA_List_Quiet
:
160 case MUIA_List_ShowDropMarks
:
161 case MUIA_List_Title
:
162 case MUIA_List_VertProp_Entries
:
163 case MUIA_List_VertProp_First
:
164 case MUIA_List_VertProp_Visible
:
165 case MUIA_List_Visible
:
166 case MUIA_Listview_ClickColumn
:
167 case MUIA_Listview_DoubleClick
:
168 case MUIA_Listview_SelectChange
:
169 return DoMethodA(data
->list
, msg
);
172 return DoSuperMethodA(cl
, obj
, msg
);
175 /**************************************************************************
177 **************************************************************************/
178 IPTR
Listview__MUIM_Notify(struct IClass
*cl
, Object
*obj
,
179 struct MUIP_Notify
*msg
)
181 if ((IPTR
)msg
->DestObj
== MUIV_Notify_Self
)
184 return RedirectNotify(cl
, obj
, (Msg
) msg
, msg
->TrigAttr
);
187 /**************************************************************************
189 **************************************************************************/
190 IPTR
Listview__MUIM_KillNotify(struct IClass
*cl
, Object
*obj
,
191 struct MUIP_KillNotify
*msg
)
193 return RedirectNotify(cl
, obj
, (Msg
) msg
, msg
->TrigAttr
);
196 /**************************************************************************
198 **************************************************************************/
199 IPTR
Listview__MUIM_KillNotifyObj(struct IClass
*cl
, Object
*obj
,
200 struct MUIP_KillNotifyObj
*msg
)
202 if ((IPTR
)msg
->dest
== MUIV_Notify_Self
)
205 return RedirectNotify(cl
, obj
, (Msg
) msg
, msg
->TrigAttr
);
208 BOOPSI_DISPATCHER(IPTR
, Listview_Dispatcher
, cl
, obj
, msg
)
210 switch (msg
->MethodID
)
213 return Listview__OM_GET(cl
, obj
, (struct opGet
*)msg
);
215 return Listview__OM_NEW(cl
, obj
, (struct opSet
*)msg
);
217 return Listview__MUIM_Notify(cl
, obj
, (struct MUIP_Notify
*)msg
);
218 case MUIM_KillNotify
:
219 return Listview__MUIM_KillNotify(cl
, obj
,
220 (struct MUIP_KillNotify
*)msg
);
221 case MUIM_KillNotifyObj
:
222 return Listview__MUIM_KillNotifyObj(cl
, obj
,
223 (struct MUIP_KillNotifyObj
*)msg
);
224 case MUIM_List_Clear
:
225 case MUIM_List_CreateImage
:
226 case MUIM_List_DeleteImage
:
227 case MUIM_List_Exchange
:
228 case MUIM_List_GetEntry
:
229 case MUIM_List_Insert
:
230 case MUIM_List_InsertSingle
:
232 case MUIM_List_NextSelected
:
233 case MUIM_List_Redraw
:
234 case MUIM_List_Remove
:
235 case MUIM_List_Select
:
237 case MUIM_List_TestPos
:
239 struct MUI_ListviewData
*data
= INST_DATA(cl
, obj
);
241 return DoMethodA(data
->list
, msg
);
246 return DoSuperMethodA(cl
, obj
, msg
);
248 BOOPSI_DISPATCHER_END
253 const struct __MUIBuiltinClass _MUI_Listview_desc
=
257 sizeof(struct MUI_ListviewData
),
258 (void *) Listview_Dispatcher