Hint added.
[AROS.git] / workbench / prefs / locale / languagelist.c
blobe856c93eb25d701ebfbb4c5aeddeed6e2da1f90c
1 /*
2 Copyright © 2013, The AROS Development Team. All rights reserved.
3 $Id$
4 */
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;
25 else
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;
33 LONG n;
34 CONST_STRPTR str;
36 /* Find drop position */
38 DoMethod(obj, MUIM_List_TestPos, msg->x, msg->y, (IPTR) &pos);
39 if (pos.entry != -1)
41 /* Change drop position when coords move past centre of entry, not
42 * entry boundary */
44 n = pos.entry;
45 if (pos.yoffset > 0)
46 n++;
48 else if ((pos.flags & MUI_LPR_ABOVE) != 0)
49 n = MUIV_List_Insert_Top;
50 else
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);
57 return TRUE;
60 ZUNE_CUSTOMCLASS_2
62 Languagelist, NULL, MUIC_List, NULL,
63 MUIM_DragQuery, struct MUIP_DragQuery *,
64 MUIM_DragDrop, struct MUIP_DragDrop *