QToolButton* aStopButton = new QToolButton( aNavigationTab );
aStopButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SWEEP_STOP" ) ) );
aStopButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- aStopButton->setCheckable( true );
- connect( aStopButton, SIGNAL( toggled( bool ) ), SLOT( onStop( bool ) ) );
+ aStopButton->setCheckable( false );
+ connect( aStopButton, SIGNAL( clicked( ) ), SLOT( onStop( ) ) );
aHBoxLayout->addWidget( aStopButton );
myIsCycled = new QCheckBox( aNavigationTab );
{
setHidden( true );
- onStop( true );
+ onEnable( true );
}
~TEnabler()
{
- myWidget->onStop( !myIsValidSelection );
+ myWidget->onEnable( !myIsValidSelection );
}
};
}
{
bool anIsValidSelection = ( myScalarMap && myActor.GetPointer() );
- TEnabler anEnabler( this, anIsValidSelection );
-
if ( !anIsValidSelection )
return;
//----------------------------------------------------------------------------
void VisuGUI_Sweep::onPlay( bool on )
{
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
if ( on ) {
myPlayButton->setIcon( myPausePixmap );
myTimer->start( int( myStepDelay->value() * 1000 ) );
//----------------------------------------------------------------------------
-void VisuGUI_Sweep::onStop( bool on )
+void VisuGUI_Sweep::onStop()
{
- if ( on ) {
- onPlay( false );
- mySweepSlider->setValue( mySweepSlider->maximum() );
- }
+ onPlay( false );
+ mySweepSlider->setValue( mySweepSlider->maximum() );
+
+ if ( myViewWindow )
+ myViewWindow->Repaint();
+}
+
+
+//----------------------------------------------------------------------------
+void VisuGUI_Sweep::onEnable( bool on )
+{
+ onStop();
mySweepSlider->setEnabled( !on );
myNextButton->setEnabled( !on );
myLastButton->setEnabled( !on );
-
- if ( on && myViewWindow )
- myViewWindow->Repaint();
}