Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8117 in orxonox.OLD for branches


Ignore:
Timestamp:
Jun 2, 2006, 11:50:17 AM (18 years ago)
Author:
bensch
Message:

gui: pretty good borders

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

    r8116 r8117  
    9696      glBegin(GL_QUADS);
    9797      glColor3f( 1, 1 ,1);
    98       glTexCoord2i(0,0); glVertex2d(8, 8);
    99       glTexCoord2i(0,1); glVertex2d(8, this->getSizeY2D()-8);
    100       glTexCoord2i(1,1); glVertex2d(this->getSizeY2D()-8, this->getSizeY2D()-8);
    101       glTexCoord2i(1,0); glVertex2d(this->getSizeY2D()-8, 8);
     98      glTexCoord2i(0,0); glVertex2d(borderLeft()+8, borderTop()+8);
     99      glTexCoord2i(0,1); glVertex2d(borderLeft() + 8, this->getSizeY2D()-8 - (borderTop() + borderBottom()));
     100      glTexCoord2i(1,1); glVertex2d(this->getSizeY2D()-8 +borderLeft(), this->getSizeY2D()-8- (borderTop() + borderBottom()));
     101      glTexCoord2i(1,0); glVertex2d(this->getSizeY2D()-8 +borderLeft(), borderTop()+8);
    102102      glEnd();
    103103
     
    107107      glLineWidth(3.0);
    108108      glBegin(GL_LINE_LOOP);
    109       glVertex2d(8,8);
    110       glVertex2d(this->getSizeY2D()/2, this->getSizeY2D()/2 - 1);
     109      glVertex2d(borderLeft()+8,borderTop() +8);
     110      glVertex2d(this->getSizeY2D()/2 + borderLeft(), this->getSizeY2D()/2 - 1);
    111111
    112       glVertex2d(this->getSizeY2D() -8, 8);
    113       glVertex2d(this->getSizeY2D()/2 +1, this->getSizeY2D()/2);
     112      glVertex2d(this->getSizeY2D()-8 + borderLeft(), borderTop()+8);
     113      glVertex2d(this->getSizeY2D()/2 +1 + borderLeft(), this->getSizeY2D()/2);
    114114
    115       glVertex2d(this->getSizeY2D() -8, this->getSizeY2D() - 8);
    116       glVertex2d(this->getSizeY2D()/2, this->getSizeY2D()/2+1);
     115      glVertex2d(this->getSizeY2D()-8 + borderLeft(), this->getSizeY2D()-8- (borderTop() + borderBottom()));
     116      glVertex2d(this->getSizeY2D()/2 + borderLeft(), this->getSizeY2D()/2+1);
    117117
    118       glVertex2d(8, this->getSizeY2D() - 8);
    119       glVertex2d(this->getSizeY2D()/2 -1, this->getSizeY2D()/2);
     118      glVertex2d(borderLeft() + 8, this->getSizeY2D()-8 - (borderTop() + borderBottom()));
     119      glVertex2d(this->getSizeY2D()/2 -1 + borderLeft(), this->getSizeY2D()/2);
    120120      glEnd();
    121121    }
     
    124124      glBegin(GL_QUADS);
    125125      glColor3f(0, 0, 0);
    126       glTexCoord2i(0,0); glVertex2d(8, 8);
    127       glTexCoord2i(0,1); glVertex2d(8, this->getSizeY2D()-8);
    128       glTexCoord2i(1,1); glVertex2d(this->getSizeY2D()-8, this->getSizeY2D()-8);
    129       glTexCoord2i(1,0); glVertex2d(this->getSizeY2D()-8, 8);
     126      glTexCoord2i(0,0); glVertex2d(borderLeft()+8, borderTop()+8);
     127      glTexCoord2i(0,1); glVertex2d(borderLeft()+ 8, this->getSizeY2D()-8 - (borderTop() + borderBottom()));
     128      glTexCoord2i(1,1); glVertex2d(this->getSizeY2D()-8 +borderLeft(), this->getSizeY2D()-8- (borderTop() + borderBottom()));
     129      glTexCoord2i(1,0); glVertex2d(this->getSizeY2D()-8 +borderLeft(), borderTop()+8);
    130130      glEnd();
    131131    }
  • branches/gui/src/lib/gui/gl_gui/glgui_image.cc

    r8115 r8117  
    7575  void GLGuiImage::resize()
    7676  {
    77     this->frontRect().setTopLeft(this->borderLeft(), this->borderRight());
     77    this->frontRect().setTopLeft(this->borderLeft(), this->borderTop());
    7878    this->frontRect().setSize(this->getSizeX2D() - (borderLeft() + borderRight()), this->getSizeY2D() - (borderTop() + borderBottom()) );
    7979    GLGuiWidget::resize();
  • branches/gui/src/lib/gui/gl_gui/glgui_pushbutton.cc

    r8116 r8117  
    4949
    5050    GLGuiWidget::resize();
    51     this->frontRect().setTopLeft(borderLeft(), borderRight());
     51    this->frontRect().setTopLeft(borderLeft(), borderTop());
    5252    this->frontRect().setSize(this->getSizeX2D() - (borderLeft() + borderRight()), this->getSizeY2D() - (borderTop() + borderBottom()));
    5353  }
  • branches/gui/src/lib/gui/gl_gui/glgui_slider.cc

    r8115 r8117  
    231231    this->drawRect(this->frontRect());
    232232
    233     this->drawRect(Rect2D(this->sliderPosition()-_sliderWidth/2.0, borderLeft(), _sliderWidth, this->getSizeY2D() - (borderLeft() + borderRight())));
     233    this->drawRect(Rect2D(this->sliderPosition()-_sliderWidth/2.0, borderTop(), _sliderWidth, this->getSizeY2D() - (borderTop() + borderBottom())));
    234234
    235235    this->endDraw();
  • branches/gui/src/lib/gui/gl_gui/glgui_widget.cc

    r8116 r8117  
    6969    this->_frontMat.setDiffuse(1.0, 0.0, 0.0);
    7070
    71     this->_borderLeft = 10.0;
     71    this->_borderLeft = 50.0;
    7272    this->_borderRight = 1.0;
    7373    this->_borderTop = 1.0;
Note: See TracChangeset for help on using the changeset viewer.