From 41979ef91d389a198b040f69afecb9fca987d423 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Thu, 2 Mar 2017 22:00:01 +0800 Subject: [PATCH] Update MiniEngine_Widget.cpp --- MiniEngine_Widget.cpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/MiniEngine_Widget.cpp b/MiniEngine_Widget.cpp index e43ed68..ff2bb37 100644 --- a/MiniEngine_Widget.cpp +++ b/MiniEngine_Widget.cpp @@ -1,6 +1,4 @@ #include "MiniEngine_Widget.h" -#include -using namespace std; using namespace MiniEngine; namespace MiniEngine @@ -120,9 +118,33 @@ Rect Board::getArea() return area; } +void Board::_Control::add(Interactive* widget) +{ + vec.push_back(widget); +} +int Board::_Control::size() +{ + return vec.size(); +} +bool Board::_Control::remove(Interactive* widget) +{ + for(auto iter=vec.begin();iter!=vec.end();++iter) + { + if(*iter==widget) + { + vec.erase(iter); + return true; + } + } + return false; +} +Interactive* Board::_Control::at(int index) +{ + return vec.at(index); +}