Changeset 8429 in orxonox.OLD for branches/gui/src/lib
- Timestamp:
- Jun 15, 2006, 12:29:58 AM (18 years ago)
- Location:
- branches/gui/src/lib/gui/gl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/gui/gl/glgui_checkbutton.cc
r8378 r8429 65 65 void GLGuiCheckButton::resize() 66 66 { 67 this->labelText().setRelCoor2D(borderLeft() + 25, borderTop() + 5); 68 this->setSize2D(this->labelText().getSizeX2D() + 30 + borderLeft() + borderRight(), this->labelText().getSizeY2D() + 10 + borderTop()+borderBottom()); 67 68 this->labelText().setRelCoor2D( borderLeft() + 15.0, borderTop() + 5); 69 this->setSize2D(this->labelText().getSizeX2D() + 15.0 + borderLeft() + borderRight(), this->labelText().getSizeY2D() + 10 + borderTop()+borderBottom()); 69 70 GLGuiWidget::resize(); 71 72 this->_checkBox.setSize(10.0, 10.0); 73 this->_checkBox.setCenter( borderLeft() + _checkBox.height()/2.0, borderTop() + (this->getSizeY2D() - borderTop() - borderBottom()) / 2.0); 74 70 75 /* this->frontRect().setTopLeft(borderLeft(), borderTop()); 71 76 this->frontRect().setSize(this->getSizeX2D() - (borderLeft() + borderRight()) , this->getSizeY2D() - (borderTop() + borderBottom()));*/ … … 94 99 if (this->bActive) 95 100 { 96 glBegin(GL_QUADS); 97 glColor3f( 1, 1 ,1); 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); 102 glEnd(); 101 glColor3fv( &this->frontColor()[0]); 102 this->drawRect(this->_checkBox); 103 103 104 104 105 105 // DRAW a cross :) 106 glColor3f(0,0,0); 106 Vector2D center = this->_checkBox.center(); 107 glColor4f(1,1,1, 1.0); 107 108 glLineWidth(3.0); 109 108 110 glBegin(GL_LINE_LOOP); 109 glVertex2d( borderLeft()+8,borderTop() +8);110 glVertex2d( this->getSizeY2D()/2 + borderLeft(), this->getSizeY2D()/2 - 1);111 glVertex2d(_checkBox.left(), _checkBox.top()); 112 glVertex2d(center.x, center.y); 111 113 112 glVertex2d( this->getSizeY2D()-8 + borderLeft(), borderTop()+8);113 glVertex2d( this->getSizeY2D()/2 +1 + borderLeft(), this->getSizeY2D()/2);114 glVertex2d(_checkBox.right(), _checkBox.top()); 115 glVertex2d(center.x, center.y); 114 116 115 glVertex2d( this->getSizeY2D()-8 + borderLeft(), this->getSizeY2D()-8- (borderTop() + borderBottom()));116 glVertex2d( this->getSizeY2D()/2 + borderLeft(), this->getSizeY2D()/2+1);117 glVertex2d(_checkBox.right(), _checkBox.bottom()); 118 glVertex2d(center.x, center.y); 117 119 118 glVertex2d( borderLeft() + 8, this->getSizeY2D()-8 - (borderTop() + borderBottom()));119 glVertex2d( this->getSizeY2D()/2 -1 + borderLeft(), this->getSizeY2D()/2);120 glVertex2d(_checkBox.left(), _checkBox.bottom()); 121 glVertex2d(center.x, center.y); 120 122 glEnd(); 121 123 } 122 124 else 123 125 { 124 glBegin(GL_QUADS); 125 glColor3f(0, 0, 0); 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); 130 glEnd(); 126 glColor3fv( &this->frontColor()[0]); 127 this->drawRect(this->_checkBox); 131 128 } 132 129 -
branches/gui/src/lib/gui/gl/glgui_checkbutton.h
r8145 r8429 46 46 private: 47 47 bool bActive; 48 48 Rect2D _checkBox; 49 49 }; 50 50 }
Note: See TracChangeset
for help on using the changeset viewer.