ATTRIB(InputBox, cb_colorF, vector, '1 1 1')
ATTRIB(InputBox, cb_colorC, vector, '1 1 1')
ENDCLASS(InputBox)
-void InputBox_Clear_Click(entity btn, entity me);
#endif
#ifdef IMPLEMENTATION
SUPER(InputBox).setText(me, strzone(txt));
}
-void InputBox_Clear_Click(entity btn, entity me)
-{
- me.setText(me, "");
-}
-
float over_ClearButton(entity me, vector pos)
{
if (pos_x >= 1 + me.cb_offset - me.cb_width)
if(me.cb_pressed)
if (over_ClearButton(me, pos))
{
+ m_play_click_sound(MENU_SOUND_CLEAR);
+ me.setText(me, "");
me.cb_pressed = 0;
- InputBox_Clear_Click(world, me);
return 1;
}
float r = InputBox_mouseDrag(me, pos);
case K_KP_DEL:
case K_DEL:
if(shift & S_CTRL)
+ {
+ m_play_click_sound(MENU_SOUND_CLEAR);
me.setText(me, "");
+ }
else
me.setText(me, strcat(substring(me.text, 0, me.cursorPos), substring(me.text, me.cursorPos + 1, strlen(me.text) - me.cursorPos - 1)));
return 1;
// sounds
+const string MENU_SOUND_CLEAR = "sound/menu/clear.wav";
const string MENU_SOUND_EXECUTE = "sound/menu/execute.wav";
const string MENU_SOUND_SELECT = "sound/menu/select.wav";
const string MENU_SOUND_SLIDE = "sound/menu/slide.wav";