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
= NULL
, 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
,
65 set(str
, MUIA_String_Contents
, listentry
);
69 IPTR
Poplist__OM_NEW(struct IClass
*cl
, Object
*obj
, struct opSet
*msg
)
72 (STRPTR
) GetTagData(MUIA_Poplist_Array
, 0, msg
->ops_AttrList
);
75 obj
= (Object
*) DoSuperNewTags(cl
, obj
, NULL
,
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
);
86 struct Poplist_DATA
*data
= INST_DATA(cl
, obj
);
90 data
->strobj_hook
.h_Entry
= HookEntry
;
91 data
->strobj_hook
.h_SubEntry
= (HOOKFUNC
) PoplistStrObjFunc
;
92 data
->strobj_hook
.h_Data
= data
;
94 data
->objstr_hook
.h_Entry
= HookEntry
;
95 data
->objstr_hook
.h_SubEntry
= (HOOKFUNC
) PoplistObjStrFunc
;
96 data
->objstr_hook
.h_Data
= data
;
98 SetAttrs(obj
, MUIA_Popobject_StrObjHook
, (IPTR
) & data
->strobj_hook
,
99 MUIA_Popobject_ObjStrHook
, (IPTR
) & data
->objstr_hook
,
102 DoMethod(lv
, MUIM_Notify
, MUIA_Listview_DoubleClick
, TRUE
,
103 (IPTR
) obj
, 2, MUIM_Popstring_Close
, TRUE
);
109 #if ZUNE_BUILTIN_POPLIST
110 BOOPSI_DISPATCHER(IPTR
, Poplist_Dispatcher
, cl
, obj
, msg
)
112 switch (msg
->MethodID
)
115 return Poplist__OM_NEW(cl
, obj
, (struct opSet
*)msg
);
117 return DoSuperMethodA(cl
, obj
, msg
);
120 BOOPSI_DISPATCHER_END
122 const struct __MUIBuiltinClass _MUI_Poplist_desc
=
126 sizeof(struct Poplist_DATA
),
127 (void *) Poplist_Dispatcher
129 #endif /* ZUNE_BUILTIN_POPLIST */