mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2025-04-21 12:27:27 +03:00
initial commit - needs clean-up
Signed-off-by: Mirko Lindner <mirko@sharism.cc>
This commit is contained in:
43
src/iconbutton.h
Normal file
43
src/iconbutton.h
Normal file
@@ -0,0 +1,43 @@
|
||||
#ifndef ICONBUTTON_H
|
||||
#define ICONBUTTON_H
|
||||
|
||||
#include <string>
|
||||
#include "button.h"
|
||||
|
||||
using std::string;
|
||||
|
||||
class GMenu2X;
|
||||
|
||||
class IconButton : public Button {
|
||||
protected:
|
||||
string icon, label;
|
||||
int labelPosition, labelMargin;
|
||||
unsigned short labelHAlign, labelVAlign;
|
||||
void recalcSize();
|
||||
SDL_Rect iconRect, labelRect;
|
||||
|
||||
public:
|
||||
static const int DISP_RIGHT = 0;
|
||||
static const int DISP_LEFT = 1;
|
||||
static const int DISP_TOP = 2;
|
||||
static const int DISP_BOTTOM = 3;
|
||||
|
||||
IconButton(GMenu2X *gmenu2x, string icon, string label="");
|
||||
virtual ~IconButton() {};
|
||||
|
||||
virtual void paint();
|
||||
virtual bool paintHover();
|
||||
|
||||
void setPosition(int x, int y);
|
||||
|
||||
string getLabel();
|
||||
void setLabel(string label);
|
||||
void setLabelPosition(int pos, int margin);
|
||||
|
||||
string getIcon();
|
||||
void setIcon(string icon);
|
||||
|
||||
void setAction(ButtonAction action);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user