2 void RadioButton_Click(entity me, entity other);
\r
3 CLASS(RadioButton) EXTENDS(CheckBox)
\r
4 METHOD(RadioButton, configureRadioButton, void(entity, string, float, string, float, float))
\r
5 ATTRIB(RadioButton, checked, float, 0)
\r
6 ATTRIB(RadioButton, group, float, 0)
\r
7 ATTRIB(RadioButton, allowDeselect, float, 0)
\r
8 ATTRIB(RadioButton, onClick, void(entity, entity), RadioButton_Click)
\r
9 ENDCLASS(RadioButton)
\r
12 #ifdef IMPLEMENTATION
\r
13 void configureRadioButtonRadioButton(entity me, string txt, float sz, string gfx, float theGroup, float doAllowDeselect)
\r
15 me.configureCheckBox(me, txt, sz, gfx);
\r
17 me.group = theGroup;
\r
18 me.allowDeselect = doAllowDeselect;
\r
20 void RadioButton_Click(entity me, entity other)
\r
24 if(me.allowDeselect)
\r
25 me.setChecked(me, 0);
\r
30 for(e = me.parent.firstChild; e; e = e.nextSibling)
\r
32 if(e.group == me.group)
\r
34 me.setChecked(me, 1);
\r