2 Copyright © 2010-2011, The AROS Development Team. All rights reserved.
6 #include <libraries/mui.h>
7 #include <zune/customclasses.h>
9 #include <proto/alib.h>
10 #include <proto/intuition.h>
11 #include <proto/utility.h>
12 #include <proto/muimaster.h>
16 #include "stringify.h"
18 struct MUI_CustomClass
*StringifyClass
;
27 static IPTR
Stringify__OM_NEW(Class
* cl
, Object
* obj
, struct opSet
* msg
)
29 obj
= (Object
*) DoSuperMethodA(cl
, obj
, (Msg
)msg
);
32 struct Stringify_DATA
*data
= INST_DATA(cl
,obj
);
33 data
->Type
= (UWORD
) GetTagData(MUIA_MyStringifyType
, 0, msg
->ops_AttrList
);
39 static IPTR
Stringify__MUIM_Numeric_Stringify(Class
* cl
, Object
* obj
, Msg msg
)
41 struct Stringify_DATA
*data
= INST_DATA(cl
,obj
);
43 struct MUIP_Numeric_Stringify
*m
= (APTR
)msg
;
45 if (data
->Type
== STRINGIFY_RepeatRate
)
47 sprintf((char *)data
->buf
,"%3.2fs", 0.02 * (12 - m
->value
));
49 else if (data
->Type
== STRINGIFY_RepeatDelay
)
51 sprintf((char *)data
->buf
,"%ldms", 20 + 20 * (long)m
->value
);
53 else if (data
->Type
== STRINGIFY_DoubleClickDelay
)
55 sprintf((char *)data
->buf
,"%3.2fs", 0.02 + 0.02 * m
->value
);
57 return (IPTR
) data
->buf
;
63 Stringify
, NULL
, MUIC_Slider
, NULL
,
64 OM_NEW
, struct opSet
*,
65 MUIM_Numeric_Stringify
, Msg