Changeset 7893 in orxonox.OLD for branches/gui/src
- Timestamp:
- May 27, 2006, 4:07:35 AM (19 years ago)
- Location:
- branches/gui/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/graphics/text_engine/text.cc
r7892 r7893 126 126 this->setupTextWidth(); 127 127 } 128 129 /** 130 * @brief appends one Character to the String. 131 */ 132 void Text::appendCharacter(char character) 133 { 134 this->text += character; 135 this->setupTextWidth(); 136 } 137 128 138 129 139 /** -
branches/gui/src/lib/graphics/text_engine/text.h
r7892 r7893 37 37 void setText(const std::string& text); 38 38 void append(const std::string& appendText); 39 void appendCharacter(char character); 39 40 const std::string& operator<<(const std::string& appendText); 40 41 void removeCharacters(unsigned int chars); -
branches/gui/src/lib/gui/gl_gui/glgui_handler.cc
r7885 r7893 104 104 } 105 105 106 if (GLGuiWidget::focused()) 107 { 108 GLGuiWidget::focused()->processEvent(event); 109 } 110 106 111 } 107 112 -
branches/gui/src/lib/gui/gl_gui/glgui_inputline.cc
r7892 r7893 43 43 { 44 44 this->setClassID(CL_GLGUI_INPUTLINE, "GLGuiInputLine"); 45 46 this->setFocusable(true); 47 this->setClickable(true); 48 45 49 this->text.setParent2D(this); 46 50 this->text.setFont("fonts/final_frontier.ttf", 20); … … 48 52 this->setText("SUPERTEST"); 49 53 this->setSize2D( this->text.getSize2D()); 50 51 54 } 52 55 … … 59 62 { 60 63 this->text.append(appendText); 64 } 61 65 66 void GLGuiInputLine::appendCharacter(char character) 67 { 68 this->text.appendCharacter(character); 62 69 } 70 63 71 64 72 void GLGuiInputLine::removeCharacters(unsigned int chars) … … 67 75 } 68 76 77 bool GLGuiInputLine::processEvent(const Event& event) 78 { 79 if (likely(event.type < 127)) 80 { 81 this->appendCharacter(event.x); 82 return true; 83 } 84 85 return false; 86 } 69 87 70 88 -
branches/gui/src/lib/gui/gl_gui/glgui_inputline.h
r7892 r7893 10 10 #include "glgui_widget.h" 11 11 #include "text.h" 12 12 #include "event.h" 13 13 14 14 // FORWARD DECLARATION … … 31 31 void setText(const std::string& text); 32 32 void append(const std::string& appendText); 33 void appendCharacter(char character); 33 34 void removeCharacters(unsigned int chars); 34 35 const std::string& getName() const { return this->text.getText(); }; 35 36 36 37 virtual void draw() const; 38 39 virtual bool processEvent(const Event& event); 37 40 38 41 private: -
branches/gui/src/lib/gui/gl_gui/glgui_widget.cc
r7887 r7893 41 41 GLGuiWidget::~GLGuiWidget() 42 42 { 43 if (this == GLGuiWidget::_focused) 44 GLGuiWidget::_focused = NULL; 43 45 } 44 46 -
branches/gui/src/lib/gui/gl_gui/glgui_widget.h
r7887 r7893 93 93 const Material& frontMaterial() const { return this->frontMat; }; 94 94 95 95 /** @param the Event to process. @returns true if the Event has been consumed*/ 96 virtual bool processEvent(const Event& event) { }; 96 97 97 98 -
branches/gui/src/story_entities/simple_game_menu.cc
r7892 r7893 81 81 OrxGui::GLGuiInputLine* input = new OrxGui::GLGuiInputLine(); 82 82 input->show(); 83 input->setAbsCoor2D(200, 230); 83 84 84 85 OrxGui::GLGuiHandler::getInstance()->activateCursor();
Note: See TracChangeset
for help on using the changeset viewer.