2008-02-09 13:43:23 +01:00
|
|
|
#ifndef __GLGUIBUTTON_H
|
|
|
|
#define __GLGUIBUTTON_H
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include <string>
|
2008-09-19 17:34:01 +02:00
|
|
|
#include <SDL.h>
|
|
|
|
#include <SDL_opengl.h>
|
2008-02-09 13:43:23 +01:00
|
|
|
|
|
|
|
#include "textlabel.h"
|
|
|
|
|
|
|
|
#define GLGUI_BUTTONDOWN SDL_USEREVENT+10
|
|
|
|
|
2008-08-10 17:14:54 +02:00
|
|
|
namespace segl {
|
|
|
|
|
2008-02-09 13:43:23 +01:00
|
|
|
class GLGuiButton : public GLGuiTextLabel {
|
|
|
|
protected:
|
|
|
|
int eventid;
|
2008-08-10 17:14:54 +02:00
|
|
|
Color highlightcol;
|
2008-02-09 13:43:23 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
GLGuiButton(int _eventid, int _x, int _y, bool _center=false, int _wrap=0);
|
|
|
|
GLGuiButton(int _eventid, std::string str, int _x, int _y, bool _center=false, int _wrap=0);
|
|
|
|
|
|
|
|
void setHighlightColor();
|
|
|
|
|
|
|
|
void onMouseOver(int m_x, int m_y);
|
2008-02-10 20:50:42 +01:00
|
|
|
void onMouseClick(int m_x, int m_y, int m_button);
|
2008-02-09 13:43:23 +01:00
|
|
|
};
|
|
|
|
|
2008-08-10 17:14:54 +02:00
|
|
|
} // namespace {
|
|
|
|
|
2008-02-09 13:43:23 +01:00
|
|
|
#endif
|