From: apo Date: Fri, 3 Nov 2006 12:55:26 +0000 (+0000) Subject: To update speed of "play" in run-time X-Git-Tag: WP1_2_3_06-10-2006~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b8275e1002df8f6979d973497552ebe4d8643a62;p=modules%2Fvisu.git To update speed of "play" in run-time --- diff --git a/src/VISUGUI/VisuGUI_Slider.cxx b/src/VISUGUI/VisuGUI_Slider.cxx index bf983a10..f32198c8 100644 --- a/src/VISUGUI/VisuGUI_Slider.cxx +++ b/src/VISUGUI/VisuGUI_Slider.cxx @@ -157,6 +157,8 @@ VisuGUI_Slider::VisuGUI_Slider( VVTK_ViewWindow* theViewWondow, connect( mySlider, SIGNAL( sliderMoved( int ) ), SLOT( onSliderMoved( int ) ) ); connect( mySlider, SIGNAL( valueChanged( int ) ), SLOT( onValueChanged( int ) ) ); + connect( mySpeedBox, SIGNAL( valueChanged( int ) ), SLOT( onSpeedChanged( int ) ) ); + connect( myTimer, SIGNAL( timeout() ), SLOT( onTimeout() ) ); enableControls( false ); @@ -331,6 +333,14 @@ void VisuGUI_Slider::onValueChanged( int value ) myMainWindow->Repaint(); } +void VisuGUI_Slider::onSpeedChanged( int value ) +{ + if(myPlayButton->isOn()){ + int delay = int(5000.0 / double(mySpeedBox->value())); + myTimer->start( delay ); + } +} + void VisuGUI_Slider::onTimeout() { int value = mySlider->value(); diff --git a/src/VISUGUI/VisuGUI_Slider.h b/src/VISUGUI/VisuGUI_Slider.h index 1a7e3a2c..d196ed69 100644 --- a/src/VISUGUI/VisuGUI_Slider.h +++ b/src/VISUGUI/VisuGUI_Slider.h @@ -81,6 +81,8 @@ public slots: virtual void onSliderMoved( int ); virtual void onValueChanged( int ); + virtual void onSpeedChanged( int ); + virtual void onTimeout(); private: