Root/
Source at commit cfb96dd created 10 years 2 months ago. By Paul Cercueil, Pass a Surface to ButtonBox' and IconButton's paint function | |
---|---|
1 | #include "buttonbox.h" |
2 | |
3 | #include "gmenu2x.h" |
4 | #include "iconbutton.h" |
5 | |
6 | ButtonBox::ButtonBox(GMenu2X *gmenu2x) : gmenu2x(gmenu2x) |
7 | { |
8 | } |
9 | |
10 | ButtonBox::~ButtonBox() |
11 | { |
12 | clear(); |
13 | } |
14 | |
15 | void ButtonBox::add(IconButton *button) |
16 | { |
17 | buttons.push_back(button); |
18 | } |
19 | |
20 | void ButtonBox::clear() |
21 | { |
22 | buttons.clear(); |
23 | } |
24 | |
25 | void ButtonBox::paint(Surface *s, unsigned int posX) |
26 | { |
27 | for (auto button : buttons) |
28 | posX = gmenu2x->drawButton(s, button, posX); |
29 | } |
30 | |
31 | void ButtonBox::handleTS() |
32 | { |
33 | for (auto button : buttons) |
34 | button->handleTS(); |
35 | } |
36 |
Branches:
install_locations
master
opkrun
packages