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