Changeset 8518 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Jun 16, 2006, 10:23:05 AM (19 years ago)
- Location:
- trunk/src/lib
- Files:
-
- 10 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/graphics_engine.cc
r8490 r8518 405 405 this->setResolution(this->resolutionX, this->resolutionY, this->bitsPerPixel); 406 406 } 407 408 void GraphicsEngine::toggleFullscreen() 409 { 410 if (this->fullscreenFlag == SDL_FULLSCREEN) 411 this->fullscreenFlag = 0; 412 else 413 this->fullscreenFlag = SDL_FULLSCREEN; 414 this->setResolution(this->resolutionX, this->resolutionY, this->bitsPerPixel); 415 } 416 407 417 408 418 /** -
trunk/src/lib/graphics/graphics_engine.h
r8490 r8518 44 44 int setResolution(int width, int height, int bpp); 45 45 void setFullscreen(bool fullscreen = false); 46 void toggleFullscreen(); 46 47 static void setBackgroundColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha = 1.0); 47 48 -
trunk/src/lib/graphics/text_engine/text.cc
r8448 r8518 159 159 } 160 160 161 162 /** 163 * @brief clears the Text Line (empies it). 164 */ 165 void Text::clear() 166 { 167 text.clear(); 168 this->setupTextWidth(); 169 } 161 170 162 171 /** -
trunk/src/lib/graphics/text_engine/text.h
r8448 r8518 40 40 const std::string& operator<<(const std::string& appendText); 41 41 void removeCharacters(unsigned int chars); 42 void clear(); 42 43 43 44 /// SETUP -
trunk/src/lib/gui/gl/Makefile.am
r8145 r8518 29 29 glgui_image.cc \ 30 30 glgui_window.cc \ 31 glgui_cursor.cc 31 glgui_cursor.cc \ 32 \ 33 specials/glgui_notifier.cc 32 34 33 35 … … 54 56 glgui_image.h \ 55 57 glgui_window.h \ 56 glgui_cursor.h 58 glgui_cursor.h \ 59 \ 60 specials/glgui_notifier.h 61 57 62 58 63 -
trunk/src/lib/gui/gl/glgui_inputline.cc
r8448 r8518 48 48 this->setFocusable(true); 49 49 50 this->_clearOnEnter = false; 50 51 this->_text.setParent2D(this); 51 52 this->_text.setRelCoor2D(4,4); … … 100 101 } 101 102 103 void GLGuiInputLine::clear() 104 { 105 this->_text.clear(); 106 this->changedText(); 107 } 108 102 109 /** 103 110 * @brief If the Text has been changed this function is called. … … 124 131 } 125 132 133 /** 134 * @brief handles the EnterPush-Event. 135 * 136 * Emmits th EnterPushed Signal with the current Line, 137 * and if _clearOnEnter is pushed clears the Line. 138 */ 139 void GLGuiInputLine::pushEnter() 140 { 141 emit(this->enterPushed(this->_text.getText())); 142 if (this->_clearOnEnter) 143 this->clear(); 144 } 145 126 146 127 147 /** … … 140 160 this->pressedKeyName = SDLK_BACKSPACE; 141 161 this->removeCharacters(1); 162 return true; 163 } 164 else if(event.type == SDLK_RETURN || event.type == SDLK_KP_ENTER) 165 { 166 this->pushEnter(); 142 167 return true; 143 168 } -
trunk/src/lib/gui/gl/glgui_inputline.h
r8448 r8518 38 38 void appendCharacter(char character); 39 39 void removeCharacters(unsigned int chars); 40 void clear(); 41 42 void clearOnEnter(bool clear = true) { this->_clearOnEnter = clear; }; 40 43 41 44 virtual void removedFocus(); … … 47 50 48 51 DeclareSignal1(textChanged, const std::string&); 52 DeclareSignal1(enterPushed, const std::string&); 49 53 50 54 protected: … … 57 61 private: 58 62 void init(); 63 void pushEnter(); 59 64 void changedText(); 65 60 66 61 67 private: 62 68 Text _text; //!< The Text to display inside of the InputLine. 69 bool _clearOnEnter; //!< Clear on Enter 63 70 64 71 Uint16 pressedKey; //!< the pressed key that will be repeated. -
trunk/src/lib/gui/gl/glgui_style.cc
r8450 r8518 29 29 GLGuiStyle::GLGuiStyle (const TiXmlElement* root) 30 30 { 31 _font = NULL; 32 this->reset(); 33 34 31 35 if (root != NULL) 32 36 this->loadParams(root); … … 43 47 } 44 48 49 void GLGuiStyle::reset() 50 { 51 this->setBorderLeft(1.0); 52 this->setBorderRight(1.0); 53 this->setBorderTop(1.0); 54 this->setBorderBottom(1.0); 55 56 this->setTextSize(20.0); 57 this->setBackgroundColor(1.0); 58 this->setForegroundColor(1.0); 59 60 this->setFeaturePosition(FeatureLeft); 61 this->setFont(NULL); 62 63 this->setAnimated(true); 64 this->setAnimatedStateChanges(true); 65 } 66 45 67 void GLGuiStyle::loadParams(const TiXmlElement* root) 46 { 47 } 68 {} 48 69 49 70 void GLGuiStyle::setBorderLeft(float value) … … 54 75 55 76 void GLGuiStyle::setBorderLeft(float value, OrxGui::State state) 56 {} 77 { 78 _style[state]._borderLeft = value; 79 } 57 80 58 81 void GLGuiStyle::setBorderLeftS(float value, const std::string& state) 59 {} 82 { 83 } 60 84 61 85 … … 67 91 68 92 void GLGuiStyle::setBorderRight(float value, OrxGui::State state) 69 {} 93 { 94 _style[state]._borderRight = value; 95 } 70 96 71 97 void GLGuiStyle::setBorderRightS(float value, const std::string& state) … … 80 106 81 107 void GLGuiStyle::setBorderTop(float value, OrxGui::State state) 82 {} 108 { 109 _style[state]._borderTop = value; 110 } 83 111 84 112 void GLGuiStyle::setBorderTopS(float value, const std::string& state) … … 93 121 94 122 void GLGuiStyle::setBorderBottom(float value, OrxGui::State state) 95 {} 123 { 124 _style[state]._borderBottom = value; 125 } 96 126 97 127 void GLGuiStyle::setBorderBottomS(float value, const std::string& state) … … 106 136 107 137 void GLGuiStyle::setTextSize(float value, OrxGui::State state) 108 {} 138 { 139 _style[state]._textSize = value; 140 } 109 141 110 142 void GLGuiStyle::setTextSizeS(float value, const std::string& state) … … 119 151 120 152 void GLGuiStyle::setBackgroundColor(const Color& color, OrxGui::State state) 121 {} 153 { 154 _style[state]._backgroundColor = color; 155 } 122 156 123 157 void GLGuiStyle::setBackgroundColorS(float r, float g, float b, float a, const std::string& state) … … 132 166 133 167 void GLGuiStyle::setBackgroundTexture(const Texture& texture, OrxGui::State state) 134 {} 168 { 169 _style[state]._backgroundTexture = texture; 170 } 135 171 136 172 void GLGuiStyle::setBackgroundTexture(const std::string& textureName, const std::string& state) … … 145 181 146 182 void GLGuiStyle::setForegroundColor(const Color& color, OrxGui::State state) 147 {} 183 { 184 _style[state]._foregroundColor = color; 185 } 148 186 149 187 void GLGuiStyle::setForegroundColorS(float r, float g, float b, float a, const std::string& state) … … 158 196 159 197 void GLGuiStyle::setFeaturePosition(const std::string& featurePosition) 160 { 161 162 } 198 {} 163 199 164 200 … … 179 215 } 180 216 181 void GLGuiStyle:: animatedStateChanges(bool animated)217 void GLGuiStyle::setAnimatedStateChanges(bool animated) 182 218 { 183 219 this->_animatedStateChanges = animated; -
trunk/src/lib/gui/gl/glgui_style.h
r8448 r8518 43 43 44 44 /// SETUP 45 void reset(); 45 46 void loadParams(const TiXmlElement* root); 46 47 … … 85 86 86 87 void setAnimated(bool animated); 87 void animatedStateChanges(bool animated);88 void setAnimatedStateChanges(bool animated); 88 89 89 90 private: -
trunk/src/lib/gui/gl/glgui_widget.h
r8448 r8518 66 66 void disconnect(GLGuiWidget* sender, Signal& signal, BaseObject* receiver); 67 67 68 69 GLGuiStyle& style() { return this->_style; }; 70 const GLGuiStyle style() const { return this->_style; }; 68 71 69 72 /// MATERIAL (looks)
Note: See TracChangeset
for help on using the changeset viewer.