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
, listentry
;
36 DoMethod(data
->list
, MUIM_List_Clear
);
38 pubscrlist
= LockPubScreenList();
39 ForeachNode(pubscrlist
, pubscrnode
)
41 DoMethod(data
->list
, MUIM_List_InsertSingle
, (IPTR
)pubscrnode
->psn_Node
.ln_Name
, MUIV_List_Insert_Bottom
);
43 UnlockPubScreenList();
45 get(str
, MUIA_String_Contents
, &strtext
);
47 for(index
= 0; ; index
++)
49 DoMethod(data
->list
, MUIM_List_GetEntry
, index
, (IPTR
)&listentry
);
53 set(data
->list
, MUIA_List_Active
, strtext
[0] ? MUIV_List_Active_Off
: 0);
57 if (stricmp(strtext
, listentry
) == 0)
59 set(data
->list
, MUIA_List_Active
, index
);
67 void PopscreenObjStrFunc(struct Hook
*hook
, Object
*popup
, Object
*str
)
71 DoMethod(popup
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, (IPTR
)&listentry
);
75 set(str
, MUIA_String_Contents
, listentry
);
79 IPTR
Popscreen__OM_NEW(struct IClass
*cl
, Object
*obj
, struct opSet
*msg
)
83 obj
= (Object
*)DoSuperNewTags
86 MUIA_Popobject_Object
, (IPTR
)(lv
= (Object
*)ListviewObject
,
87 MUIA_Listview_List
, (IPTR
)(list
= (Object
*)ListObject
,
91 TAG_MORE
, (IPTR
) msg
->ops_AttrList
96 struct Popscreen_DATA
*data
= INST_DATA(cl
, obj
);
100 data
->strobj_hook
.h_Entry
= HookEntry
;
101 data
->strobj_hook
.h_SubEntry
= (HOOKFUNC
)PopscreenStrObjFunc
;
102 data
->strobj_hook
.h_Data
= data
;
104 data
->objstr_hook
.h_Entry
= HookEntry
;
105 data
->objstr_hook
.h_SubEntry
= (HOOKFUNC
)PopscreenObjStrFunc
;
106 data
->objstr_hook
.h_Data
= data
;
108 SetAttrs(obj
, MUIA_Popobject_StrObjHook
, (IPTR
)&data
->strobj_hook
,
109 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
)
125 case OM_NEW
: return Popscreen__OM_NEW(cl
, obj
, (struct opSet
*)msg
);
126 default: return DoSuperMethodA(cl
, obj
, msg
);
129 BOOPSI_DISPATCHER_END
131 const struct __MUIBuiltinClass _MUI_Popscreen_desc
=
135 sizeof(struct Popscreen_DATA
),
136 (void*)Popscreen_Dispatcher
138 #endif /* ZUNE_BUILTIN_POPSCREEN */