grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / prefs / PSI / syspenfield_class.c
blobca38bba2f003f1e4ca8040117ee1166d69fcef7c
1 /*
2 Copyright © 1995-1997 Stefan Stuntz.
3 Copyright © 2009-2010, The AROS Development Team.
4 All rights reserved.
6 $Id$
7 */
9 #include <proto/muimaster.h>
10 #include <proto/intuition.h>
12 #include "syspenfield_class.h"
14 /****************************************************************************************/
16 struct SysPenField_Data
18 LONG dummy;
21 /****************************************************************************************/
23 IPTR SysPenField_DragQuery(struct IClass *cl, Object *obj, struct MUIP_DragQuery *msg)
25 if (msg->obj==obj)
26 return MUIV_DragQuery_Refuse;
28 if (muiUserData(msg->obj) < 1 || muiUserData(msg->obj) > 8)
29 return MUIV_DragQuery_Refuse;
31 return MUIV_DragQuery_Accept;
34 /****************************************************************************************/
36 IPTR SysPenField_DragDrop(struct IClass *cl, Object *obj, struct MUIP_DragDrop *msg)
38 set(obj,MUIA_Pendisplay_Reference,msg->obj);
39 return 0;
42 /****************************************************************************************/
44 BOOPSI_DISPATCHER(IPTR, SysPenField_Dispatcher, cl, obj, msg)
46 switch (msg->MethodID)
48 case MUIM_DragQuery : return(SysPenField_DragQuery (cl,obj,(APTR)msg));
49 case MUIM_DragDrop : return(SysPenField_DragDrop (cl,obj,(APTR)msg));
51 return DoSuperMethodA(cl,obj,msg);
53 BOOPSI_DISPATCHER_END
55 /****************************************************************************************/
57 Object *MakePalette(void)
59 Object *obj;
61 obj = MUI_NewObject(MUIC_Poppen,
62 MUIA_CycleChain, 1,
63 MUIA_Window_Title, "Adjust Color",
64 MUIA_Penadjust_PSIMode, 2,
65 MUIA_MaxHeight, 20,
66 TAG_DONE);
68 return obj;
71 /****************************************************************************************/
73 Object *MakeMUIPen(int nr, Object **adr)
75 Object *obj;
77 obj = VGroup, MUIA_Group_Spacing, 1,
78 Child, *adr = MUI_NewObject(MUIC_Poppen,
79 MUIA_CycleChain, 1,
80 MUIA_Window_Title, "Adjust MUI Pen",
81 MUIA_Penadjust_PSIMode, 1,
82 MUIA_MaxHeight, 20,
83 TAG_DONE),
84 Child, TextObject,
85 MUIA_Text_Contents, GetStr(nr),
86 MUIA_Text_PreParse, "\33c",
87 MUIA_Font, MUIV_Font_Tiny,
88 End,
89 End;
91 return obj;
94 /****************************************************************************************/
96 Object *MakeSysPen(int nr, Object **adr)
98 Object *obj;
100 obj = VGroup, MUIA_Group_Spacing, 1,
101 Child, *adr = NewObject(CL_SysPenField->mcc_Class,NULL,
102 TextFrame,
103 MUIA_Background, MUII_BACKGROUND,
104 MUIA_InnerLeft , 4,
105 MUIA_InnerRight , 4,
106 MUIA_InnerTop , 4,
107 MUIA_InnerBottom, 4,
108 TAG_DONE),
109 Child, TextObject,
110 MUIA_Font, MUIV_Font_Tiny,
111 MUIA_Text_Contents, GetStr(nr),
112 MUIA_Text_PreParse, "\33c",
113 End,
114 End;
116 return obj;
119 /****************************************************************************************/
121 VOID SysPenField_Init(VOID)
123 CL_SysPenField = MUI_CreateCustomClass
125 NULL, MUIC_Pendisplay, NULL,
126 sizeof(struct SysPenField_Data ), SysPenField_Dispatcher
130 /****************************************************************************************/
132 VOID SysPenField_Exit(VOID)
134 if (CL_SysPenField )
135 MUI_DeleteCustomClass(CL_SysPenField );