Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7936 in orxonox.OLD


Ignore:
Timestamp:
May 28, 2006, 10:16:49 PM (18 years ago)
Author:
bensch
Message:

gui: new parameter borderSize

Location:
branches/gui/src/lib/gui/gl_gui
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/gui/gl_gui/glgui_checkbutton.cc

    r7929 r7936  
    6363    this->setSize2D(this->label.getSizeX2D() + 30, this->label.getSizeY2D() + 10);
    6464    GLGuiWidget::resize();
    65     this->frontRect().setTopLeft(1, 1);
    66     this->frontRect().setSize(this->getSizeX2D() -2, this->getSizeY2D() -2);
     65    this->frontRect().setTopLeft(borderSize(), borderSize());
     66    this->frontRect().setSize(this->getSizeX2D() -2.0*borderSize(), this->getSizeY2D() -2.0*borderSize());
    6767  }
    6868
  • branches/gui/src/lib/gui/gl_gui/glgui_inputline.cc

    r7928 r7936  
    130130    this->setSize2D( this->text.getSize2D() + Vector2D(8, 8));
    131131    GLGuiWidget::resize();
    132     this->frontRect().setTopLeft(1,1);
    133     this->frontRect().setSize(this->getSize2D() - Vector2D(2,2));
     132    this->frontRect().setTopLeft(borderSize(), borderSize());
     133    this->frontRect().setSize(this->getSize2D() - Vector2D(borderSize(), borderSize()));
    134134  }
    135135
  • branches/gui/src/lib/gui/gl_gui/glgui_slider.cc

    r7931 r7936  
    112112  {
    113113    GLGuiWidget::resize();
    114     this->frontRect().setTopLeft(5, this->getSizeY2D()/2.0 - 1.0);
    115     this->frontRect().setSize(this->getSizeX2D() - 10.0, 5);
     114    this->frontRect().setTopLeft(5, this->getSizeY2D()/2.0 - borderSize());
     115    this->frontRect().setSize(this->getSizeX2D() - 10.0, borderSize());
    116116  }
    117117
     
    176176    this->drawRect(this->frontRect());
    177177
    178     this->drawRect(Rect2D(this->sliderPosition()-_sliderWidth/2.0, 2, _sliderWidth, this->getSizeY2D() - 4));
     178    this->drawRect(Rect2D(this->sliderPosition()-_sliderWidth/2.0, borderSize(), _sliderWidth, this->getSizeY2D() - 2 * borderSize()));
    179179
    180180    this->endDraw();
  • branches/gui/src/lib/gui/gl_gui/glgui_widget.cc

    r7929 r7936  
    6868    this->_backMat.setDiffuse(1.0, 1.0, 1.0);
    6969    this->_frontMat.setDiffuse(1.0, 0.0, 0.0);
     70    this->_borderSize = 1.0;
    7071
    7172    this->widgetSignals.resize(SignalCount, SignalConnector());
     
    105106
    106107
     108  void GLGuiWidget::setBorderSize(float borderSize)
     109  {
     110    this->_borderSize = borderSize;
     111    this->resize();
     112  }
     113
     114
    107115  void GLGuiWidget::resize()
    108116  {
  • branches/gui/src/lib/gui/gl_gui/glgui_widget.h

    r7929 r7936  
    100100    const Rect2D& frontRect() const { return this->_frontRect; };
    101101
     102    float borderSize() const { return this->_borderSize; };
     103    void setBorderSize(float borderSize);
     104
    102105    inline void drawRect(const Rect2D& rect) const {
    103106      glBegin(GL_QUADS);
     
    150153    Rect2D                         _frontRect;
    151154
     155    float                          _borderSize;
    152156
    153157    /// SIGNALS
Note: See TracChangeset for help on using the changeset viewer.