Changeset 8598 in orxonox.OLD for branches/gui/src/lib/gui/gl/glgui_slider.cc
- Timestamp:
- Jun 20, 2006, 1:45:44 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/gui/gl/glgui_slider.cc
r8584 r8598 74 74 else 75 75 this->_value = value; 76 this->_handle.setCenter(this->sliderPosition(), style().borderTop() + (this->getSizeY2D() - style().borderTop() - style().borderBottom()) / 2.0);76 this->_handle.setCenter(this->sliderPosition(), borderTop() + (this->getSizeY2D() - borderTop() - borderBottom()) / 2.0); 77 77 78 78 emit(valueChanged(this->_value)); … … 165 165 // this->frontRect().setTopLeft(this->borderLeft(), this->getSizeY2D()/2.0 - 2.0); 166 166 // this->frontRect().setSize(this->getSizeX2D() - borderLeft() - borderRight(), 4.0); 167 this->_slider.setTopLeft( style().borderLeft(), this->getSizeY2D() / 2.0 -2.0);168 this->_slider.setSize(this->getSizeX2D() - style().borderLeft() - style().borderRight(), 4.0);169 this->_handle.setSize(this->_sliderWidth, this->getSizeY2D() - style().borderTop() - style().borderBottom());167 this->_slider.setTopLeft(borderLeft(), this->getSizeY2D() / 2.0 -2.0); 168 this->_slider.setSize(this->getSizeX2D() - borderLeft() - borderRight(), 4.0); 169 this->_handle.setSize(this->_sliderWidth, this->getSizeY2D() - borderTop() - borderBottom()); 170 170 } 171 171 … … 211 211 { 212 212 return (this->_value - this->_minValue)/( this->_maxValue - this->_minValue) * 213 (this->getSizeX2D() - ( style().borderLeft() + style().borderRight() + 2.0*_sliderWidth)) +214 ( style().borderLeft() +_sliderWidth);213 (this->getSizeX2D() - (borderLeft() + borderRight() + 2.0*_sliderWidth)) + 214 (borderLeft() +_sliderWidth); 215 215 } 216 216 … … 221 221 float GLGuiSlider::sliderValue(float position) const 222 222 { 223 return (position - ( style().borderLeft()+_sliderWidth)) / (this->getSizeX2D() - (style().borderLeft() + style().borderRight() + 2.0*_sliderWidth))223 return (position - (borderLeft()+_sliderWidth)) / (this->getSizeX2D() - (borderLeft() + borderRight() + 2.0*_sliderWidth)) 224 224 *( this->_maxValue - this->_minValue) + 225 225 this->_minValue ; … … 239 239 GLGuiWidget::draw(); 240 240 241 glColor4fv(&this-> style().foregroundColor()[0]);241 glColor4fv(&this->foregroundColor()[0]); 242 242 this->drawRect(this->_slider); 243 243 this->drawRect(this->_handle);
Note: See TracChangeset
for help on using the changeset viewer.