mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2024-11-25 12:56:59 +01:00
Make GuiView a widget
This commit is contained in:
parent
b4f133036a
commit
2e768d0c67
18
gui.hh
18
gui.hh
@ -6,24 +6,11 @@
|
||||
#include "menu.hh"
|
||||
#include "font.hh"
|
||||
#include "timer.hh"
|
||||
#include "gui_view.hh"
|
||||
|
||||
class Gui;
|
||||
class MainView;
|
||||
class DiscView;
|
||||
|
||||
class GuiView
|
||||
{
|
||||
public:
|
||||
GuiView();
|
||||
|
||||
virtual void pushEvent(SDL_Event *ev) = 0;
|
||||
|
||||
virtual void runLogic() = 0;
|
||||
|
||||
virtual void updateTheme() = 0;
|
||||
|
||||
virtual void draw(SDL_Surface *where) = 0;
|
||||
};
|
||||
class KeyboardView;
|
||||
|
||||
class Gui
|
||||
{
|
||||
@ -83,6 +70,7 @@ public:
|
||||
|
||||
MainView *mv;
|
||||
DiscView *dv;
|
||||
KeyboardView *kv;
|
||||
GuiView **views;
|
||||
int n_views;
|
||||
|
||||
|
@ -70,7 +70,7 @@ static const char *shifted_names[KEY_COLS * KEY_ROWS] = {
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, "f2", "f4", "f6", "f8", "Ins", NULL, NULL, NULL, NULL,
|
||||
};
|
||||
|
||||
VirtualKeyboard::VirtualKeyboard(Font *font) : Widget()
|
||||
VirtualKeyboard::VirtualKeyboard(Font *font) : GuiView()
|
||||
{
|
||||
this->font = font;
|
||||
this->sel_x = 0;
|
||||
@ -349,5 +349,13 @@ void VirtualKeyboard::runLogic()
|
||||
}
|
||||
}
|
||||
|
||||
void VirtualKeyboard::draw(SDL_Surface *where)
|
||||
{
|
||||
}
|
||||
|
||||
void VirtualKeyboard::updateTheme()
|
||||
{
|
||||
}
|
||||
|
||||
/* The singleton */
|
||||
VirtualKeyboard *VirtualKeyboard::kbd;
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include <SDL.h>
|
||||
|
||||
#include "widget.hh"
|
||||
#include "gui_view.hh"
|
||||
#include "font.hh"
|
||||
|
||||
struct virtkey;
|
||||
@ -32,7 +33,7 @@ public:
|
||||
virtual void stringCallback(const char *str) = 0;
|
||||
};
|
||||
|
||||
class VirtualKeyboard : public Widget
|
||||
class VirtualKeyboard : public GuiView
|
||||
{
|
||||
public:
|
||||
VirtualKeyboard(Font *font);
|
||||
@ -65,6 +66,10 @@ public:
|
||||
return this->is_active;
|
||||
}
|
||||
|
||||
virtual void updateTheme();
|
||||
|
||||
void draw(SDL_Surface *where);
|
||||
|
||||
void runLogic();
|
||||
|
||||
void draw(SDL_Surface *where, int x, int y, int w, int h);
|
||||
@ -88,5 +93,4 @@ private:
|
||||
unsigned buf_head;
|
||||
};
|
||||
|
||||
|
||||
#endif /* __VIRTUAL_KEYBORD_HH__ */
|
||||
|
@ -70,3 +70,7 @@ void Widget::pushEvent(SDL_Event *ev)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void Widget::draw(SDL_Surface *where, int x, int y, int w, int h)
|
||||
{
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user