Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7995 in orxonox.OLD


Ignore:
Timestamp:
May 30, 2006, 10:16:09 PM (18 years ago)
Author:
bensch
Message:

gui: MultiType update and Cursor is better visible

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

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/gui/gl_gui/glgui_cursor.cc

    r7987 r7995  
    5959    this->backMaterial().setDiffuse(1.0,0.0,0.0);
    6060    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);
    6263    this->setAbsCoor2D(100, 100);
    6364    this->setLayer(E2D_LAYER_ABOVE_ALL);
  • branches/gui/src/lib/gui/gl_gui/glgui_slider.cc

    r7985 r7995  
    8585  {
    8686    if (minimum <= max())
     87    {
    8788      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());
    9193  }
    9294
     
    100102  {
    101103    if (maximum >= min())
     104    {
    102105      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());
    106110  }
    107111
     
    119123      this->_minValue = minimum;
    120124      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());
    126131  }
    127132
  • branches/gui/src/lib/gui/gl_gui/glgui_slider.h

    r7985 r7995  
    5252
    5353    DeclareSignal1(valueChanged, float);
     54    DeclareSignal2(rangeChanged, float, float);
    5455
    5556  protected:
  • branches/gui/src/lib/util/multi_type.cc

    r7994 r7995  
    3939  switch (this->type)
    4040  {
    41       default:
     41    default:
    4242      this->value.Float = 0.0f;
    4343      break;
    44       case MT_BOOL:
     44    case MT_BOOL:
    4545      this->value.Bool = false;
    4646      break;
    47       case MT_INT:
     47    case MT_INT:
    4848      this->value.Int = 0;
    4949      break;
    50       case MT_FLOAT:
     50    case MT_FLOAT:
    5151      this->value.Float = 0.0f;
    5252      break;
    53       case MT_CHAR:
     53    case MT_CHAR:
    5454      this->value.Char = '\0';
    5555      break;
    56       case MT_STRING:
     56    case MT_STRING:
    5757      this->storedString = "";
    5858      break;
     
    148148  switch (this->type)
    149149  {
    150       case MT_NULL:
     150    case MT_NULL:
    151151      return true;
    152       case MT_BOOL:
     152    case MT_BOOL:
    153153      return (this->value.Bool == mt.value.Bool);
    154       case MT_INT:
     154    case MT_INT:
    155155      return (this->value.Int == mt.value.Int);
    156       case MT_CHAR:
     156    case MT_CHAR:
    157157      return (this->value.Char == mt.value.Char);
    158       case MT_FLOAT:
     158    case MT_FLOAT:
    159159      return (this->value.Float == mt.value.Float);
    160       case MT_STRING:
     160    case MT_STRING:
    161161      return (this->storedString == mt.storedString);
    162162  }
     
    175175  switch (type)
    176176  {
    177       case MT_BOOL:
     177    case MT_BOOL:
    178178      this->setBool(this->getBool());
    179179      break;
    180       case MT_INT:
     180    case MT_INT:
    181181      this->setInt(this->getInt());
    182182      break;
    183       case MT_FLOAT:
     183    case MT_FLOAT:
    184184      this->setFloat(this->getFloat());
    185185      break;
    186       case MT_CHAR:
     186    case MT_CHAR:
    187187      this->setChar(this->getChar());
    188188      break;
    189       case MT_STRING:
     189    case MT_STRING:
    190190      this->setString(this->getString());
    191191      break;
     
    381381}
    382382
     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 */
    383388const std::string& MultiType::getConstString() const
    384389{
     390
    385391  MultiType::constString = this->getString();
    386392  return MultiType::constString;
     
    429435  switch ( this->type )
    430436  {
    431       case MT_BOOL:
     437    case MT_BOOL:
    432438      this->setBool(false);
    433439      break;
    434       case MT_INT:
     440    case MT_INT:
    435441      this->setInt(0);
    436442      break;
    437       case MT_FLOAT:
     443    case MT_FLOAT:
    438444      this->setFloat(0.0f);
    439445      break;
    440       case MT_CHAR:
     446    case MT_CHAR:
    441447      this->setChar('\0');
    442448      break;
    443       case MT_STRING:
     449    case MT_STRING:
    444450      this->setString("");
    445451      break;
    446       default:
     452    default:
    447453#ifdef DEBUG
    448454      PRINTF(2)("Unknown Type not reseting\n");
     
    461467  switch ( type )
    462468  {
    463       case MT_BOOL:
     469    case MT_BOOL:
    464470      return MultiType::typeNames[1];
    465       case MT_INT:
     471    case MT_INT:
    466472      return MultiType::typeNames[2];
    467       case MT_FLOAT:
     473    case MT_FLOAT:
    468474      return MultiType::typeNames[3];
    469       case MT_CHAR:
     475    case MT_CHAR:
    470476      return MultiType::typeNames[4];
    471       case MT_STRING:
     477    case MT_STRING:
    472478      return MultiType::typeNames[5];
    473479  }
Note: See TracChangeset for help on using the changeset viewer.