Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8698 in orxonox.OLD for branches/gui


Ignore:
Timestamp:
Jun 21, 2006, 11:51:07 PM (18 years ago)
Author:
bensch
Message:

image-button does what it should

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/story_entities/menu/glgui_imagebutton.cc

    r8694 r8698  
    2424
    2525  GLGuiImageButton::GLGuiImageButton(const std::string& label, unsigned int levelID, const std::string& imageName, GLGuiImage* image)
    26   : GLGuiPushButton(label)
     26      : GLGuiPushButton(label)
    2727  {
    2828    this->imageName = imageName;
    2929    this->levelID = levelID;
    3030    this->image = image;
     31
     32    image->loadImageFromFile(imageName);
    3133  }
    3234
     
    3638  void GLGuiImageButton::releasing(const Vector2D& pos, bool focused)
    3739  {
    38     this->emit(startLevel(this->levelID));
     40    if (focused)
     41      this->emit(startLevel(this->levelID));
    3942  }
    4043
    4144  void GLGuiImageButton::receivedFocus()
    4245  {
     46    printf("%s:: %s\n", this->label().c_str(), this->imageName.c_str());
     47
    4348    this->image->loadImageFromFile(this->imageName);
    4449  }
    4550  void GLGuiImageButton::removedFocus()
    46   {
    47   }
     51  {}
    4852
    4953
    5054  void GLGuiImageButton::showing()
    5155  {
     56    GLGuiPushButton::showing();
    5257    this->image->show();
    5358  }
     
    5560  void GLGuiImageButton::hiding()
    5661  {
     62    GLGuiPushButton::hiding();
     63
    5764    this->image->hide();
    5865  }
Note: See TracChangeset for help on using the changeset viewer.