fix deselecting desabled tab

This commit is contained in:
eap 2006-04-13 14:44:41 +00:00
parent 380f740205
commit 678874e0fe

View File

@ -489,17 +489,16 @@ void SMESHGUI_MeshDlg::setCurrentTab( const int theId )
void SMESHGUI_MeshDlg::setMaxHypoDim( const int maxDim ) void SMESHGUI_MeshDlg::setMaxHypoDim( const int maxDim )
{ {
for ( int i = Dim1D; i <= Dim3D; ++i ) { const int DIM = maxDim - 1;
int dim = i + 1; for ( int dim = Dim1D; dim <= Dim3D; ++dim ) {
bool enable = ( dim <= maxDim ); bool enable = ( dim <= DIM );
if ( !enable ) { if ( !enable )
myTabs[ i ]->reset(); myTabs[ dim ]->reset();
if ( myTabs[ i ] == myTabWg->currentPage() && i != Dim1D) myTabWg->setTabEnabled( myTabs[ dim ], enable );
// deselect desebled tab
myTabWg->setCurrentPage( i - 1 );
}
myTabWg->setTabEnabled( myTabs[ i ], enable );
} }
// deselect desabled tab
if ( !myTabWg->isTabEnabled( myTabWg->currentPage() ))
setCurrentTab( DIM - 1 );
} }
//================================================================================ //================================================================================