CLASS(CheckBox) EXTENDS(Button)
METHOD(CheckBox, configureCheckBox, void(entity, string, float, string))
METHOD(CheckBox, draw, void(entity))
+ METHOD(CheckBox, playClickSound, void(entity))
METHOD(CheckBox, toString, string(entity))
METHOD(CheckBox, setChecked, void(entity, float))
ATTRIB(CheckBox, useDownAsChecked, float, 0)
#endif
#ifdef IMPLEMENTATION
-void setCheckedCheckBox(entity me, float val)
+void CheckBox_setChecked(entity me, float val)
{
me.checked = val;
}
{
me.setChecked(me, !me.checked);
}
-string toStringCheckBox(entity me)
+string CheckBox_toString(entity me)
{
return strcat(SUPER(CheckBox).toString(me), ", ", me.checked ? "checked" : "unchecked");
}
-void configureCheckBoxCheckBox(entity me, string txt, float sz, string gfx)
+void CheckBox_configureCheckBox(entity me, string txt, float sz, string gfx)
{
me.configureButton(me, txt, sz, gfx);
me.align = 0;
}
-void drawCheckBox(entity me)
+void CheckBox_draw(entity me)
{
float s;
s = me.pressed;
}
else
me.srcSuffix = (me.checked ? "1" : "0");
- SUPER(CheckBox).draw(me);
me.pressed = s;
+ SUPER(CheckBox).draw(me);
+}
+void CheckBox_playClickSound(entity me)
+{
+ m_play_click_sound(MENU_SOUND_SELECT);
}
#endif