Pop keyboard view on deactivation

This commit is contained in:
simon.kagstrom 2009-12-26 09:07:18 +00:00
parent 0f7489cbb9
commit aa0d8246bb
2 changed files with 8 additions and 7 deletions

View File

@ -88,8 +88,6 @@ VirtualKeyboard::VirtualKeyboard(Font *font) : GuiView()
void VirtualKeyboard::draw(SDL_Surface *where, int x_base, int y_base, int w, int h)
{
int screen_w = where->w;
int screen_h = where->h;
int key_w = w / KEY_COLS;
int key_h = h / KEY_ROWS;
SDL_Rect bg_rect = {x_base, y_base,
@ -359,6 +357,13 @@ void VirtualKeyboard::flushKeyListeners()
memset(this->stringListeners, 0, sizeof(this->stringListeners));
}
void VirtualKeyboard::deactivate()
{
this->is_active = false;
this->flushKeyListeners();
Gui::gui->popView();
}
void VirtualKeyboard::draw(SDL_Surface *where)
{
this->draw(where, 20, 240, 600, 240);

View File

@ -56,11 +56,7 @@ public:
this->font = font;
}
void deactivate()
{
this->is_active = false;
this->flushKeyListeners();
}
void deactivate();
bool isActive()
{