From: eap Date: Thu, 13 Apr 2006 14:44:41 +0000 (+0000) Subject: fix deselecting desabled tab X-Git-Tag: T3_2_0b1_pre1~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=678874e0fe1cb78610c58656f4f508ef1b9e46ed;p=modules%2Fsmesh.git fix deselecting desabled tab --- diff --git a/src/SMESHGUI/SMESHGUI_MeshDlg.cxx b/src/SMESHGUI/SMESHGUI_MeshDlg.cxx index 701eaf2a8..e05e2022d 100644 --- a/src/SMESHGUI/SMESHGUI_MeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshDlg.cxx @@ -489,17 +489,16 @@ void SMESHGUI_MeshDlg::setCurrentTab( const int theId ) void SMESHGUI_MeshDlg::setMaxHypoDim( const int maxDim ) { - for ( int i = Dim1D; i <= Dim3D; ++i ) { - int dim = i + 1; - bool enable = ( dim <= maxDim ); - if ( !enable ) { - myTabs[ i ]->reset(); - if ( myTabs[ i ] == myTabWg->currentPage() && i != Dim1D) - // deselect desebled tab - myTabWg->setCurrentPage( i - 1 ); - } - myTabWg->setTabEnabled( myTabs[ i ], enable ); + const int DIM = maxDim - 1; + for ( int dim = Dim1D; dim <= Dim3D; ++dim ) { + bool enable = ( dim <= DIM ); + if ( !enable ) + myTabs[ dim ]->reset(); + myTabWg->setTabEnabled( myTabs[ dim ], enable ); } + // deselect desabled tab + if ( !myTabWg->isTabEnabled( myTabWg->currentPage() )) + setCurrentTab( DIM - 1 ); } //================================================================================