Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8421 in orxonox.OLD for branches


Ignore:
Timestamp:
Jun 14, 2006, 11:32:14 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: more widgets updated

Location:
branches/gui/src/lib
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/event/event_handler.cc

    r8340 r8421  
    355355  else
    356356  {
    357     SDL_WM_GrabInput(SDL_GRAB_ON);
     357//    SDL_WM_GrabInput(SDL_GRAB_ON);
    358358    SDL_ShowCursor(SDL_DISABLE);
    359359  }
  • branches/gui/src/lib/gui/gl/glgui_inputline.cc

    r8419 r8421  
    154154      }
    155155    }
    156 
    157156    return false;
    158157  }
  • branches/gui/src/lib/gui/gl/glgui_slider.cc

    r8378 r8421  
    7474    else
    7575      this->_value = value;
     76    this->_handle.setCenter(this->sliderPosition(), this->borderTop() + (this->getSizeY2D() - this->borderTop() - borderBottom()) / 2.0);
     77
    7678    emit(valueChanged(this->_value));
    7779  }
     
    161163  {
    162164    GLGuiWidget::resize();
    163 /*    this->frontRect().setTopLeft(this->borderLeft(), this->getSizeY2D()/2.0 - 2.0);
    164     this->frontRect().setSize(this->getSizeX2D() - borderLeft() - borderRight(), 4.0);*/
     165//    this->frontRect().setTopLeft(this->borderLeft(), this->getSizeY2D()/2.0 - 2.0);
     166//    this->frontRect().setSize(this->getSizeX2D() - borderLeft() - borderRight(), 4.0);
     167    this->_slider.setTopLeft(this->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  }
     171
     172  void GLGuiSlider::updateFrontColor()
     173  {
     174
    165175  }
    166176
     
    228238    GLGuiWidget::draw();
    229239
    230     //this->frontMaterial().select();
    231 //     this->drawRect(this->frontRect());
    232 
    233     this->drawRect(Rect2D(this->sliderPosition()-_sliderWidth/2.0, 0*this->borderTop(), _sliderWidth, this->getSizeY2D() - (borderTop() + borderBottom()) ));
     240    glColor4fv(&this->frontColor()[0]);
     241    this->drawRect(this->_slider);
     242    this->drawRect(this->_handle);
     243    //this->drawRect(Rect2D(this->sliderPosition()-_sliderWidth/2.0, 0*this->borderTop(), _sliderWidth, this->getSizeY2D() - (borderTop() + borderBottom()) ));
    234244
    235245    this->endDraw();
  • branches/gui/src/lib/gui/gl/glgui_slider.h

    r8145 r8421  
    5656  protected:
    5757    virtual void resize();
     58    virtual void updateFrontColor();
    5859
    5960    virtual void clicking(const Vector2D& pos);
     
    6869  private:
    6970    Orientation      orientation;
     71
     72    Rect2D           _slider;
     73    Rect2D           _handle;
    7074
    7175    float            _maxValue;
  • branches/gui/src/lib/math/rect2D.cc

    r8145 r8421  
    232232
    233233/**
     234 * @brief sets the new Center
     235 * @param x the center's X to move the Rectangle to.
     236 * @param y the center's Y to move the Rectangle to.
     237 * moves the Rectangle from its current center to the new Center
     238 */
     239void Rect2D::setCenter(float x, float y)
     240{
     241  this->setCenter(Vector2D(x, y));
     242}
     243
     244/**
     245 * @brief sets the new Center
     246 * @param center the center to move the Rectangle to.
     247 * moves the Rectangle from its current center to the new Center
     248 */
     249void Rect2D::setCenterX(float x)
     250{
     251#warning implement this
     252}
     253
     254/**
     255 * @brief sets the new Center
     256 * @param center the center to move the Rectangle to.
     257 * moves the Rectangle from its current center to the new Center
     258 */
     259void Rect2D::setCenterY(float y)
     260{
     261#warning implement this
     262}
     263
     264/**
    234265 * @brief scales the Rectangle from topLeft out.
    235266 * @param x: the scale factor in x direction
  • branches/gui/src/lib/math/rect2D.h

    r8035 r8421  
    9696  void setSize(const Vector2D& size);
    9797  void setCenter(const Vector2D& center);
     98  void setCenter(float x, float y);
     99  void setCenterX(float x);
     100  void setCenterY(float y);
     101
    98102
    99103  void scaleX(float x);
Note: See TracChangeset for help on using the changeset viewer.