HYDROGUI_ObjListBox::HYDROGUI_ObjListBox( HYDROGUI_Module* theModule, const QString& theTitle, const ObjectKind& theType, QWidget* theParent )
: QWidget( theParent ),
- myType( theType ),
myModule( theModule ),
myFilter( 0 )
+{
+ myTypes.append( theType );
+ Init(theTitle);
+}
+
+HYDROGUI_ObjListBox::HYDROGUI_ObjListBox( HYDROGUI_Module* theModule, const QString& theTitle, const QList<ObjectKind>& theTypes, QWidget* theParent )
+: QWidget( theParent ),
+ myTypes( theTypes ),
+ myModule( theModule ),
+ myFilter( 0 )
+{
+ Init(theTitle);
+}
+
+void HYDROGUI_ObjListBox::Init(const QString& theTitle)
{
QGridLayout* aBase = new QGridLayout( this );
aBase->setMargin( 0 );
return myModule;
}
-ObjectKind HYDROGUI_ObjListBox::objectType() const
+QList<ObjectKind> HYDROGUI_ObjListBox::objectTypes() const
{
- return myType;
+ return myTypes;
}
HYDROGUI_ObjComboBoxFilter* HYDROGUI_ObjListBox::objectFilter() const
for( int i=theObjects.Lower(), n=theObjects.Upper(); i<=n; i++ )
{
Handle( HYDROData_Entity ) anObject = theObjects.Value( i );
- bool isOK = !anObject.IsNull() && anObject->GetKind()==myType;
+ bool isOK = !anObject.IsNull() && myTypes.contains(anObject->GetKind());
if( myFilter && isOK )
isOK = myFilter->isOk( anObject );
public:
HYDROGUI_ObjListBox( HYDROGUI_Module* theModule, const QString& theTitle,
const ObjectKind& = KIND_UNKNOWN, QWidget* = 0 );
+ HYDROGUI_ObjListBox( HYDROGUI_Module* theModule, const QString& theTitle,
+ const QList<ObjectKind>& theTypes, QWidget* = 0 );
virtual ~HYDROGUI_ObjListBox();
HYDROGUI_Module* module() const;
- ObjectKind objectType() const;
+ QList<ObjectKind> objectTypes() const;
HYDROGUI_ObjComboBoxFilter* objectFilter() const;
void setObjectFilter( HYDROGUI_ObjComboBoxFilter* );
void setObjectsFromSelection();
void reset();
+private:
+ void Init(const QString& theTitle);
+
private slots:
void OnInclude();
void OnExclude();
void Append( const HYDROData_SequenceOfObjects& );
private:
- ObjectKind myType;
+ QList<ObjectKind> myTypes;
QListWidget* myList;
HYDROGUI_Module* myModule;
HYDROGUI_ObjComboBoxFilter* myFilter;