Salome HOME
Typo fixes by Kunda
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MeshDlg.cxx
index bb0b265f78cfc8c30502de98e8bdb04716e4688f..a1ee4ec9f25155bd38dbf39655f9181922fe8874 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2019  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
@@ -828,6 +828,17 @@ bool SMESHGUI_MeshDlg::isTabEnabled(const int theTabId) const
   return myTabWg->isTabEnabled( myTabWg->indexOf( myTabs[ theTabId ] ) );
 }
 
+//================================================================================
+/*!
+ * \brief Return index of a current tab
+ * \return tab ID
+ */
+//================================================================================
+int SMESHGUI_MeshDlg::currentTab() const
+{
+  return Dim3D - myTabWg->currentIndex();
+}
+
 //================================================================================
 /*!
  * \brief SLOT called when a Geom selection button is clicked
@@ -900,5 +911,8 @@ int SMESHGUI_MeshDlg::currentMeshType( )
 //================================================================================
 void SMESHGUI_MeshDlg::setCurrentMeshType( const int theIndex )
 {
-  myMeshType->setCurrentIndex( theIndex );
+  if ( theIndex < myMeshType->count() )
+    myMeshType->setCurrentIndex( theIndex );
+  else
+    myMeshType->setCurrentIndex( 0 );
 }