frodo-wii/dialogue_box.cpp

34 lines
670 B
C++
Raw Normal View History

2009-11-29 10:29:26 +01:00
#include "dialogue_box.hh"
DialogueBox::DialogueBox(Font *font, const char *msgs[], int cancel) : Menu(font)
{
this->m_selected = -1;
this->m_cancel = cancel;
this->setText(msgs, NULL);
/* Place on the second to last entry */
this->cur_sel = this->n_entries - 2;
}
int DialogueBox::selectNext(event_t ev)
{
/* No up/down movement please! */
if (ev == KEY_UP || ev == KEY_DOWN)
return this->cur_sel;
return Menu::selectNext(ev);
2009-11-29 10:29:26 +01:00
}
void DialogueBox::selectCallback(int which)
{
this->m_selected = this->p_submenus[0].sel;
}
void DialogueBox::hoverCallback(int which)
{
}
2009-11-29 10:29:26 +01:00
void DialogueBox::escapeCallback(int which)
{
this->m_selected = this->m_cancel;
}