Changeset 8448 in orxonox.OLD for trunk/src/lib/gui/gl/glgui_inputline.cc
- Timestamp:
- Jun 15, 2006, 12:48:26 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/gui/gl/glgui_inputline.cc
r8145 r8448 22 22 /** 23 23 * @brief standard constructor 24 */24 */ 25 25 GLGuiInputLine::GLGuiInputLine () 26 26 { … … 48 48 this->setFocusable(true); 49 49 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); 54 55 this->resize(); 55 56 … … 63 64 void GLGuiInputLine::setText(const std::string& text) 64 65 { 65 this->text.setText(text); 66 this->resize(); 67 68 emit(this->textChanged(this->getText())); 66 this->_text.setText(text); 67 this->changedText(); 69 68 } 70 69 … … 75 74 void GLGuiInputLine::append(const std::string& appendText) 76 75 { 77 this->text.append(appendText); 78 this->resize(); 79 emit(this->textChanged(this->text.getText())); 76 this->_text.append(appendText); 77 this->changedText(); 80 78 } 81 79 … … 87 85 void GLGuiInputLine::appendCharacter(char character) 88 86 { 89 this->text.appendCharacter(character); 90 this->resize(); 91 emit(this->textChanged(this->text.getText())); 87 this->_text.appendCharacter(character); 88 this->changedText(); 92 89 } 93 90 … … 99 96 void GLGuiInputLine::removeCharacters(unsigned int chars) 100 97 { 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 { 102 109 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())); 104 113 } 105 114 … … 117 126 118 127 /** 119 * Processes an Event.128 * @brief Processes an Event. 120 129 * @param event The event to be processed 121 130 * @return true if the event was catched. … … 154 163 } 155 164 } 156 157 165 return false; 158 166 } … … 164 172 void GLGuiInputLine::resize() 165 173 { 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())); 168 176 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 } 173 185 174 186 void GLGuiInputLine::hiding() 175 187 { 176 this-> text.setVisibility(false);188 this->_text.setVisibility(false); 177 189 } 178 190 179 191 void GLGuiInputLine::showing() 180 192 { 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 187 198 * @param dt the time passed. 188 199 */ 189 200 void GLGuiInputLine::tick(float dt) 190 201 { 202 GLGuiWidget::tick(dt); 191 203 if (this->delayNext > 0.0) 192 204 this->delayNext -= dt; … … 218 230 GLGuiWidget::draw(); 219 231 220 this->frontMaterial().select();221 GLGuiWidget::drawRect(this->frontRect());232 // this->frontMaterial().select(); 233 // GLGuiWidget::drawRect(this->frontRect()); 222 234 223 235 this->endDraw();
Note: See TracChangeset
for help on using the changeset viewer.