From b6395fec8371986ed00e10e7827407590b7c9834 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Thu, 2 Mar 2017 21:59:29 +0800 Subject: [PATCH] Update MiniEngine_Widget.h --- MiniEngine_Widget.h | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/MiniEngine_Widget.h b/MiniEngine_Widget.h index 4a5bc44..d0ee574 100644 --- a/MiniEngine_Widget.h +++ b/MiniEngine_Widget.h @@ -1,6 +1,7 @@ #pragma once #include "MiniEngine.h" #include +#include namespace MiniEngine { @@ -26,16 +27,6 @@ private: friend class Board; }; -class Board -{ -public: - Board(Renderer Rnd,Rect Area); - Brush getBrush(); - Rect getArea(); -private: - Rect area; - Brush brush; -}; class Drawable { @@ -50,6 +41,8 @@ public: virtual int handle(SDL_Event e,int& running,int& update)=0; }; + + class ButtonBase : public Drawable, public Interactive { public: @@ -68,6 +61,29 @@ private: 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 vec; + }Control; + +private: + Rect area; + Brush brush; +}; + }/// End of namespace MiniEngine::Widget }/// End of namespace MiniEngine