コード例 #1
0
ファイル: panel.cpp プロジェクト: ICRAR/void
void
ValueSliderWithLabel::SliderMoved(
    Base * pControl)
{
    Gwen::Controls::Slider * pSlider = (Gwen::Controls::Slider *)pControl;
    float rescaled = GetRescaledValue(pSlider->GetValue());
    SetValueInternal(rescaled, false, true);
}
コード例 #2
0
	void SliderMoved( Gwen::Controls::Base* pControl )
	{
		Gwen::Controls::Slider* pSlider = (Gwen::Controls::Slider*)pControl;
		//printf("value = %f\n", pSlider->GetValue());//UnitPrint( Utility::Format( L"Slider Value: %.2f", pSlider->GetValue() ) );
		float bla = pSlider->GetValue();
		T v = T(bla);
		SetValue(v);

	}
コード例 #3
0
	void	SetValue(T v)
	{
		if (v < m_pSlider->GetRangeMin())
		{
			printf("?\n");
		}

		if (v > m_pSlider->GetRangeMax())
		{
						printf("?\n");

		}
		m_pSlider->SetValue(v,true);
		(*m_targetValue) = v;
		float val = float(v);//todo: specialize on template type
		char txt[1024];
		sprintf(txt,"%s : %.3f", m_variableName,val);
		m_label->SetText(txt);

	}
コード例 #4
0
ファイル: Slider.cpp プロジェクト: 32bitmicro/GWEN
	void SliderMoved( Base* pControl )
	{
		Gwen::Controls::Slider* pSlider = (Gwen::Controls::Slider*)pControl;

		UnitPrint( Utility::Format( L"Slider Value: %.2f", (float)pSlider->GetFloatValue() ) );
	}
コード例 #5
0
void SettingsPanel::onSliderLaserOutput( Gwen::Controls::Base* pControl ){
    Gwen::Controls::Label* label = mLabelsMap[pControl];
    Gwen::Controls::Slider* pSlider = ( Gwen::Controls::Slider* ) pControl;
    label->SetValue( toString(( int ) pSlider->GetFloatValue()));
//    console() << label->GetValue().c_str() << "   Slider Value: " <<  ( float ) pSlider->GetFloatValue() << std::endl;
    
    string controlName = pSlider->GetName().c_str();
    if (controlName.compare("Target Points Count") == 0){
        mIldaFrame->params.output.targetPointCount = ( int ) pSlider->GetFloatValue();
        mIldaFrame->update();
    }
    else if (controlName.compare("Blank Count") == 0){
        mIldaFrame->params.output.blankCount = ( int ) pSlider->GetFloatValue();
        mIldaFrame->update();
    }
    else if (controlName.compare("End Count") == 0){
        mIldaFrame->params.output.endCount = ( int ) pSlider->GetFloatValue();
        mIldaFrame->update();
    }
    else if (controlName.compare("Laser pps") == 0){
        mLaserController->setPPS(( int ) pSlider->GetFloatValue());
    }
    else if (controlName.compare("Laser Angle") == 0){
        mLaserPreview3D->setLaserAngle( ( int ) pSlider->GetFloatValue() );
    }
    else if (controlName.compare("Scanner Angle Max Input") == 0){
        float scale = pSlider->GetFloatValue()/(mIldaFrame->params.output.scannerAngleX);
//        float val = mIldaFrame->params.output.transform.scale.x * mIldaFrame->params.output.scannerAngleX * 100;
        mIldaFrame->params.output.transform.scale.x = scale;
        mIldaFrame->params.output.transform.scale.y = scale;
    }
    else if(controlName.compare("Fans Intensity") == 0){
        mLaserPreview3D->paramsView.fansIntensity = ( float ) pSlider->GetFloatValue() / 100.0;
    }
    else if(controlName.compare("Main speed") == 0){
        mMainController->getDataManager()->setMainSpeed( ( float ) ((int)pSlider->GetFloatValue())/100.0 );
    }
    
    
}