Changeset 7995 in orxonox.OLD for branches/gui
- Timestamp:
- May 30, 2006, 10:16:09 PM (18 years ago)
- Location:
- branches/gui/src/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/gui/gl_gui/glgui_cursor.cc
r7987 r7995 59 59 this->backMaterial().setDiffuse(1.0,0.0,0.0); 60 60 this->backMaterial().setDiffuseMap("cursor.png"); 61 this->setSize2D(10, 20); 61 this->backMaterial().setBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 62 this->setSize2D(20, 30); 62 63 this->setAbsCoor2D(100, 100); 63 64 this->setLayer(E2D_LAYER_ABOVE_ALL); -
branches/gui/src/lib/gui/gl_gui/glgui_slider.cc
r7985 r7995 85 85 { 86 86 if (minimum <= max()) 87 { 87 88 this->_minValue = minimum; 88 89 if (this->value() < minimum) 90 this->_value = minimum; 89 emit(rangeChanged(this->_minValue, this->_maxValue)); 90 } 91 if (this->value() < this->min()) 92 this->setValue(this->min()); 91 93 } 92 94 … … 100 102 { 101 103 if (maximum >= min()) 104 { 102 105 this->_maxValue = maximum; 103 104 if (this->value() > maximum) 105 this->_value = maximum; 106 emit(rangeChanged(this->_minValue, this->_maxValue)); 107 } 108 if (this->value() > this->max()) 109 this->setValue(this->max()); 106 110 } 107 111 … … 119 123 this->_minValue = minimum; 120 124 this->_maxValue = maximum; 121 } 122 if (this->value() < minimum) 123 this->_value = minimum; 124 else if (this->value() > maximum) 125 this->_value = maximum; 125 emit(rangeChanged(this->_minValue, this->_maxValue)); 126 } 127 if (this->value() < this->min()) 128 this->setValue(this->min()); 129 else if (this->value() > this->max()) 130 this->setValue(this->max()); 126 131 } 127 132 -
branches/gui/src/lib/gui/gl_gui/glgui_slider.h
r7985 r7995 52 52 53 53 DeclareSignal1(valueChanged, float); 54 DeclareSignal2(rangeChanged, float, float); 54 55 55 56 protected: -
branches/gui/src/lib/util/multi_type.cc
r7994 r7995 39 39 switch (this->type) 40 40 { 41 41 default: 42 42 this->value.Float = 0.0f; 43 43 break; 44 44 case MT_BOOL: 45 45 this->value.Bool = false; 46 46 break; 47 47 case MT_INT: 48 48 this->value.Int = 0; 49 49 break; 50 50 case MT_FLOAT: 51 51 this->value.Float = 0.0f; 52 52 break; 53 53 case MT_CHAR: 54 54 this->value.Char = '\0'; 55 55 break; 56 56 case MT_STRING: 57 57 this->storedString = ""; 58 58 break; … … 148 148 switch (this->type) 149 149 { 150 150 case MT_NULL: 151 151 return true; 152 152 case MT_BOOL: 153 153 return (this->value.Bool == mt.value.Bool); 154 154 case MT_INT: 155 155 return (this->value.Int == mt.value.Int); 156 156 case MT_CHAR: 157 157 return (this->value.Char == mt.value.Char); 158 158 case MT_FLOAT: 159 159 return (this->value.Float == mt.value.Float); 160 160 case MT_STRING: 161 161 return (this->storedString == mt.storedString); 162 162 } … … 175 175 switch (type) 176 176 { 177 177 case MT_BOOL: 178 178 this->setBool(this->getBool()); 179 179 break; 180 180 case MT_INT: 181 181 this->setInt(this->getInt()); 182 182 break; 183 183 case MT_FLOAT: 184 184 this->setFloat(this->getFloat()); 185 185 break; 186 186 case MT_CHAR: 187 187 this->setChar(this->getChar()); 188 188 break; 189 189 case MT_STRING: 190 190 this->setString(this->getString()); 191 191 break; … … 381 381 } 382 382 383 /** 384 * @brief returns a Constant string (actually this is slower than getString() 385 * @returns a constant string of the stored version's one. 386 * @note this could lead to a inconsistency of data 387 */ 383 388 const std::string& MultiType::getConstString() const 384 389 { 390 385 391 MultiType::constString = this->getString(); 386 392 return MultiType::constString; … … 429 435 switch ( this->type ) 430 436 { 431 437 case MT_BOOL: 432 438 this->setBool(false); 433 439 break; 434 440 case MT_INT: 435 441 this->setInt(0); 436 442 break; 437 443 case MT_FLOAT: 438 444 this->setFloat(0.0f); 439 445 break; 440 446 case MT_CHAR: 441 447 this->setChar('\0'); 442 448 break; 443 449 case MT_STRING: 444 450 this->setString(""); 445 451 break; 446 452 default: 447 453 #ifdef DEBUG 448 454 PRINTF(2)("Unknown Type not reseting\n"); … … 461 467 switch ( type ) 462 468 { 463 469 case MT_BOOL: 464 470 return MultiType::typeNames[1]; 465 471 case MT_INT: 466 472 return MultiType::typeNames[2]; 467 473 case MT_FLOAT: 468 474 return MultiType::typeNames[3]; 469 475 case MT_CHAR: 470 476 return MultiType::typeNames[4]; 471 477 case MT_STRING: 472 478 return MultiType::typeNames[5]; 473 479 }
Note: See TracChangeset
for help on using the changeset viewer.