-
Автор темы
- #1
void CSlider::Draw(bool hover)
{
POINT a = GetAbsolutePos();
FunctionsColor.SetColor(Functions::Every.ColorsTab.MenuR.GetValue(), Every::All.ColorsTab.MenuG.GetValue(), Functions::All.ColorsTab.MenuB.GetValue(), 255);
float Ratio = Value / (Max - Min);
float Location = Ratio*m_iWidth;
Draw::GradientV(a.x, a.y + 5, m_iWidth, 9, Color(12, 12, 12, 255), Color(32, 32, 32, 255));
Draw::GradientV(a.x, a.y + 5, Location, 9, Menu, Menu);
Draw::Outline(a.x, a.y + 5, m_iWidth, 9, Color(0, 0, 0, 255));
char buffer[24];
sprintf_s(buffer, "%.2f", Value);
RECT txtSize = Draw::GetTextSize(Draw::Fonts::Menu, buffer);
Draw::Text(a.x + Location - txtSize.right / 2, a.y + 10, Color(200, 200, 200, 255), Draw::Fonts::Menu, buffer);
}
{
POINT a = GetAbsolutePos();
FunctionsColor.SetColor(Functions::Every.ColorsTab.MenuR.GetValue(), Every::All.ColorsTab.MenuG.GetValue(), Functions::All.ColorsTab.MenuB.GetValue(), 255);
float Ratio = Value / (Max - Min);
float Location = Ratio*m_iWidth;
Draw::GradientV(a.x, a.y + 5, m_iWidth, 9, Color(12, 12, 12, 255), Color(32, 32, 32, 255));
Draw::GradientV(a.x, a.y + 5, Location, 9, Menu, Menu);
Draw::Outline(a.x, a.y + 5, m_iWidth, 9, Color(0, 0, 0, 255));
char buffer[24];
sprintf_s(buffer, "%.2f", Value);
RECT txtSize = Draw::GetTextSize(Draw::Fonts::Menu, buffer);
Draw::Text(a.x + Location - txtSize.right / 2, a.y + 10, Color(200, 200, 200, 255), Draw::Fonts::Menu, buffer);
}