X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ObjComboBox.cxx;h=8d2ef26ef570d45a22acaec35d8525ee7240b936;hb=6ba63abdcb5832a1773cb33cf67d6b34aee4139d;hp=d2f9d6e2ea2017b9b0f98d3b98ca13b64b378a40;hpb=0df953327ef66ec8f0d1ac3a625b569ba1a6a3c2;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ObjComboBox.cxx b/src/HYDROGUI/HYDROGUI_ObjComboBox.cxx index d2f9d6e2..8d2ef26e 100644 --- a/src/HYDROGUI/HYDROGUI_ObjComboBox.cxx +++ b/src/HYDROGUI/HYDROGUI_ObjComboBox.cxx @@ -1,8 +1,4 @@ -// Copyright (C) 2007-2015 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 -// +// Copyright (C) 2014-2015 EDF-R&D // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either @@ -22,7 +18,7 @@ #include "HYDROGUI_ObjComboBox.h" -#include "HYDROGUI_Tool.h" +#include "HYDROGUI_Tool2.h" #include "HYDROGUI_Module.h" #include @@ -86,7 +82,8 @@ void HYDROGUI_ObjComboBox::reset() myObject->blockSignals( true ); myObject->clear(); - myObject->addItems( objectNames() ); + myObjects.Clear(); + myObject->addItems( objectNames( myObjects ) ); myObject->setCurrentIndex( -1 ); myObject->blockSignals( block ); @@ -95,7 +92,7 @@ void HYDROGUI_ObjComboBox::reset() updateSelection(); } -void HYDROGUI_ObjComboBox::setSectedObject( const QString& theName ) +void HYDROGUI_ObjComboBox::setSelectedObject( const QString& theName ) { int aNewIdx = myObject->findText( theName ); if ( aNewIdx != myObject->currentIndex() ) @@ -119,13 +116,16 @@ SUIT_SelectionMgr* HYDROGUI_ObjComboBox::selectionMgr() const return aSelMgr; } -QStringList HYDROGUI_ObjComboBox::objectNames() const +QStringList HYDROGUI_ObjComboBox::objectNames( HYDROData_SequenceOfObjects& theObjects ) const { QStringList aNames; for ( HYDROData_Iterator it( HYDROData_Document::Document( module()->getStudyId() ), objectType() ); it.More(); it.Next() ) { if ( !objectFilter() || objectFilter()->isOk( it.Current() ) ) + { + theObjects.Append( it.Current() ); aNames.append( it.Current()->GetName() ); + } } return aNames; } @@ -157,3 +157,13 @@ void HYDROGUI_ObjComboBox::updateSelection() emit objectSelected( myObject->itemText( idx ) ); } } + +Handle( HYDROData_Entity ) HYDROGUI_ObjComboBox::GetObject() const +{ + int anIndex = myObject->currentIndex(); + if( anIndex>=0 && anIndex