2 Copyright © 2013, The AROS Development Team. All rights reserved.
6 #include <proto/intuition.h>
7 #include <proto/alib.h>
9 #include <zune/customclasses.h>
11 #include "languagelist.h"
13 struct Languagelist_DATA
17 struct MUI_CustomClass
*Languagelist_CLASS
;
20 IPTR
Languagelist__MUIM_DragQuery(struct IClass
*cl
, Object
*obj
,
21 struct MUIP_DragQuery
*msg
)
23 if ((IPTR
)msg
->obj
== XGET(obj
, MUIA_UserData
))
24 return MUIV_DragQuery_Accept
;
26 return MUIV_DragQuery_Refuse
;
29 IPTR
Languagelist__MUIM_DragDrop(struct IClass
*cl
, Object
*obj
,
30 struct MUIP_DragDrop
*msg
)
32 struct MUI_List_TestPos_Result pos
;
36 /* Find drop position */
38 DoMethod(obj
, MUIM_List_TestPos
, msg
->x
, msg
->y
, (IPTR
) &pos
);
41 /* Change drop position when coords move past centre of entry, not
48 else if ((pos
.flags
& MUI_LPR_ABOVE
) != 0)
49 n
= MUIV_List_Insert_Top
;
51 n
= MUIV_List_Insert_Bottom
;
53 DoMethod(msg
->obj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &str
);
54 DoMethod(msg
->obj
, MUIM_List_Remove
, MUIV_List_Remove_Active
);
55 DoMethod(obj
, MUIM_List_InsertSingle
, str
, n
);
62 Languagelist
, NULL
, MUIC_List
, NULL
,
63 MUIM_DragQuery
, struct MUIP_DragQuery
*,
64 MUIM_DragDrop
, struct MUIP_DragDrop
*