-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_MeshDlg.cxx
// Author : Sergey LITONIN, Open CASCADE S.A.S.
myHypoSetButton->setText( tr( "HYPOTHESES_SETS" ) );
myHypoSetButton->setEnabled( false );
myHypoSetButton->setSizePolicy( QSizePolicy::MinimumExpanding,
- myHypoSetButton->sizePolicy().verticalPolicy() );
+ myHypoSetButton->sizePolicy().verticalPolicy() );
// Fill layout
QGridLayout* aLay = new QGridLayout( mainFrame() );
const int DIM = maxDim;
for ( int dim = Dim0D; dim <= Dim3D; ++dim ) {
bool enable = ( dim <= DIM );
- if ( !enable )
+ if ( !enable ) {
myTabs[ dim ]->reset();
- myTabWg->setTabEnabled( myTabWg->indexOf( myTabs[ dim ] ), enable );
+ disableTab( dim );
+ }
+ else {
+ enableTab( dim );
+ }
}
// deselect desabled tab
if ( !myTabWg->isTabEnabled( myTabWg->currentIndex() ) )
myGeomPopup->addAction( tr("DIRECT_GEOM_SELECTION") )->setData( DIRECT_GEOM_INDEX );
myGeomPopup->addAction( tr("GEOM_BY_MESH_ELEM_SELECTION") )->setData( GEOM_BY_MESH_INDEX );
connect( myGeomPopup, SIGNAL( triggered( QAction* ) ), SLOT( onGeomPopup( QAction* ) ) );
- connect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
+ connect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
}
}
else {
disconnect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
if ( myGeomPopup ) {
- delete myGeomPopup;
- myGeomPopup = 0;
+ delete myGeomPopup;
+ myGeomPopup = 0;
}
}
}
//================================================================================
void SMESHGUI_MeshDlg::disableTab(const int theTabId) {
myTabWg->setTabEnabled( myTabWg->indexOf( myTabs[ theTabId ] ), false );
+ if ( theTabId == Dim3D ) myHypoSetButton->setEnabled( false );
}
//================================================================================
//================================================================================
void SMESHGUI_MeshDlg::enableTab(const int theTabId) {
myTabWg->setTabEnabled( myTabWg->indexOf( myTabs[ theTabId ] ), true );
+ if ( theTabId == Dim3D ) {
+ QMenu* aHypoSetPopup = myHypoSetButton->menu();
+ myHypoSetButton->setEnabled( aHypoSetPopup && !aHypoSetPopup->actions().isEmpty() );
+ }
}
//================================================================================
*/
//================================================================================
bool SMESHGUI_MeshDlg::isTabEnabled(const int theTabId) const {
- myTabWg->isTabEnabled( myTabWg->indexOf( myTabs[ theTabId ] ) );
+ return myTabWg->isTabEnabled( myTabWg->indexOf( myTabs[ theTabId ] ) );
}
void SMESHGUI_MeshDlg::onGeomSelectionButton(bool isBtnOn)