2 Copyright © 2002-2003, The AROS Development Team. All rights reserved.
6 #define MUIMASTER_YES_INLINE_STDARG
8 #include <exec/memory.h>
9 #include <clib/alib_protos.h>
10 #include <proto/exec.h>
11 #include <proto/dos.h>
12 #include <proto/utility.h>
13 #include <proto/intuition.h>
14 #include <proto/muimaster.h>
20 #include "muimaster_intern.h"
22 #include "support_classes.h"
24 #include "poplist_private.h"
26 extern struct Library
*MUIMasterBase
;
28 LONG
PoplistStrObjFunc(struct Hook
*hook
, Object
*popup
, Object
*str
)
30 struct Poplist_DATA
*data
= (struct Poplist_DATA
*)hook
->h_Data
;
31 STRPTR strtext
, listentry
;
34 get(str
, MUIA_String_Contents
, &strtext
);
36 for(index
= 0; ; index
++)
38 DoMethod(data
->list
, MUIM_List_GetEntry
, index
, (IPTR
)&listentry
);
42 set(data
->list
, MUIA_List_Active
, MUIV_List_Active_Off
);
46 if (stricmp(strtext
, listentry
) == 0)
48 set(data
->list
, MUIA_List_Active
, index
);
56 void PoplistObjStrFunc(struct Hook
*hook
, Object
*popup
, Object
*str
)
60 DoMethod(popup
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, (IPTR
)&listentry
);
64 set(str
, MUIA_String_Contents
, listentry
);
68 IPTR
Poplist__OM_NEW(struct IClass
*cl
, Object
*obj
, struct opSet
*msg
)
70 STRPTR array
= (STRPTR
)GetTagData(MUIA_Poplist_Array
, 0, msg
->ops_AttrList
);
73 obj
= (Object
*)DoSuperNewTags
76 MUIA_Popobject_Object
, (IPTR
)(lv
= (Object
*)ListviewObject
,
77 MUIA_Listview_List
, (IPTR
)(list
= (Object
*)ListObject
,
79 array
? MUIA_List_SourceArray
: TAG_IGNORE
, (IPTR
)array
,
82 TAG_MORE
, (IPTR
) msg
->ops_AttrList
87 struct Poplist_DATA
*data
= INST_DATA(cl
, obj
);
91 data
->strobj_hook
.h_Entry
= HookEntry
;
92 data
->strobj_hook
.h_SubEntry
= (HOOKFUNC
)PoplistStrObjFunc
;
93 data
->strobj_hook
.h_Data
= data
;
95 data
->objstr_hook
.h_Entry
= HookEntry
;
96 data
->objstr_hook
.h_SubEntry
= (HOOKFUNC
)PoplistObjStrFunc
;
97 data
->objstr_hook
.h_Data
= data
;
99 SetAttrs(obj
, MUIA_Popobject_StrObjHook
, (IPTR
)&data
->strobj_hook
,
100 MUIA_Popobject_ObjStrHook
, (IPTR
)&data
->objstr_hook
,
103 DoMethod(lv
, MUIM_Notify
, MUIA_Listview_DoubleClick
, TRUE
,
104 (IPTR
)obj
, 2, MUIM_Popstring_Close
, TRUE
);
110 #if ZUNE_BUILTIN_POPLIST
111 BOOPSI_DISPATCHER(IPTR
, Poplist_Dispatcher
, cl
, obj
, msg
)
113 switch (msg
->MethodID
)
115 case OM_NEW
: return Poplist__OM_NEW(cl
, obj
, (struct opSet
*)msg
);
116 default: return DoSuperMethodA(cl
, obj
, msg
);
119 BOOPSI_DISPATCHER_END
121 const struct __MUIBuiltinClass _MUI_Poplist_desc
=
125 sizeof(struct Poplist_DATA
),
126 (void*)Poplist_Dispatcher
128 #endif /* ZUNE_BUILTIN_POPLIST */