1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-07-02 17:52:54 +03:00
gmenu2x/src/iconbutton.h
Paul Cercueil 88f54e1ccc Drop incredibly dirty and huge file FastDelegate.h
It's way too over-engineered for what we need to do, and we can
do much simpler using C++11.
2013-07-29 12:58:25 -04:00

36 lines
588 B
C++

#ifndef ICONBUTTON_H
#define ICONBUTTON_H
#include "button.h"
#include <string>
class GMenu2X;
class Surface;
class IconButton : public Button {
public:
IconButton(GMenu2X *gmenu2x, Touchscreen &ts,
const std::string &icon, const std::string &label = "");
virtual ~IconButton() {};
virtual void paint();
virtual bool paintHover();
virtual void setPosition(int x, int y);
void setAction(function_t action);
private:
void updateSurfaces();
GMenu2X *gmenu2x;
std::string icon, label;
void recalcSize();
SDL_Rect iconRect, labelRect;
Surface *iconSurface;
};
#endif