/* orxonox - the future of 3D-vertical-scrollers Copyright (C) 2004 orx This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ### File Specific: main-programmer: Benjamin Grauer co-programmer: ... */ #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_SHELL #include "glgui_imagebutton.h" #include "debug.h" namespace OrxGui { GLGuiImageButton::GLGuiImageButton(const std::string& label, unsigned int levelID, const std::string& imageName, GLGuiImage* image) : GLGuiPushButton(label) { this->imageName = imageName; this->levelID = levelID; this->image = image; image->loadImageFromFile(imageName); } GLGuiImageButton::~GLGuiImageButton() {} void GLGuiImageButton::releasing(const Vector2D& pos, bool focused) { if (focused) this->emit(startLevel(this->levelID)); } void GLGuiImageButton::receivedFocus() { printf("%s:: %s\n", this->label().c_str(), this->imageName.c_str()); this->image->loadImageFromFile(this->imageName); } void GLGuiImageButton::removedFocus() {} void GLGuiImageButton::showing() { GLGuiPushButton::showing(); this->image->show(); } void GLGuiImageButton::hiding() { GLGuiPushButton::hiding(); this->image->hide(); } }