Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8594 in orxonox.OLD for branches/gui


Ignore:
Timestamp:
Jun 19, 2006, 11:58:03 PM (19 years ago)
Author:
bensch
Message:

typo

Location:
branches/gui/src/lib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/gui/gl/glgui_style.cc

    r8584 r8594  
    3030  GLGuiStyle::GLGuiStyle (const TiXmlElement* root)
    3131  {
    32     _font = NULL;
     32    this->_font = NULL;
    3333    this->_currentState = OrxGui::Normal;
    3434    this->_animationCycle = -1.0;
     
    327327  }
    328328
     329    /**
     330     * @brief sets the Background Texture to all States.
     331     * @param textureName the Texture's fileName.
     332     */
     333  void GLGuiStyle::setBackgroundTexture(const std::string& textureName)
     334  {
     335    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
     336      _style[i]._background.setDiffuseMap(textureName);
     337  }
     338
    329339  /**
    330340   * @brief sets the Background Texture.
     
    336346    _style[state]._background.setDiffuseMap(texture);
    337347  }
     348
    338349
    339350
     
    492503
    493504
     505  void GLGuiStyle::tick(float dt)
     506  {
     507
     508  }
     509
     510  void GLGuiStyle::switchState(OrxGui::State state)
     511  {
     512    this->_currentStyle = this->_style[state];
     513    this->_currentState = state;
     514    printf("Switching to state %s\n", OrxGui::StateString[state].c_str());
     515  }
     516
     517
    494518  /**
    495519   * @param stateName the Name of a State.
  • branches/gui/src/lib/gui/gl/glgui_style.h

    r8584 r8594  
    117117
    118118    void setBackgroundTexture(const Texture& texture);
     119    void setBackgroundTexture(const std::string& textureName);
    119120    void setBackgroundTexture(const Texture& texture, OrxGui::State state);
    120121    void setBackgroundTexture(const std::string& textureName, const std::string& stateName);
  • branches/gui/src/lib/gui/gl/glgui_widget.cc

    r8584 r8594  
    6767    this->_pushed = false;
    6868    this->_state = OrxGui::Normal;
     69    this->_toFrontColor = NULL;
     70
     71    this->style().setBackgroundColor(Color(0, 0, 0, 1));
     72
     73    this->style().setForegroundColor(Color(1, 0, 0, 1), OrxGui::Normal);
     74    this->style().setForegroundColor(Color(0, 1, 0, 1), OrxGui::Selected);
     75    this->style().setForegroundColor(Color(0, 0, 1, 1), OrxGui::Focused);
     76    this->style().setForegroundColor(Color(.1, .1, .1, 1), OrxGui::Insensitive);
    6977
    7078    this->setVisibility(GLGUI_WIDGET_DEFAULT_VISIBLE);
    7179
    72 /*    this->_backMat.setDiffuseColor(Color(1.0, 0.5, 0.4, 1.0));
    73     this->_backMat.setDiffuseMap("gui_element_background.png");
    74     this->_frontColor = Color(1.0, 0.0, 0.0);*/
    75     this->_toFrontColor = NULL;
     80    this->style().setBackgroundTexture("gui_element_background.png");
    7681  }
    7782
     
    115120    return this->focusOverWidget(cursor->getAbsCoor2D());
    116121  }
     122
     123
    117124
    118125  void GLGuiWidget::setFrontColor(const Color& frontColor, bool instantaniously)
     
    164171  void GLGuiWidget::clicking(const Vector2D& pos)
    165172  {
    166     this->setFrontColor(Color(0, 0, 1));
    167 
     173    this->style().switchState(OrxGui::Selected);
    168174  }
    169175
    170176  void GLGuiWidget::releasing(const Vector2D& pos)
    171177  {
    172     this->setFrontColor(Color(0,1,0));
    173 
     178    this->style().switchState(OrxGui::Normal);
    174179  }
    175180
    176181  void GLGuiWidget::receivedFocus()
    177182  {
    178     this->setFrontColor(Color(0, 1, 0));
     183    this->style().switchState(OrxGui::Focused);
    179184  }
    180185
    181186  void GLGuiWidget::removedFocus()
    182187  {
    183     this->setFrontColor(Color(1, 0, 0));
     188    this->style().switchState(OrxGui::Normal);
    184189
    185190  }
  • branches/gui/src/lib/util/filesys/file.cc

    r8333 r8594  
    205205
    206206/// FIXME NEXT THREE FUNCTIONS
    207 bool File::isReadeable() const
     207bool File::isReadable() const
    208208{
    209209#ifndef __WIN32__
  • branches/gui/src/lib/util/filesys/file.h

    r8333 r8594  
    5151  bool isFile() const;
    5252  bool isDirectory() const;
    53   bool isReadeable() const;
     53  bool isReadable() const;
    5454  bool isWriteable() const;
    5555  bool isExecutable() const;
Note: See TracChangeset for help on using the changeset viewer.