2010-02-04 13:33:47 +02:00
|
|
|
#ifndef ICONBUTTON_H
|
|
|
|
#define ICONBUTTON_H
|
|
|
|
|
|
|
|
#include "button.h"
|
2011-05-09 06:17:25 +03:00
|
|
|
#include "asfont.h"
|
|
|
|
|
|
|
|
#include <string>
|
2010-02-04 13:33:47 +02:00
|
|
|
|
|
|
|
using std::string;
|
|
|
|
|
|
|
|
class GMenu2X;
|
2010-05-02 15:52:46 +03:00
|
|
|
class Surface;
|
2010-02-04 13:33:47 +02:00
|
|
|
|
|
|
|
class IconButton : public Button {
|
|
|
|
protected:
|
2010-07-27 23:12:28 +03:00
|
|
|
GMenu2X *gmenu2x;
|
2010-02-04 13:33:47 +02:00
|
|
|
string icon, label;
|
|
|
|
void recalcSize();
|
|
|
|
SDL_Rect iconRect, labelRect;
|
|
|
|
|
2010-05-02 15:52:46 +03:00
|
|
|
Surface *iconSurface;
|
|
|
|
|
|
|
|
void updateSurfaces();
|
|
|
|
|
2010-02-04 13:33:47 +02:00
|
|
|
public:
|
2010-05-02 15:29:09 +03:00
|
|
|
IconButton(GMenu2X *gmenu2x, const string &icon, const string &label="");
|
2010-02-04 13:33:47 +02:00
|
|
|
virtual ~IconButton() {};
|
|
|
|
|
|
|
|
virtual void paint();
|
|
|
|
virtual bool paintHover();
|
|
|
|
|
2010-05-03 23:21:36 +03:00
|
|
|
virtual void setPosition(int x, int y);
|
2010-02-04 13:33:47 +02:00
|
|
|
|
|
|
|
void setAction(ButtonAction action);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|