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 "popscreen_private.h"
26 extern struct Library
*MUIMasterBase
;
28 LONG
PopscreenStrObjFunc(struct Hook
*hook
, Object
*popup
, Object
*str
)
30 struct Popscreen_DATA
*data
= (struct Popscreen_DATA
*)hook
->h_Data
;
31 struct List
*pubscrlist
;
32 struct PubScreenNode
*pubscrnode
;
33 STRPTR strtext
= NULL
, listentry
;
36 DoMethod(data
->list
, MUIM_List_Clear
);
38 pubscrlist
= LockPubScreenList();
39 ForeachNode(pubscrlist
, pubscrnode
)
41 DoMethod(data
->list
, MUIM_List_InsertSingle
,
42 (IPTR
) pubscrnode
->psn_Node
.ln_Name
, MUIV_List_Insert_Bottom
);
44 UnlockPubScreenList();
46 get(str
, MUIA_String_Contents
, &strtext
);
48 for (index
= 0;; index
++)
50 DoMethod(data
->list
, MUIM_List_GetEntry
, index
, (IPTR
) & listentry
);
54 set(data
->list
, MUIA_List_Active
,
55 strtext
[0] ? MUIV_List_Active_Off
: 0);
59 if (stricmp(strtext
, listentry
) == 0)
61 set(data
->list
, MUIA_List_Active
, index
);
69 void PopscreenObjStrFunc(struct Hook
*hook
, Object
*popup
, Object
*str
)
73 DoMethod(popup
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
,
78 set(str
, MUIA_String_Contents
, listentry
);
82 IPTR
Popscreen__OM_NEW(struct IClass
*cl
, Object
*obj
, struct opSet
*msg
)
86 obj
= (Object
*) DoSuperNewTags
88 MUIA_Popobject_Object
, (IPTR
) (lv
= (Object
*) ListviewObject
,
89 MUIA_Listview_List
, (IPTR
) (list
= (Object
*) ListObject
,
93 TAG_MORE
, (IPTR
) msg
->ops_AttrList
);
97 struct Popscreen_DATA
*data
= INST_DATA(cl
, obj
);
101 data
->strobj_hook
.h_Entry
= HookEntry
;
102 data
->strobj_hook
.h_SubEntry
= (HOOKFUNC
) PopscreenStrObjFunc
;
103 data
->strobj_hook
.h_Data
= data
;
105 data
->objstr_hook
.h_Entry
= HookEntry
;
106 data
->objstr_hook
.h_SubEntry
= (HOOKFUNC
) PopscreenObjStrFunc
;
107 data
->objstr_hook
.h_Data
= data
;
109 SetAttrs(obj
, MUIA_Popobject_StrObjHook
, (IPTR
) & data
->strobj_hook
,
110 MUIA_Popobject_ObjStrHook
, (IPTR
) & data
->objstr_hook
,
113 DoMethod(lv
, MUIM_Notify
, MUIA_Listview_DoubleClick
, TRUE
,
114 (IPTR
) obj
, 2, MUIM_Popstring_Close
, TRUE
);
120 #if ZUNE_BUILTIN_POPSCREEN
121 BOOPSI_DISPATCHER(IPTR
, Popscreen_Dispatcher
, cl
, obj
, msg
)
123 switch (msg
->MethodID
)
126 return Popscreen__OM_NEW(cl
, obj
, (struct opSet
*)msg
);
128 return DoSuperMethodA(cl
, obj
, msg
);
131 BOOPSI_DISPATCHER_END
133 const struct __MUIBuiltinClass _MUI_Popscreen_desc
=
137 sizeof(struct Popscreen_DATA
),
138 (void *) Popscreen_Dispatcher
140 #endif /* ZUNE_BUILTIN_POPSCREEN */