X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ObjSelector.cxx;h=19ddb76ec31d5b748bccaf6063817fc9a7315983;hb=5cae7e874afd2fc1b6f61023e8ebd33a933db3c7;hp=04bd20f0c0c4d67f5386a436cfe388b0278763d3;hpb=0d25f237574f54902a8d972ebc613301acfe3e43;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ObjSelector.cxx b/src/HYDROGUI/HYDROGUI_ObjSelector.cxx index 04bd20f0..19ddb76e 100644 --- a/src/HYDROGUI/HYDROGUI_ObjSelector.cxx +++ b/src/HYDROGUI/HYDROGUI_ObjSelector.cxx @@ -39,8 +39,12 @@ #include #include -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 ); @@ -95,9 +99,10 @@ void HYDROGUI_ObjSelector::OnSelectionChanged() return; QString anObjName; - Handle(HYDROData_Object) anObject = HYDROGUI_Tool::GetSelectedObject( myModule ); + Handle(HYDROData_Entity) anObject = HYDROGUI_Tool::GetSelectedObject( myModule ); if( !anObject.IsNull() ) - anObjName = anObject->GetName(); + if( myObjectKind == KIND_UNKNOWN || myObjectKind == anObject->GetKind() ) + anObjName = anObject->GetName(); SetName( anObjName ); } @@ -117,3 +122,8 @@ void HYDROGUI_ObjSelector::Clear() myObjName->clear(); myBtn->setChecked( false ); } + +void HYDROGUI_ObjSelector::SetChecked( const bool theState ) +{ + myBtn->setChecked( theState ); +}