Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8448 in orxonox.OLD for trunk/src/lib/gui/gl/glgui_inputline.cc


Ignore:
Timestamp:
Jun 15, 2006, 12:48:26 PM (18 years ago)
Author:
bensch
Message:

merged gui back to the trunk
merged with command
merge -r8377:HEAD https://svn.orxonox.net/orxonox/branches/gui .

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/gui/gl/glgui_inputline.cc

    r8145 r8448  
    2222  /**
    2323   * @brief standard constructor
    24   */
     24   */
    2525  GLGuiInputLine::GLGuiInputLine ()
    2626  {
     
    4848    this->setFocusable(true);
    4949
    50     this->text.setParent2D(this);
    51     this->text.setRelCoor2D(4,4);
    52     this->text.setFont("fonts/final_frontier.ttf", 20);
    53     this->text.setVisibility(false);
     50    this->_text.setParent2D(this);
     51    this->_text.setRelCoor2D(4,4);
     52    this->_text.setFont("fonts/final_frontier.ttf", 20);
     53    this->_text.setColor(this->frontColor());
     54    this->_text.setVisibility(false);
    5455    this->resize();
    5556
     
    6364  void GLGuiInputLine::setText(const std::string& text)
    6465  {
    65     this->text.setText(text);
    66     this->resize();
    67 
    68     emit(this->textChanged(this->getText()));
     66    this->_text.setText(text);
     67    this->changedText();
    6968  }
    7069
     
    7574  void GLGuiInputLine::append(const std::string& appendText)
    7675  {
    77     this->text.append(appendText);
    78     this->resize();
    79     emit(this->textChanged(this->text.getText()));
     76    this->_text.append(appendText);
     77    this->changedText();
    8078  }
    8179
     
    8785  void GLGuiInputLine::appendCharacter(char character)
    8886  {
    89     this->text.appendCharacter(character);
    90     this->resize();
    91     emit(this->textChanged(this->text.getText()));
     87    this->_text.appendCharacter(character);
     88    this->changedText();
    9289  }
    9390
     
    9996  void GLGuiInputLine::removeCharacters(unsigned int chars)
    10097  {
    101     this->text.removeCharacters(chars);
     98    this->_text.removeCharacters(chars);
     99    this->changedText();
     100  }
     101
     102  /**
     103   * @brief If the Text has been changed this function is called.
     104   *
     105   * This Function also emits the Signal textChanged.
     106   */
     107  void GLGuiInputLine::changedText()
     108  {
    102109    this->resize();
    103     emit(this->textChanged(this->text.getText()));
     110    this->setFrontColor(Color(1,1,1,1), true);
     111    this->setFrontColor(Color(0,1,0,1));
     112    emit(this->textChanged(this->_text.getText()));
    104113  }
    105114
     
    117126
    118127  /**
    119    * Processes an Event.
     128   * @brief Processes an Event.
    120129   * @param event The event to be processed
    121130   * @return true if the event was catched.
     
    154163      }
    155164    }
    156 
    157165    return false;
    158166  }
     
    164172  void GLGuiInputLine::resize()
    165173  {
    166     this->text.setRelCoor2D(this->borderLeft() + 2.0,this->borderTop() + 2.0);
    167     this->setSize2D( this->text.getSize2D() + Vector2D(borderLeft() + borderRight() + 4.0, borderTop() + borderBottom() + 4.0));
     174    this->_text.setRelCoor2D(this->borderLeft(), this->borderTop());
     175    this->setSize2D( this->_text.getSize2D() + Vector2D(borderLeft() + borderRight(), borderTop() + borderBottom()));
    168176    GLGuiWidget::resize();
    169     this->frontRect().setTopLeft(borderLeft(), borderTop());
    170     this->frontRect().setSize(this->getSize2D() - Vector2D(borderLeft() + borderRight(), borderTop() + borderBottom()));
    171   }
    172 
     177/*    this->frontRect().setTopLeft(borderLeft(), borderTop());
     178    this->frontRect().setSize(this->getSize2D() - Vector2D(borderLeft() + borderRight(), borderTop() + borderBottom()));*/
     179  }
     180
     181  void GLGuiInputLine::updateFrontColor()
     182  {
     183    this->_text.setColor(this->frontColor());
     184  }
    173185
    174186  void GLGuiInputLine::hiding()
    175187  {
    176     this->text.setVisibility(false);
     188    this->_text.setVisibility(false);
    177189  }
    178190
    179191  void GLGuiInputLine::showing()
    180192  {
    181     this->text.setVisibility(true);
    182   }
    183 
    184 
    185   /**
    186    * ticks the InputLine
     193    this->_text.setVisibility(true);
     194  }
     195
     196  /**
     197   * @brief ticks the InputLine
    187198   * @param dt the time passed.
    188199   */
    189200  void GLGuiInputLine::tick(float dt)
    190201  {
     202    GLGuiWidget::tick(dt);
    191203    if (this->delayNext > 0.0)
    192204      this->delayNext -= dt;
     
    218230    GLGuiWidget::draw();
    219231
    220     this->frontMaterial().select();
    221     GLGuiWidget::drawRect(this->frontRect());
     232//     this->frontMaterial().select();
     233//     GLGuiWidget::drawRect(this->frontRect());
    222234
    223235    this->endDraw();
Note: See TracChangeset for help on using the changeset viewer.