Handle widget outline in base class.
parent
cac5f476d5
commit
ceafbff5f4
|
@ -144,5 +144,6 @@ void Knob::OnPaint(const PUi *pui) const
|
||||||
pui->font->Render(tmp);
|
pui->font->Render(tmp);
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
|
||||||
|
Widget::OnPaint(pui);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -232,14 +232,6 @@ void VSlider::OnPaint(const PUi *pui) const
|
||||||
pui->font->Render(tmp);
|
pui->font->Render(tmp);
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
|
||||||
if (this->active) {
|
Widget::OnPaint(pui);
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,19 @@ void Widget::Pad(int xpad, int ypad)
|
||||||
this->h -= ypad + 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
|
void Frame::OnPaint(const PUi *pui) const
|
||||||
{
|
{
|
||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
|
|
|
@ -47,7 +47,7 @@ struct Widget : Rect {
|
||||||
virtual float GetNewValue(int x, int y) { return this->value; }
|
virtual float GetNewValue(int x, int y) { return this->value; }
|
||||||
virtual bool SetValue(float newvalue);
|
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);
|
void Pad(int xpad, int ypad);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue