mirror of
https://github.com/Kiritow/MiniEngine.git
synced 2024-03-22 13:11:22 +08:00
Update MiniEngine_Widget.cpp
This commit is contained in:
parent
b6395fec83
commit
41979ef91d
|
@ -1,6 +1,4 @@
|
|||
#include "MiniEngine_Widget.h"
|
||||
#include <iostream>
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user