From 2768565d1538c0ccdd643f674e7364714536b91d Mon Sep 17 00:00:00 2001 From: apo Date: Tue, 24 Jun 2008 12:44:54 +0000 Subject: [PATCH] Debugging of the slider functionality - To check whether VTK view is current view or not --- src/VISUGUI/VisuGUI_Slider.cxx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/VISUGUI/VisuGUI_Slider.cxx b/src/VISUGUI/VisuGUI_Slider.cxx index d7be50ca..229b91b4 100644 --- a/src/VISUGUI/VisuGUI_Slider.cxx +++ b/src/VISUGUI/VisuGUI_Slider.cxx @@ -506,7 +506,10 @@ void VisuGUI_Slider::onSelectionChanged() } } - enableControls( !checkHolderList() ); + VISU::View_var aView = myViewManager->GetCurrentView(); + + enableControls( !checkHolderList() && !CORBA::is_nil( aView.in() ) ); + updateMemoryState(); } @@ -583,7 +586,7 @@ void VisuGUI_Slider::onLast() //---------------------------------------------------------------------------- void VisuGUI_Slider::onValueChanged( int value ) { - if( checkHolderList() ){ + if ( checkHolderList() ) { enableControls( false ); return; } @@ -595,18 +598,20 @@ void VisuGUI_Slider::onValueChanged( int value ) VISU::ColoredPrs3dHolder::TimeStampsRange_var aTimeStampsRange = aHolder->GetTimeStampsRange(); CORBA::Long aLength = aTimeStampsRange->length(); - if(value < 0 || aLength <= value) + if ( value < 0 || aLength <= value ) return; VISU::ColoredPrs3dHolder::BasicInput_var anInput = aHolder->GetBasicInput(); CORBA::Long aTimeStampNumber = anInput->myTimeStampNumber; CORBA::Long aNumber = aTimeStampsRange[ value ].myNumber; - if(aNumber == aTimeStampNumber) + if ( aNumber == aTimeStampNumber ) return; VISU::View_var aView = myViewManager->GetCurrentView(); - if ( CORBA::is_nil( aView.in() ) ) + if ( CORBA::is_nil( aView.in() ) ) { + enableControls( false ); return; + } VISU::View3D_var aView3D = VISU::View3D::_narrow( aView ); -- 2.39.2