2 Copyright © 1995-1997 Stefan Stuntz.
3 Copyright © 2009-2010, The AROS Development Team.
9 #include <proto/muimaster.h>
10 #include <proto/intuition.h>
12 #include "syspenfield_class.h"
14 /****************************************************************************************/
16 struct SysPenField_Data
21 /****************************************************************************************/
23 IPTR
SysPenField_DragQuery(struct IClass
*cl
, Object
*obj
, struct MUIP_DragQuery
*msg
)
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
);
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
);
55 /****************************************************************************************/
57 Object
*MakePalette(void)
61 obj
= MUI_NewObject(MUIC_Poppen
,
63 MUIA_Window_Title
, "Adjust Color",
64 MUIA_Penadjust_PSIMode
, 2,
71 /****************************************************************************************/
73 Object
*MakeMUIPen(int nr
, Object
**adr
)
77 obj
= VGroup
, MUIA_Group_Spacing
, 1,
78 Child
, *adr
= MUI_NewObject(MUIC_Poppen
,
80 MUIA_Window_Title
, "Adjust MUI Pen",
81 MUIA_Penadjust_PSIMode
, 1,
85 MUIA_Text_Contents
, GetStr(nr
),
86 MUIA_Text_PreParse
, "\33c",
87 MUIA_Font
, MUIV_Font_Tiny
,
94 /****************************************************************************************/
96 Object
*MakeSysPen(int nr
, Object
**adr
)
100 obj
= VGroup
, MUIA_Group_Spacing
, 1,
101 Child
, *adr
= NewObject(CL_SysPenField
->mcc_Class
,NULL
,
103 MUIA_Background
, MUII_BACKGROUND
,
110 MUIA_Font
, MUIV_Font_Tiny
,
111 MUIA_Text_Contents
, GetStr(nr
),
112 MUIA_Text_PreParse
, "\33c",
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
)
135 MUI_DeleteCustomClass(CL_SysPenField
);