Changeset 7892 in orxonox.OLD for branches/gui
- Timestamp:
- May 27, 2006, 3:47:27 AM (19 years ago)
- Location:
- branches/gui/src
- Files:
-
- 9 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/defs/class_id.h
r7873 r7892 332 332 CL_GLGUI_BAR = 0x00000b30, 333 333 CL_GLGUI_CURSOR = 0x00000b50, 334 CL_GLGUI_INPUTLINE = 0x00000b60, 335 CL_GLGUI_TEXTFIELD = 0x00000b61, 334 336 335 337 // QT_GUI -
branches/gui/src/lib/graphics/render2D/element_2d.h
r7874 r7892 126 126 127 127 inline void setSize2D(float x, float y) { this->size = Vector2D(x, y); }; 128 inline void setSize2D(const Vector2D& size) { this->size = size; }; 129 inline const Vector2D& getSize2D() const { return this->size; }; 128 130 void setSizeSoft2D(float x, float y, float bias = 1.0); 129 131 inline void setSizeX2D(float x) { this->size.x = x; }; -
branches/gui/src/lib/graphics/text_engine/text.cc
r7889 r7892 136 136 return this->text; 137 137 } 138 139 /** 140 * @brief removes char characters from the Text. 141 */ 142 void Text::removeCharacters(unsigned int chars) 143 { 144 this->text.resize(this->text.size()-chars); 145 } 146 138 147 139 148 /** -
branches/gui/src/lib/graphics/text_engine/text.h
r7753 r7892 38 38 void append(const std::string& appendText); 39 39 const std::string& operator<<(const std::string& appendText); 40 void removeCharacters(unsigned int chars); 40 41 41 42 /// SETUP -
branches/gui/src/lib/gui/gl_gui/Makefile.am
r7873 r7892 21 21 glgui_box.cc \ 22 22 glgui_frame.cc \ 23 glgui_inputline.cc \ 24 glgui_textfield.cc \ 23 25 glgui_window.cc \ 24 26 glgui_cursor.cc … … 38 40 glgui_box.h \ 39 41 glgui_frame.h \ 42 glgui_inputline.h \ 43 glgui_textfield.h \ 40 44 glgui_window.h \ 41 45 glgui_cursor.h -
branches/gui/src/lib/gui/gl_gui/glgui.h
r7880 r7892 18 18 #include "glgui_pushbutton.h" 19 19 #include "glgui_cursor.h" 20 #include "glgui_inputline.h" 21 #include "glgui_textfield.h" 20 22 21 23 namespace OrxGui -
branches/gui/src/lib/gui/gl_gui/glgui_inputline.cc
r7891 r7892 16 16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GUI 17 17 18 #include "glgui_text.h" 19 20 #include "text.h" 18 #include "glgui_inputline.h" 21 19 22 20 namespace OrxGui … … 25 23 * standard constructor 26 24 */ 27 GLGui Text::GLGuiText()25 GLGuiInputLine::GLGuiInputLine () 28 26 { 29 27 this->init(); … … 35 33 * standard deconstructor 36 34 */ 37 GLGui Text::~GLGuiText()35 GLGuiInputLine::~GLGuiInputLine() 38 36 { 39 37 } … … 42 40 * initializes the GUI-element 43 41 */ 44 void GLGui Text::init()42 void GLGuiInputLine::init() 45 43 { 46 this->setClassID(CL_GLGUI_, "GLGuiText"); 44 this->setClassID(CL_GLGUI_INPUTLINE, "GLGuiInputLine"); 45 this->text.setParent2D(this); 46 this->text.setFont("fonts/final_frontier.ttf", 20); 47 48 this->setText("SUPERTEST"); 49 this->setSize2D( this->text.getSize2D()); 47 50 48 51 } 49 52 53 void GLGuiInputLine::setText(const std::string& text) 54 { 55 this->text.setText(text); 56 } 57 58 void GLGuiInputLine::append(const std::string& appendText) 59 { 60 this->text.append(appendText); 61 62 } 63 64 void GLGuiInputLine::removeCharacters(unsigned int chars) 65 { 66 this->text.removeCharacters(chars); 67 } 68 69 70 50 71 /** 51 * draws the GLGui Text72 * draws the GLGuiInputLine 52 73 */ 53 void GLGui Text::draw()74 void GLGuiInputLine::draw() const 54 75 { 76 this->startDraw(); 77 GLGuiWidget::draw(); 78 79 this->frontMaterial().select(); 80 glBegin(GL_QUADS); 81 82 glTexCoord2i(0,0); glVertex2d(3, 3); 83 glTexCoord2i(0,1); glVertex2d(3, this->getSizeY2D() - 3); 84 glTexCoord2i(1,1); glVertex2d(this->getSizeX2D() - 3, this->getSizeY2D() -3); 85 glTexCoord2i(1,0); glVertex2d(this->getSizeX2D() - 3, 3); 86 87 glEnd(); 88 this->endDraw(); 55 89 } 56 90 } -
branches/gui/src/lib/gui/gl_gui/glgui_inputline.h
r7891 r7892 1 1 /*! 2 * @file glgui_ text.h3 * The gl_ TEXTwidget of th openglGUI2 * @file glgui_inputline.h 3 * The gl_INPUTLINE widget of th openglGUI 4 4 * 5 5 */ 6 6 7 #ifndef _GLGUI_ TEXT_H8 #define _GLGUI_ TEXT_H7 #ifndef _GLGUI_INPUTLINE_H 8 #define _GLGUI_INPUTLINE_H 9 9 10 10 #include "glgui_widget.h" 11 #include "text.h" 12 11 13 12 14 // FORWARD DECLARATION 13 class Text;14 15 namespace OrxGui 15 16 { … … 19 20 * 20 21 */ 21 class GLGui Text : public GLWidget22 class GLGuiInputLine : public OrxGui::GLGuiWidget 22 23 { 23 24 24 25 public: 25 GLGui Text();26 virtual ~GLGui Text();26 GLGuiInputLine(); 27 virtual ~GLGuiInputLine(); 27 28 28 29 void init(); 29 30 30 virtual void draw(); 31 void setText(const std::string& text); 32 void append(const std::string& appendText); 33 void removeCharacters(unsigned int chars); 34 const std::string& getName() const { return this->text.getText(); }; 35 36 virtual void draw() const; 31 37 32 38 private: 33 Text *text;39 Text text; 34 40 }; 35 41 } 36 42 37 #endif /* _GLGUI_ TEXT_H */43 #endif /* _GLGUI_INPUTLINE_H */ -
branches/gui/src/lib/gui/gl_gui/glgui_textfield.cc
r7779 r7892 16 16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GUI 17 17 18 #include "glgui_textfield _.h"18 #include "glgui_textfield.h" 19 19 namespace OrxGui 20 20 { … … 42 42 void GLGuiTextfield::init() 43 43 { 44 this->setClassID(CL_GLGUI_, "GLGuiTextfield"); 44 this->setClassID(CL_GLGUI_TEXTFIELD, "GLGuiTextfield"); 45 45 46 46 47 } … … 49 50 * draws the GLGuiTextfield 50 51 */ 51 void GLGuiTextfield::draw() 52 void GLGuiTextfield::draw() const 52 53 { 53 54 } -
branches/gui/src/lib/gui/gl_gui/glgui_textfield.h
r7779 r7892 9 9 10 10 #include "glgui_widget.h" 11 12 #include "text.h" 13 #include <vector> 11 14 12 15 // FORWARD DECLARATION … … 28 31 void init(); 29 32 30 virtual void draw(); 33 void process(const Event& event); 34 35 virtual void draw() const; 31 36 32 37 private: 33 std:: list<Text*>textLines;38 std::vector<Text> textLines; 34 39 35 40 }; -
branches/gui/src/story_entities/simple_game_menu.cc
r7886 r7892 78 78 rdnpb->setAbsCoor2D(200, 180); 79 79 rdnpb->connectSignal(OrxGui::Signal_release, this, createExecutor<SimpleGameMenu>(&SimpleGameMenu::quitMenu)); 80 81 OrxGui::GLGuiInputLine* input = new OrxGui::GLGuiInputLine(); 82 input->show(); 80 83 81 84 OrxGui::GLGuiHandler::getInstance()->activateCursor();
Note: See TracChangeset
for help on using the changeset viewer.