Changeset 7928 in orxonox.OLD for branches/gui/src
- Timestamp:
- May 28, 2006, 6:50:55 PM (19 years ago)
- Location:
- branches/gui/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/event/event_handler.cc
r7925 r7928 474 474 { 475 475 EventHandler::getInstance()->grabEvents( true); 476 return 0;476 return 1; 477 477 } 478 478 } -
branches/gui/src/lib/gui/gl_gui/glgui.h
r7924 r7928 18 18 //#include "glgui_colorselector.h" 19 19 #include "glgui_pushbutton.h" 20 #include "glgui_slider.h" 20 21 #include "glgui_cursor.h" 21 22 #include "glgui_inputline.h" -
branches/gui/src/lib/gui/gl_gui/glgui_bar.cc
r7919 r7928 60 60 void GLGuiBar::draw() const 61 61 { 62 this-> startDraw();62 this->beginDraw(); 63 63 64 64 GLGuiWidget::draw(); -
branches/gui/src/lib/gui/gl_gui/glgui_checkbutton.cc
r7925 r7928 82 82 void GLGuiCheckButton::draw() const 83 83 { 84 this-> startDraw();84 this->beginDraw(); 85 85 GLGuiButton::draw(); 86 86 -
branches/gui/src/lib/gui/gl_gui/glgui_cursor.cc
r7925 r7928 89 89 90 90 91 this->setAbsCoor Soft2D(newPos, 20);91 this->setAbsCoor2D(newPos); 92 92 movement = Vector2D(); 93 93 } … … 99 99 void GLGuiCursor::draw() const 100 100 { 101 this-> startDraw();101 this->beginDraw(); 102 102 GLGuiWidget::draw(); 103 103 this->endDraw(); -
branches/gui/src/lib/gui/gl_gui/glgui_inputline.cc
r7926 r7928 163 163 void GLGuiInputLine::draw() const 164 164 { 165 this-> startDraw();165 this->beginDraw(); 166 166 GLGuiWidget::draw(); 167 167 -
branches/gui/src/lib/gui/gl_gui/glgui_pushbutton.cc
r7926 r7928 94 94 void GLGuiPushButton::draw() const 95 95 { 96 this-> startDraw();96 this->beginDraw(); 97 97 GLGuiButton::draw(); 98 98 -
branches/gui/src/lib/gui/gl_gui/glgui_slider.cc
r7919 r7928 44 44 { 45 45 this->setClassID(CL_GLGUI_SLIDER, "GLGuiSlider"); 46 this->_value = 0.0; 47 this->_minValue = 0.0; 48 this->_maxValue = 1.0; 49 this->_step = 0.1; 46 50 51 this->setSize2D(100, 30); 52 this->resize(); 53 } 54 55 56 void GLGuiSlider::setValue(float value) 57 { 58 this->_value = value; 59 } 60 61 void GLGuiSlider::setMin(float minimum) 62 { 63 this->_minValue = minimum; 64 } 65 66 void GLGuiSlider::setMax(float maximum) 67 { 68 this->_maxValue = maximum; 69 } 70 71 void GLGuiSlider::setRange(float minimum, float maximum) 72 { 73 this->_minValue = minimum; 74 this->_maxValue = maximum; 75 } 76 77 void GLGuiSlider::setStep(float step) 78 { 79 this->_step = step; 80 } 81 82 83 void GLGuiSlider::resize() 84 { 85 GLGuiWidget::resize(); 86 this->frontRect().setTopLeft(5, this->getSizeY2D()/2.0 - 1.0); 87 this->frontRect().setSize(this->getSizeX2D() - 10.0, 5); 47 88 } 48 89 49 90 /** 50 * draws the GLGuiSlider91 * @brief draws the GLGuiSlider 51 92 */ 52 93 void GLGuiSlider::draw() const 53 94 { 95 this->beginDraw(); 96 GLGuiWidget::draw(); 97 98 this->frontMaterial().select(); 99 this->drawRect(this->frontRect()); 100 101 float percentagePosition = (this->_value - this->_minValue)/( this->_maxValue - this->_minValue); 102 103 this->drawRect(Rect2D(percentagePosition* this->getSizeX2D(), 2, 5, this->getSizeY2D() - 4)); 104 105 this->endDraw(); 54 106 } 55 107 } -
branches/gui/src/lib/gui/gl_gui/glgui_slider.h
r7924 r7928 45 45 46 46 virtual void draw() const; 47 protected: 48 void resize(); 47 49 48 50 private: 49 51 void init(); 50 52 private: 51 53 52 54 Orientation orientation; -
branches/gui/src/lib/gui/gl_gui/glgui_widget.h
r7925 r7928 135 135 136 136 137 inline void startDraw() const { glPushMatrix(); glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0); };137 inline void beginDraw() const { glPushMatrix(); glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0); }; 138 138 inline void endDraw() const { glPopMatrix(); }; 139 139 -
branches/gui/src/story_entities/simple_game_menu.cc
r7925 r7928 100 100 input->setAbsCoor2D(200, 230); 101 101 102 OrxGui::GLGuiSlider* slider = new OrxGui::GLGuiSlider(); 103 slider->setRange(1, 10); 104 slider->setValue(5.0); 105 slider->show(); 106 slider->setAbsCoor2D(200, 270); 102 107 103 108 /////
Note: See TracChangeset
for help on using the changeset viewer.