2008-02-09 13:43:23 +01:00
|
|
|
|
#include "button.h"
|
|
|
|
|
|
2008-08-10 17:14:54 +02:00
|
|
|
|
namespace segl {
|
|
|
|
|
|
2008-02-09 13:43:23 +01:00
|
|
|
|
GLGuiButton::GLGuiButton(int _eventid, int _x, int _y, bool _center, int _wrap) : GLGuiTextLabel(_x, _y, _center, _wrap) {
|
|
|
|
|
highlightable = true;
|
|
|
|
|
clickable = true;
|
|
|
|
|
eventid = _eventid;
|
|
|
|
|
highlightcol.set(1.0f, 0.0f, 0.0f, 1.0f);
|
|
|
|
|
}
|
2008-08-10 17:14:54 +02:00
|
|
|
|
|
2008-02-09 13:43:23 +01:00
|
|
|
|
GLGuiButton::GLGuiButton(int _eventid, std::string str, int _x, int _y, bool _center, int _wrap) : GLGuiTextLabel(str, _x, _y, _center, _wrap){
|
|
|
|
|
highlightable = true;
|
|
|
|
|
clickable = true;
|
|
|
|
|
eventid = _eventid;
|
|
|
|
|
highlightcol.set(1.0f, 0.0f, 0.0f, 1.0f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GLGuiButton::onMouseOver(int m_x, int m_y) {
|
2008-08-10 17:14:54 +02:00
|
|
|
|
// L<>ngste stelle finden, dann collision
|
2008-02-09 13:43:23 +01:00
|
|
|
|
}
|
2008-02-09 15:38:37 +01:00
|
|
|
|
|
|
|
|
|
void GLGuiButton::onMouseClick(int m_x, int m_y, int m_button) {
|
|
|
|
|
SDL_Event e;
|
|
|
|
|
e.type = GLGUI_BUTTONDOWN;
|
|
|
|
|
e.user.code = eventid;
|
|
|
|
|
SDL_PushEvent(&e);
|
|
|
|
|
}
|
2008-08-10 17:14:54 +02:00
|
|
|
|
|
|
|
|
|
} // namespace
|