- Timestamp:
- Jun 17, 2006, 9:45:53 AM (18 years ago)
- Location:
- branches/gui/src/lib/gui/gl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/gui/gl/glgui_style.cc
r8518 r8554 68 68 {} 69 69 70 70 71 void GLGuiStyle::setBorderLeft(float value) 71 72 { … … 79 80 } 80 81 81 void GLGuiStyle::setBorderLeftS(float value, const std::string& state) 82 { 82 void GLGuiStyle::setBorderLeftS(float value, const std::string& stateName) 83 { 84 OrxGui::State state; 85 if (getState(stateName, &state)) 86 this->setBorderLeft(value, state); 87 else 88 this->setBorderLeft(value); 83 89 } 84 90 … … 95 101 } 96 102 97 void GLGuiStyle::setBorderRightS(float value, const std::string& state) 98 {} 103 void GLGuiStyle::setBorderRightS(float value, const std::string& stateName) 104 { 105 OrxGui::State state; 106 if (getState(stateName, &state)) 107 this->setBorderRight(value, state); 108 else 109 this->setBorderRight(value); 110 } 99 111 100 112 … … 110 122 } 111 123 112 void GLGuiStyle::setBorderTopS(float value, const std::string& state) 113 {} 124 void GLGuiStyle::setBorderTopS(float value, const std::string& stateName) 125 { 126 OrxGui::State state; 127 if (getState(stateName, &state)) 128 this->setBorderTop(value, state); 129 else 130 this->setBorderTop(value); 131 } 114 132 115 133 … … 125 143 } 126 144 127 void GLGuiStyle::setBorderBottomS(float value, const std::string& state) 128 {} 145 void GLGuiStyle::setBorderBottomS(float value, const std::string& stateName) 146 { 147 OrxGui::State state; 148 if (getState(stateName, &state)) 149 this->setBorderBottom(value, state); 150 else 151 this->setBorderBottom(value); 152 } 129 153 130 154 … … 140 164 } 141 165 142 void GLGuiStyle::setTextSizeS(float value, const std::string& state) 143 {} 166 void GLGuiStyle::setTextSizeS(float value, const std::string& stateName) 167 { 168 OrxGui::State state; 169 if (getState(stateName, &state)) 170 this->setTextSize(value, state); 171 else 172 this->setTextSize(value); 173 } 144 174 145 175 … … 155 185 } 156 186 157 void GLGuiStyle::setBackgroundColorS(float r, float g, float b, float a, const std::string& state) 158 {} 187 void GLGuiStyle::setBackgroundColorS(float r, float g, float b, float a, const std::string& stateName) 188 { 189 OrxGui::State state; 190 if (getState(stateName, &state)) 191 this->setBackgroundColor(Color(r,g,b,a), state); 192 else 193 this->setBackgroundColor(Color(r,g,b,a)); 194 } 159 195 160 196 … … 170 206 } 171 207 172 void GLGuiStyle::setBackgroundTexture(const std::string& textureName, const std::string& state) 173 {} 208 void GLGuiStyle::setBackgroundTexture(const std::string& textureName, const std::string& stateName) 209 { 210 OrxGui::State state; 211 if (getState(stateName, &state)) 212 ; /// FIXME this->setBackgroundTexture(textureName, state); 213 else 214 ; /// this->setBackgroundTexture(textureName); 215 } 174 216 175 217 … … 185 227 } 186 228 187 void GLGuiStyle::setForegroundColorS(float r, float g, float b, float a, const std::string& state) 188 {} 229 void GLGuiStyle::setForegroundColorS(float r, float g, float b, float a, const std::string& stateName) 230 { 231 OrxGui::State state; 232 if (getState(stateName, &state)) 233 this->setForegroundColor(Color(r,g,b,a), state); 234 else 235 this->setForegroundColor(Color(r,g,b,a)); 236 } 189 237 190 238 … … 196 244 197 245 void GLGuiStyle::setFeaturePosition(const std::string& featurePosition) 198 {} 199 246 { 247 for (unsigned int i = 0; i < 4; ++i) 248 { 249 if (featurePosition == FeaturePositionString[i]) 250 { 251 this->setFeaturePosition((FeaturePosition)i); 252 } 253 } 254 } 200 255 201 256 void GLGuiStyle::setFont(Font* font) … … 220 275 } 221 276 277 278 279 bool GLGuiStyle::getState(const std::string& stateName, OrxGui::State* state) 280 { 281 for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i) 282 if (stateName == OrxGui::StateString[i]) 283 { 284 *state = (OrxGui::State)i; 285 return true; 286 } 287 return false; 288 } 289 222 290 } -
branches/gui/src/lib/gui/gl/glgui_style.h
r8518 r8554 48 48 void setBorderLeft(float value); 49 49 void setBorderLeft(float value, OrxGui::State state); 50 void setBorderLeftS(float value, const std::string& state );50 void setBorderLeftS(float value, const std::string& stateName); 51 51 52 52 void setBorderRight(float value); 53 53 void setBorderRight(float value, OrxGui::State state); 54 void setBorderRightS(float value, const std::string& state );54 void setBorderRightS(float value, const std::string& stateName); 55 55 56 56 void setBorderTop(float value); 57 57 void setBorderTop(float value, OrxGui::State state); 58 void setBorderTopS(float value, const std::string& state );58 void setBorderTopS(float value, const std::string& stateName); 59 59 60 60 void setBorderBottom(float value); 61 61 void setBorderBottom(float value, OrxGui::State state); 62 void setBorderBottomS(float value, const std::string& state );62 void setBorderBottomS(float value, const std::string& stateName); 63 63 64 64 void setTextSize(float value); 65 65 void setTextSize(float value, OrxGui::State state); 66 void setTextSizeS(float value, const std::string& state );66 void setTextSizeS(float value, const std::string& stateName); 67 67 68 68 void setBackgroundColor(const Color& color); 69 69 void setBackgroundColor(const Color& color, OrxGui::State state); 70 void setBackgroundColorS(float r, float g, float b, float a, const std::string& state );70 void setBackgroundColorS(float r, float g, float b, float a, const std::string& stateName); 71 71 72 72 void setBackgroundTexture(const Texture& texture); 73 73 void setBackgroundTexture(const Texture& texture, OrxGui::State state); 74 void setBackgroundTexture(const std::string& textureName, const std::string& state );74 void setBackgroundTexture(const std::string& textureName, const std::string& stateName); 75 75 76 76 void setForegroundColor(const Color& color); 77 77 void setForegroundColor(const Color& color, OrxGui::State state); 78 void setForegroundColorS(float r, float g, float b, float a, const std::string& state );78 void setForegroundColorS(float r, float g, float b, float a, const std::string& stateName); 79 79 80 80 … … 87 87 void setAnimated(bool animated); 88 88 void setAnimatedStateChanges(bool animated); 89 90 private: 91 bool getState(const std::string& stateName, OrxGui::State* state); 89 92 90 93 private:
Note: See TracChangeset
for help on using the changeset viewer.