1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-06-28 12:39:50 +03:00
gmenu2x/src/buttonbox.h
Maarten ter Huurne 428a316bc1 Removed GMenu2X pointer from ButtonBox
It was only used to fetch resY, so I replaced that by taking the
y-coordinate as an argument. That is also more consistent with the
x-coordinate which was already an argument.

The x-coordinate was changed to a signed int, since that is the norm
for paint coordinates. It can be useful for drawing widgets that are
partially off screen, for example during a (dis)appear animation.

In InputDialog, the ButtonBox field was changed from a pointer to
a plain data member. There was no need to dynamically allocate it.
2014-08-16 05:52:25 +02:00

26 lines
360 B
C++

#ifndef __BUTTONBOX_H__
#define __BUTTONBOX_H__
#include "iconbutton.h"
#include <memory>
#include <vector>
class GMenu2X;
class Surface;
class ButtonBox
{
public:
void add(std::unique_ptr<IconButton> button);
void clear();
void paint(Surface& s, int x, int y);
void handleTS();
private:
std::vector<std::unique_ptr<IconButton>> buttons;
};
#endif