#include <QLineEdit>
#include <QToolButton>
-HYDROGUI_ObjSelector::HYDROGUI_ObjSelector( HYDROGUI_Module* theModule, QWidget* theParent )
-: QAbstractButton( theParent ), myModule( theModule )
+HYDROGUI_ObjSelector::HYDROGUI_ObjSelector( HYDROGUI_Module* theModule,
+ const ObjectKind theObjectKind,
+ QWidget* theParent )
+: QAbstractButton( theParent ),
+ myObjectKind( theObjectKind ),
+ myModule( theModule )
{
QHBoxLayout* aLayout = new QHBoxLayout( this );
aLayout->setMargin( 0 );
QString anObjName;
Handle(HYDROData_Object) anObject = HYDROGUI_Tool::GetSelectedObject( myModule );
if( !anObject.IsNull() )
- anObjName = anObject->GetName();
+ if( myObjectKind == KIND_UNKNOWN || myObjectKind == anObject->GetKind() )
+ anObjName = anObject->GetName();
- myObjName->setText( anObjName );
+ SetName( anObjName );
+}
+
+void HYDROGUI_ObjSelector::SetName( const QString& theName )
+{
+ myObjName->setText( theName );
}
QString HYDROGUI_ObjSelector::GetName() const