Root/src/buttonbox.cpp

1
2#include "button.h"
3#include "gmenu2x.h"
4
5#include "buttonbox.h"
6
7ButtonBox::ButtonBox(GMenu2X *gmenu2x) : gmenu2x(gmenu2x)
8{
9}
10
11ButtonBox::~ButtonBox()
12{
13    for (ButtonList::const_iterator it = buttons.begin(); it != buttons.end(); ++it)
14        delete *it;
15}
16
17void ButtonBox::add(Button *button)
18{
19    buttons.push_back(button);
20}
21
22void ButtonBox::paint(unsigned int posX)
23{
24    for (ButtonList::const_iterator it = buttons.begin(); it != buttons.end(); ++it)
25        posX = gmenu2x->drawButton(*it, posX);
26}
27
28void ButtonBox::handleTS()
29{
30    for (ButtonList::iterator it = buttons.begin(); it != buttons.end(); ++it)
31        (*it)->handleTS();
32}
33

Archive Download this file



interactive