1 #ifndef ITEM_CHECKBOX_H
2 #define ITEM_CHECKBOX_H
4 void CheckBox_Click(entity me, entity other);
5 CLASS(CheckBox, Button)
6 METHOD(CheckBox, configureCheckBox, void(entity, string, float, string));
7 METHOD(CheckBox, draw, void(entity));
8 METHOD(CheckBox, playClickSound, void(entity));
9 METHOD(CheckBox, toString, string(entity));
10 METHOD(CheckBox, setChecked, void(entity, float));
11 ATTRIB(CheckBox, useDownAsChecked, float, 0)
12 ATTRIB(CheckBox, checked, float, 0)
13 ATTRIB(CheckBox, onClick, void(entity, entity), CheckBox_Click)
14 ATTRIB(CheckBox, srcMulti, float, 0)
15 ATTRIB(CheckBox, disabled, float, 0)
20 void CheckBox_setChecked(entity me, float val)
24 void CheckBox_Click(entity me, entity other)
26 me.setChecked(me, !me.checked);
28 string CheckBox_toString(entity me)
30 return strcat(SUPER(CheckBox).toString(me), ", ", me.checked ? "checked" : "unchecked");
32 void CheckBox_configureCheckBox(entity me, string txt, float sz, string gfx)
34 me.configureButton(me, txt, sz, gfx);
37 void CheckBox_draw(entity me)
41 if(me.useDownAsChecked)
43 me.srcSuffix = string_null;
44 me.forcePressed = me.checked;
47 me.srcSuffix = (me.checked ? "1" : "0");
49 SUPER(CheckBox).draw(me);
51 void CheckBox_playClickSound(entity me)
53 m_play_click_sound(MENU_SOUND_SELECT);