SSlider::SSlider(QWidget* parent) : QAbstractSlider(parent) { mGrabbed = false; setMinimum(0); setMaximum(127); setSingleStep(1); setStart(0); setBarSize(Width::Large); }
void GLFW_App::create_tweakbar_from_component(const Component::Ptr &the_component) { if(!the_component) return; m_tweakBars.push_back(TwNewBar(the_component->getName().c_str())); setBarColor(glm::vec4(0, 0, 0, .5), m_tweakBars.back()); setBarSize(glm::ivec2(250, 500)); glm::ivec2 offset(10); setBarPosition(glm::ivec2(offset.x + 260 * (m_tweakBars.size() - 1), offset.y), m_tweakBars.back()); addPropertyListToTweakBar(the_component->getPropertyList(), "", m_tweakBars.back()); }
void WidgetBar::Update( ) { if( fBinded != NULL ){ if( (*fBinded) != BarValue ) setBarValue( *fBinded ); } if( BindedMaxValue != NULL ){ if( (*BindedMaxValue) != BarMaxValue ) setBarSize( *BindedMaxValue ); } }
void WidgetBar::createBar( std::string name, int picture, int height, color4u clr ) { Height -= height + (int)BarY; BarSprite = RenderManager::CreateGLSprite( PosX + BarX, PosY + BarY, getZ(),(int)BarWidth, height ); BarSprite->setFixed(); if( name != "" ){ TopSprite = RenderManager::CreateGLSprite( PosX + TopX, PosY + TopY, getZ() + 0.1f, (int)Width, (int)Height, RenderManager::GetTextureNumberById(name), picture ); TopSprite->setFixed(); } if( BarSprite ){ BarSprite->clr.set( clr.r, clr.g, clr.b, clr.a ); } //setTextPosition( getTextX(), getTextY() - Height ); setBarValue(1); setBarSize(1); }
void PPSlider::initButtons() { PPPoint buttonDownPos, buttonBarPos; PPSize buttonBarSize; if (horizontal) { this->size.height = SLIDERBUTTONHEIGHT; this->size.width = oneDimSize; buttonDownPos = PPPoint(location.x + oneDimSize - SLIDERBUTTONWIDTH, location.y); buttonBarPos = PPPoint(location.x + SLIDERBUTTONWIDTH, location.y); buttonBarSize = PPSize((oneDimSize - SLIDERBUTTONWIDTH*2), SLIDERBUTTONHEIGHT); } else { this->size.width = SLIDERBUTTONWIDTH; this->size.height = oneDimSize; buttonDownPos = PPPoint(location.x, location.y + oneDimSize - SLIDERBUTTONHEIGHT); buttonBarPos = PPPoint(location.x, location.y + SLIDERBUTTONHEIGHT); buttonBarSize = PPSize(SLIDERBUTTONWIDTH, (oneDimSize - SLIDERBUTTONHEIGHT*2)); } backgroundButton = new PPButton(0, parentScreen, NULL, /*_Point(location.x + (horizontal?0:1), location.y + (horizontal?1:0))*/location, this->size, false); backgroundButton->setColor(backgroundColor); backgroundButton->setInvertShading(true); buttonUp = new PPButton(0, parentScreen, this, location, PPSize(SLIDERBUTTONWIDTH,SLIDERBUTTONHEIGHT), false); buttonUp->setText(!buttonSwap ? "-" : "+"); buttonDown = new PPButton(0, parentScreen, this, buttonDownPos , PPSize(SLIDERBUTTONWIDTH,SLIDERBUTTONHEIGHT), false); buttonDown->setText(!buttonSwap ? "+" : "-"); buttonBar = new PPButton(0, parentScreen, this, buttonBarPos, buttonBarSize, false, false); setBarSize(currentBarSize, false); setBarPosition(currentBarPosition, false); }