Update MiniEngine_Widget.h

This commit is contained in:
Kirigaya Kazuto 2017-03-02 21:59:29 +08:00 committed by GitHub
parent 0a2efcf8fe
commit b6395fec83

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include "MiniEngine.h" #include "MiniEngine.h"
#include <functional> #include <functional>
#include <vector>
namespace MiniEngine namespace MiniEngine
{ {
@ -26,16 +27,6 @@ private:
friend class Board; friend class Board;
}; };
class Board
{
public:
Board(Renderer Rnd,Rect Area);
Brush getBrush();
Rect getArea();
private:
Rect area;
Brush brush;
};
class Drawable class Drawable
{ {
@ -50,6 +41,8 @@ public:
virtual int handle(SDL_Event e,int& running,int& update)=0; virtual int handle(SDL_Event e,int& running,int& update)=0;
}; };
class ButtonBase : public Drawable, public Interactive class ButtonBase : public Drawable, public Interactive
{ {
public: public:
@ -68,6 +61,29 @@ private:
Rect rect; Rect rect;
}; };
class Board
{
public:
Board(Renderer Rnd,Rect Area);
Brush getBrush();
Rect getArea();
class _Control
{
public:
void add(Interactive* widget);
Interactive* at(int index);
int size();
bool remove(Interactive* widget);
private:
std::vector<Interactive*> vec;
}Control;
private:
Rect area;
Brush brush;
};
}/// End of namespace MiniEngine::Widget }/// End of namespace MiniEngine::Widget
}/// End of namespace MiniEngine }/// End of namespace MiniEngine