- Timestamp:
- Jun 20, 2006, 10:46:02 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/gui/gl/glgui_widget.cc
r8610 r8611 104 104 105 105 this->setBackgroundColor(Color(.51, .3, .3, .5)); 106 this->setBackgroundColor(Color(.3, .5, .3, 1), OrxGui::Selected); 106 107 this->_style[0]._background.setBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 107 108 this->_style[1]._background.setBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); … … 711 712 712 713 713 /**714 * @param stateName the Name of a State.715 * @param state the found State is returned here if found.716 * @returns true if String is found, false otherwise.717 */718 bool GLGuiWidget::getState(const std::string& stateName, OrxGui::State* state)719 {720 for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)721 if (stateName == OrxGui::StateString[i])722 {723 *state = (OrxGui::State)i;724 return true;725 }726 return false;727 }728 729 714 void GLGuiWidget::animateBack() 730 715 { … … 744 729 { 745 730 _currentStyle._foreground.diffuseColor() = this->foregroundColor(_state); 731 _currentStyle._background.diffuseColor() = this->backgroundColor(_state); 746 732 _animating = false; 747 733 } 748 734 else 735 { 749 736 _currentStyle._foreground.diffuseColor().slerp(this->foregroundColor(_state), _animationCycle); 750 737 _currentStyle._background.diffuseColor().slerp(this->backgroundColor(_state), _animationCycle); 738 } 751 739 this->updateFrontColor(); 752 740 } … … 764 752 } 765 753 754 755 /** 756 * @param stateName the Name of a State. 757 * @param state the found State is returned here if found. 758 * @returns true if String is found, false otherwise. 759 */ 760 bool GLGuiWidget::getState(const std::string& stateName, OrxGui::State* state) 761 { 762 for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i) 763 if (stateName == OrxGui::StateString[i]) 764 { 765 *state = (OrxGui::State)i; 766 return true; 767 } 768 return false; 769 } 770 771 /** 772 * @brief print out some nice debug output about the Widget. 773 */ 766 774 void GLGuiWidget::debug() const 767 775 { … … 791 799 PRINT(0)(" Borders: Left: %0.2f, Right: %0.2f, Top: %0.2f, Bottom %0.2f\n", 792 800 _style[i]._borderLeft, _style[i]._borderRight, _style[i]._borderTop, _style[i]._borderBottom); 793 PRINT(0)(" TextSize %0.2f ", _style[i]._textSize);794 PRINT(0)(" - BackgroundColor"); _style[i]._background.diffuseColor().debug();795 PRINT(0)(" - ForegroundColor"); _style[i]._foreground.diffuseColor().debug();801 PRINT(0)(" TextSize %0.2f\n", _style[i]._textSize); 802 PRINT(0)(" BackgroundColor: "); _style[i]._background.diffuseColor().debug(); 803 PRINT(0)(" ForegroundColor: "); _style[i]._foreground.diffuseColor().debug(); 796 804 PRINT(0)("\n"); 797 805 }
Note: See TracChangeset
for help on using the changeset viewer.