2013-08-12 23:17:26 +03:00
|
|
|
#include "buttonbox.h"
|
2010-05-03 23:21:36 +03:00
|
|
|
|
|
|
|
#include "gmenu2x.h"
|
2013-08-12 23:17:26 +03:00
|
|
|
#include "iconbutton.h"
|
2010-05-03 23:21:36 +03:00
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2013-08-12 23:17:26 +03:00
|
|
|
void ButtonBox::add(IconButton *button)
|
2010-05-03 23:21:36 +03:00
|
|
|
{
|
|
|
|
buttons.push_back(button);
|
|
|
|
}
|
|
|
|
|
2011-09-15 21:12:02 +03:00
|
|
|
void ButtonBox::clear()
|
|
|
|
{
|
|
|
|
buttons.clear();
|
|
|
|
}
|
|
|
|
|
2014-01-16 02:03:15 +02:00
|
|
|
void ButtonBox::paint(Surface *s, unsigned int posX)
|
2010-05-03 23:21:36 +03:00
|
|
|
{
|
2013-08-12 23:17:26 +03:00
|
|
|
for (auto button : buttons)
|
2014-01-16 02:03:15 +02:00
|
|
|
posX = gmenu2x->drawButton(s, button, posX);
|
2010-05-03 23:21:36 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void ButtonBox::handleTS()
|
|
|
|
{
|
2013-08-12 23:17:26 +03:00
|
|
|
for (auto button : buttons)
|
|
|
|
button->handleTS();
|
2010-05-03 23:21:36 +03:00
|
|
|
}
|