Handle widget outline in base class.
This commit is contained in:
@@ -144,5 +144,6 @@ void Knob::OnPaint(const PUi *pui) const
|
||||
pui->font->Render(tmp);
|
||||
glPopMatrix();
|
||||
|
||||
Widget::OnPaint(pui);
|
||||
}
|
||||
|
||||
|
@@ -232,14 +232,6 @@ void VSlider::OnPaint(const PUi *pui) const
|
||||
pui->font->Render(tmp);
|
||||
glPopMatrix();
|
||||
|
||||
if (this->active) {
|
||||
glBegin(GL_LINE_LOOP);
|
||||
glColor4f(1.f, 1.f, 1.0f, 0.25f);
|
||||
glVertex2f( x + .5f, y + .5f);
|
||||
glVertex2f( x + .5f, h + y - .5f);
|
||||
glVertex2f(w + x - .5f, h + y - .5f);
|
||||
glVertex2f(w + x - .5f, y + .5f);
|
||||
glEnd();
|
||||
}
|
||||
Widget::OnPaint(pui);
|
||||
}
|
||||
|
||||
|
@@ -24,6 +24,19 @@ void Widget::Pad(int xpad, int ypad)
|
||||
this->h -= ypad + ypad;
|
||||
}
|
||||
|
||||
void Widget::OnPaint(const PUi *pui) const
|
||||
{
|
||||
if (this->active) {
|
||||
glBegin(GL_LINE_LOOP);
|
||||
glColor4f(1.f, 1.f, 1.0f, 0.25f);
|
||||
glVertex2f( x + .5f, y + .5f);
|
||||
glVertex2f( x + .5f, h + y - .5f);
|
||||
glVertex2f(w + x - .5f, h + y - .5f);
|
||||
glVertex2f(w + x - .5f, y + .5f);
|
||||
glEnd();
|
||||
}
|
||||
}
|
||||
|
||||
void Frame::OnPaint(const PUi *pui) const
|
||||
{
|
||||
glBegin(GL_QUADS);
|
||||
|
@@ -47,7 +47,7 @@ struct Widget : Rect {
|
||||
virtual float GetNewValue(int x, int y) { return this->value; }
|
||||
virtual bool SetValue(float newvalue);
|
||||
|
||||
virtual void OnPaint(const PUi *pui) const {}
|
||||
virtual void OnPaint(const PUi *pui) const;
|
||||
|
||||
void Pad(int xpad, int ypad);
|
||||
};
|
||||
|
Reference in New Issue
Block a user