2010-05-03 23:21:36 +03:00
|
|
|
|
|
|
|
#include "button.h"
|
|
|
|
#include "gmenu2x.h"
|
|
|
|
|
|
|
|
#include "buttonbox.h"
|
|
|
|
|
|
|
|
ButtonBox::ButtonBox(GMenu2X *gmenu2x) : gmenu2x(gmenu2x)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
ButtonBox::~ButtonBox()
|
|
|
|
{
|
2011-09-15 21:12:02 +03:00
|
|
|
clear();
|
2010-05-03 23:21:36 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void ButtonBox::add(Button *button)
|
|
|
|
{
|
|
|
|
buttons.push_back(button);
|
|
|
|
}
|
|
|
|
|
2011-09-15 21:12:02 +03:00
|
|
|
void ButtonBox::clear()
|
|
|
|
{
|
|
|
|
buttons.clear();
|
|
|
|
}
|
|
|
|
|
2010-05-03 23:21:36 +03:00
|
|
|
void ButtonBox::paint(unsigned int posX)
|
|
|
|
{
|
|
|
|
for (ButtonList::const_iterator it = buttons.begin(); it != buttons.end(); ++it)
|
|
|
|
posX = gmenu2x->drawButton(*it, posX);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ButtonBox::handleTS()
|
|
|
|
{
|
|
|
|
for (ButtonList::iterator it = buttons.begin(); it != buttons.end(); ++it)
|
|
|
|
(*it)->handleTS();
|
|
|
|
}
|