Root/src/buttonbox.cpp

1#include "buttonbox.h"
2
3#include "gmenu2x.h"
4#include "iconbutton.h"
5
6ButtonBox::ButtonBox(GMenu2X *gmenu2x) : gmenu2x(gmenu2x)
7{
8}
9
10ButtonBox::~ButtonBox()
11{
12    clear();
13}
14
15void ButtonBox::add(IconButton *button)
16{
17    buttons.push_back(button);
18}
19
20void ButtonBox::clear()
21{
22    buttons.clear();
23}
24
25void ButtonBox::paint(unsigned int posX)
26{
27    for (auto button : buttons)
28        posX = gmenu2x->drawButton(button, posX);
29}
30
31void ButtonBox::handleTS()
32{
33    for (auto button : buttons)
34        button->handleTS();
35}
36

Archive Download this file



interactive