2 #ifndef ITEM_CHECKBOX_H
3 #define ITEM_CHECKBOX_H
5 void CheckBox_Click(entity me, entity other);
6 CLASS(CheckBox, Button)
7 METHOD(CheckBox, configureCheckBox, void(entity, string, float, string));
8 METHOD(CheckBox, draw, void(entity));
9 METHOD(CheckBox, playClickSound, void(entity));
10 METHOD(CheckBox, toString, string(entity));
11 METHOD(CheckBox, setChecked, void(entity, float));
12 ATTRIB(CheckBox, useDownAsChecked, float, 0)
13 ATTRIB(CheckBox, checked, float, 0)
14 ATTRIB(CheckBox, onClick, void(entity, entity), CheckBox_Click)
15 ATTRIB(CheckBox, srcMulti, float, 0)
16 ATTRIB(CheckBox, disabled, float, 0)
21 void CheckBox_setChecked(entity me, float val)
25 void CheckBox_Click(entity me, entity other)
27 me.setChecked(me, !me.checked);
29 string CheckBox_toString(entity me)
31 return strcat(SUPER(CheckBox).toString(me), ", ", me.checked ? "checked" : "unchecked");
33 void CheckBox_configureCheckBox(entity me, string txt, float sz, string gfx)
35 me.configureButton(me, txt, sz, gfx);
38 void CheckBox_draw(entity me)
42 if (me.useDownAsChecked)
44 me.srcSuffix = string_null;
45 me.forcePressed = me.checked;
49 me.srcSuffix = (me.checked ? "1" : "0");
52 SUPER(CheckBox).draw(me);
54 void CheckBox_playClickSound(entity me)
56 m_play_click_sound(MENU_SOUND_SELECT);