Changeset 8559 in orxonox.OLD for branches/gui/src/lib
- Timestamp:
- Jun 17, 2006, 12:07:51 PM (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
r8555 r8559 26 26 /** 27 27 * @brief standard constructor 28 */ 28 * @param root the XML-Element to load settings from 29 */ 29 30 GLGuiStyle::GLGuiStyle (const TiXmlElement* root) 30 31 { … … 47 48 } 48 49 50 /** 51 * @brief resets the Style to the default Settings. 52 */ 49 53 void GLGuiStyle::reset() 50 54 { … … 65 69 } 66 70 71 /** 72 * @brief loads Parameters for a Style from XML 73 * @param root the XML-Element to load from. 74 */ 67 75 void GLGuiStyle::loadParams(const TiXmlElement* root) 68 76 { … … 76 84 LoadParam(root, "foreground-color", this, GLGuiStyle, setForegroundColorS); 77 85 78 LoadParam(root, "feature-position", this, GLGuiStyle, setFeaturePosition );86 LoadParam(root, "feature-position", this, GLGuiStyle, setFeaturePositionS); 79 87 LoadParam(root, "Font", this, GLGuiStyle, setFont); 80 88 … … 83 91 } 84 92 85 93 /** 94 * @brief sets the Width of the left border for all States 95 * @param value the borderWidth 96 */ 86 97 void GLGuiStyle::setBorderLeft(float value) 87 98 { … … 90 101 } 91 102 103 /** 104 * @brief sets the Width of the left border. 105 * @param value the borderWidth 106 * @param state the State to set the borderwidth to 107 */ 92 108 void GLGuiStyle::setBorderLeft(float value, OrxGui::State state) 93 109 { … … 95 111 } 96 112 113 /** 114 * @brief sets the Width of the left border. 115 * @param value the borderWidth 116 * @param stateName the State to set the borderwidth to 117 */ 97 118 void GLGuiStyle::setBorderLeftS(float value, const std::string& stateName) 98 119 { … … 104 125 } 105 126 106 127 /** 128 * @brief sets the Width of the right border for all states. 129 * @param value the borderWidth 130 */ 107 131 void GLGuiStyle::setBorderRight(float value) 108 132 { … … 111 135 } 112 136 137 /** 138 * @brief sets the Width of the right border. 139 * @param value the borderWidth 140 * @param state the State to setup. 141 */ 113 142 void GLGuiStyle::setBorderRight(float value, OrxGui::State state) 114 143 { … … 116 145 } 117 146 147 /** 148 * @brief sets the Width of the right border. 149 * @param value the borderWidth 150 * @param stateName the State to setup. 151 */ 118 152 void GLGuiStyle::setBorderRightS(float value, const std::string& stateName) 119 153 { … … 126 160 127 161 162 /** 163 * @brief sets the Width of the top border for all states. 164 * @param value the borderWidth 165 */ 128 166 void GLGuiStyle::setBorderTop(float value) 129 167 { … … 132 170 } 133 171 172 /** 173 * @brief sets the Width of the top border. 174 * @param value the borderWidth 175 * @param state the State to setup. 176 */ 134 177 void GLGuiStyle::setBorderTop(float value, OrxGui::State state) 135 178 { … … 137 180 } 138 181 182 /** 183 * @brief sets the Width of the top border. 184 * @param value the borderWidth 185 * @param stateName the State to setup. 186 */ 139 187 void GLGuiStyle::setBorderTopS(float value, const std::string& stateName) 140 188 { … … 147 195 148 196 197 /** 198 * @brief sets the Width of the bottom border for all states. 199 * @param value the borderWidth 200 */ 149 201 void GLGuiStyle::setBorderBottom(float value) 150 202 { … … 153 205 } 154 206 207 /** 208 * @brief sets the Width of the bottom border. 209 * @param value the borderWidth 210 * @param state the State to setup. 211 */ 155 212 void GLGuiStyle::setBorderBottom(float value, OrxGui::State state) 156 213 { … … 158 215 } 159 216 217 /** 218 * @brief sets the Width of the bottom border for all states. 219 * @param value the borderWidth 220 * @param stateName the State to setup. 221 */ 160 222 void GLGuiStyle::setBorderBottomS(float value, const std::string& stateName) 161 223 { 162 OrxGui::State state; 163 if (getState(stateName, &state)) 164 this->setBorderBottom(value, state); 165 else 166 this->setBorderBottom(value); 167 } 168 169 224 OrxGui::State state; 225 if (getState(stateName, &state)) 226 this->setBorderBottom(value, state); 227 else 228 this->setBorderBottom(value); 229 } 230 231 232 /** 233 * @brief sets the TextSize for all states. 234 * @param value the TextSize 235 */ 170 236 void GLGuiStyle::setTextSize(float value) 171 237 { … … 174 240 } 175 241 242 /** 243 * @brief sets the TextSize. 244 * @param value the TextSize. 245 * @param state: the State to setup 246 */ 176 247 void GLGuiStyle::setTextSize(float value, OrxGui::State state) 177 248 { … … 179 250 } 180 251 252 /** 253 * @brief sets the TextSize. 254 * @param value the TextSize. 255 * @param stateName: the State to setup 256 */ 181 257 void GLGuiStyle::setTextSizeS(float value, const std::string& stateName) 182 258 { … … 189 265 190 266 267 /** 268 * @brief sets the Background Color for all States. 269 * @param color the Color. 270 */ 191 271 void GLGuiStyle::setBackgroundColor(const Color& color) 192 272 { … … 195 275 } 196 276 277 /** 278 * @brief sets the Background Color. 279 * @param color the Color. 280 * @param state: the State to setup 281 */ 197 282 void GLGuiStyle::setBackgroundColor(const Color& color, OrxGui::State state) 198 283 { … … 200 285 } 201 286 287 /** 288 * @brief sets the Background Color. 289 * @param r the Color's red part. 290 * @param g the Color's green part. 291 * @param b the Color's blue part. 292 * @param a the Color's alpha part. 293 * @param stateName: the State to setup 294 */ 202 295 void GLGuiStyle::setBackgroundColorS(float r, float g, float b, float a, const std::string& stateName) 203 296 { … … 210 303 211 304 305 /** 306 * @brief sets the Background Texture for all States. 307 * @param texture the Texture. 308 */ 212 309 void GLGuiStyle::setBackgroundTexture(const Texture& texture) 213 310 { … … 216 313 } 217 314 315 /** 316 * @brief sets the Background Texture. 317 * @param texture the Texture. 318 * @param state the State to setup. 319 */ 218 320 void GLGuiStyle::setBackgroundTexture(const Texture& texture, OrxGui::State state) 219 321 { … … 221 323 } 222 324 325 /** 326 * @brief sets the Background Texture. 327 * @param texture the Texture. 328 * @param stateName the State to setup. 329 */ 223 330 void GLGuiStyle::setBackgroundTexture(const std::string& textureName, const std::string& stateName) 224 331 { 225 226 if (getState(stateName, &state))227 ; /// FIXME this->setBackgroundTexture(textureName, state);228 else332 OrxGui::State state; 333 if (getState(stateName, &state)) 334 ; /// FIXME this->setBackgroundTexture(textureName, state); 335 else 229 336 ; /// this->setBackgroundTexture(textureName); 230 337 } 231 338 232 339 340 /** 341 * @brief sets the Foreground Color for all States. 342 * @param color the Color. 343 */ 233 344 void GLGuiStyle::setForegroundColor(const Color& color) 234 345 { … … 237 348 } 238 349 350 /** 351 * @brief sets the Foreground Color. 352 * @param color the Color. 353 * @param state the State to setup 354 */ 239 355 void GLGuiStyle::setForegroundColor(const Color& color, OrxGui::State state) 240 356 { … … 242 358 } 243 359 360 /** 361 * @brief sets the Foreground Color. 362 * @param r the Color's red part. 363 * @param g the Color's green part. 364 * @param b the Color's blue part. 365 * @param a the Color's alpha part. 366 * @param stateName: the State to setup 367 */ 244 368 void GLGuiStyle::setForegroundColorS(float r, float g, float b, float a, const std::string& stateName) 245 369 { … … 252 376 253 377 254 378 /** 379 * @brief sets the Feature-Position. 380 * @param featurePosition the Feature-Position. 381 */ 255 382 void GLGuiStyle::setFeaturePosition(FeaturePosition featurePosition) 256 383 { … … 258 385 } 259 386 260 void GLGuiStyle::setFeaturePosition(const std::string& featurePosition) 387 /** 388 * @brief sets the Feature-Position by converting from a String. 389 * @param featurePosition the Feature-Position. 390 */ 391 void GLGuiStyle::setFeaturePositionS(const std::string& featurePosition) 261 392 { 262 393 for (unsigned int i = 0; i < 4; ++i) … … 269 400 } 270 401 402 /** 403 * @brief sets the Font. 404 * @param font the Font. 405 */ 271 406 void GLGuiStyle::setFont(Font* font) 272 407 { … … 274 409 } 275 410 411 /** 412 * @brief sets the font from a Font-Name. 413 * @param fontName the FileName of the Font. 414 */ 276 415 void GLGuiStyle::setFont(const std::string& fontName) 277 416 { … … 279 418 } 280 419 281 420 /** 421 * @brief if Animation should be turned on. 422 * @param animated true if on, false otherwise. 423 */ 282 424 void GLGuiStyle::setAnimated(bool animated) 283 425 { … … 285 427 } 286 428 429 /** 430 * @brief sets the AnimatedState. 431 * @param animated: it states-changes should animate true, otherwise false. 432 */ 287 433 void GLGuiStyle::setAnimatedStateChanges(bool animated) 288 434 { … … 291 437 292 438 293 439 /** 440 * @param stateName the Name of a State. 441 * @param state the found State is returned here if found. 442 * @returns true if String is found, false otherwise. 443 */ 294 444 bool GLGuiStyle::getState(const std::string& stateName, OrxGui::State* state) 295 445 { 296 446 for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i) 297 447 if (stateName == OrxGui::StateString[i]) 298 {299 *state = (OrxGui::State)i;448 { 449 *state = (OrxGui::State)i; 300 450 return true; 301 }451 } 302 452 return false; 303 453 } 304 305 454 } -
branches/gui/src/lib/gui/gl/glgui_style.h
r8555 r8559 26 26 27 27 /// Retrieve 28 /** @returns left borderWidth @param state the State to retrieve from */ 28 29 inline float borderLeft(OrxGui::State state = GLGUI_DEFAULT_STYLE) const { return _style[state]._borderLeft; } 30 /** @returns right borderWidth @param state the State to retrieve from */ 29 31 inline float borderRight(OrxGui::State state = GLGUI_DEFAULT_STYLE) const { return _style[state]._borderRight; } 32 /** @returns top borderWidth @param state the State to retrieve from */ 30 33 inline float borderTop(OrxGui::State state = GLGUI_DEFAULT_STYLE) const { return _style[state]._borderTop; } 34 /** @returns bottom borderWidth @param state the State to retrieve from */ 31 35 inline float borderBottom(OrxGui::State state = GLGUI_DEFAULT_STYLE) const { return _style[state]._borderBottom; } 36 /** @returns textSize @param state the State to retrieve from */ 32 37 inline float textSize(OrxGui::State state = GLGUI_DEFAULT_STYLE) const { return _style[state]._textSize; } 38 /** @returns the Background Color @param state the State to retrieve from */ 33 39 inline const Color& backgroundColor(OrxGui::State state= GLGUI_DEFAULT_STYLE) const { return _style[state]._backgroundColor; } 40 /** @returns background Texture. @param state the State to retrieve from */ 34 41 inline const Texture& backgrorundTexture(OrxGui::State state= GLGUI_DEFAULT_STYLE) const { return _style[state]._backgroundTexture; } 42 /** @returns the foreground Color @param state the State to retrieve from */ 35 43 inline const Color& foregroundColor(OrxGui::State state= GLGUI_DEFAULT_STYLE) const { return _style[state]._foregroundColor; } 36 44 45 /** @returns FeaturePosition */ 37 46 inline FeaturePosition featurePosition() const { return _featurePosition; } 47 /** @returns the font */ 38 48 inline const Font* const font() const { return _font; } 49 /** @returns true if the Element is Animated */ 39 50 inline bool animated() const { return _animated; } 51 /** @returns true if State-Changes are animated */ 40 52 inline bool animatedStateChanges() const { return _animatedStateChanges; } 41 53 … … 80 92 81 93 void setFeaturePosition(FeaturePosition featurePosition); 82 void setFeaturePosition (const std::string& featurePosition);94 void setFeaturePositionS(const std::string& featurePosition); 83 95 84 96 void setFont(Font* font); … … 109 121 110 122 111 StatedStyle _style[GLGUI_STATE_COUNT]; 123 StatedStyle _style[GLGUI_STATE_COUNT]; //!< Styles configured for different States 112 124 113 125 FeaturePosition _featurePosition; //!< The Position a Feature will be layed at (checkbox(box), slider(text),...)
Note: See TracChangeset
for help on using the changeset viewer.