X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ObjComboBox.cxx;h=8d2ef26ef570d45a22acaec35d8525ee7240b936;hb=6ba63abdcb5832a1773cb33cf67d6b34aee4139d;hp=6ead5e400e990a34767327a589e5f33883aa651d;hpb=b2b21a9b49f0df8f53c3a1bcb459a4ec081a84ec;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ObjComboBox.cxx b/src/HYDROGUI/HYDROGUI_ObjComboBox.cxx index 6ead5e40..8d2ef26e 100644 --- a/src/HYDROGUI/HYDROGUI_ObjComboBox.cxx +++ b/src/HYDROGUI/HYDROGUI_ObjComboBox.cxx @@ -18,7 +18,7 @@ #include "HYDROGUI_ObjComboBox.h" -#include "HYDROGUI_Tool.h" +#include "HYDROGUI_Tool2.h" #include "HYDROGUI_Module.h" #include @@ -82,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 ); @@ -91,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() ) @@ -115,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; } @@ -153,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