const static char* WDG_ACTION = "action";
const static char* WDG_POINT_INPUT = "point_input";
const static char* WDG_SELECTION_FILTERS = "selection_filters";
+const static char* WDG_TREE_DATA_SELECTOR = "tree_data_selector";
// Containers
const static char* WDG_GROUP = "groupbox";
ModuleBase_ITreeNode.h
ModuleBase_WidgetSelectionFilter.h
ModuleBase_IStepPrs.h
+ ModuleBase_WidgetTreeDataSelect.h
)
SET(PROJECT_MOC_HEADERS
ModuleBase_WidgetRadiobox.h
ModuleBase_WidgetPointInput.h
ModuleBase_WidgetSelectionFilter.h
+ ModuleBase_WidgetTreeDataSelect.h
)
SET(PROJECT_SOURCES
ModuleBase_WidgetPointInput.cpp
ModuleBase_WidgetSelectionFilter.cpp
ModuleBase_IStepPrs.cpp
+ ModuleBase_WidgetTreeDataSelect.cpp
)
SET(PROJECT_LIBRARIES
#include <ModuleBase_WidgetAction.h>
#include <ModuleBase_WidgetPointInput.h>
#include <ModuleBase_WidgetSelectionFilter.h>
+#include <ModuleBase_WidgetTreeDataSelect.h>
#include <ModelAPI_Validator.h>
#include <ModelAPI_Session.h>
result = new ModuleBase_WidgetPointInput(theParent, myWorkshop, myWidgetApi);
} else if (theType == WDG_SELECTION_FILTERS) {
result = new ModuleBase_WidgetSelectionFilter(theParent, myWorkshop, myWidgetApi);
+ } else if (theType == WDG_TREE_DATA_SELECTOR) {
+ result = new ModuleBase_WidgetTreeDataSelect(theParent, myWorkshop, myWidgetApi);
} else {
result = myWorkshop->module()->createWidgetByType(theType, theParent, myWidgetApi);
if (!result)
--- /dev/null
+// Copyright (C) 2014-2019 CEA/DEN, 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
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+
+#include <ModuleBase_WidgetTreeDataSelect.h>
+
+#include <QVBoxLayout>
+#include <QTreeView>
+
+ModuleBase_WidgetTreeDataSelect::ModuleBase_WidgetTreeDataSelect(QWidget* theParent,
+ ModuleBase_IWorkshop* theWorkshop,
+ const Config_WidgetAPI* theData)
+ :ModuleBase_ModelWidget(theParent, theData), myWorkshop(theWorkshop)
+{
+ QVBoxLayout* aLayout = new QVBoxLayout(this);
+
+ myTreeView = new QTreeView(this);
+ aLayout->addWidget(myTreeView);
+}
+
+ModuleBase_WidgetTreeDataSelect::~ModuleBase_WidgetTreeDataSelect()
+{
+}
+
+
+QList<QWidget*> ModuleBase_WidgetTreeDataSelect::getControls() const
+{
+ QList<QWidget*> aList;
+ aList << myTreeView;
+ return aList;
+}
+
+bool ModuleBase_WidgetTreeDataSelect::storeValueCustom()
+{
+ return true;
+}
+
+bool ModuleBase_WidgetTreeDataSelect::restoreValueCustom()
+{
+ return true;
+}
--- /dev/null
+// Copyright (C) 2014-2019 CEA/DEN, 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
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef MODULEBASE_WIDGETTREEDATASELECT_H_
+#define MODULEBASE_WIDGETTREEDATASELECT_H_
+
+#include <ModuleBase.h>
+#include <ModuleBase_ModelWidget.h>
+
+class QTreeView;
+
+/**
+* \ingroup GUI
+* Implementation of a widget for tree data selection
+*/
+class MODULEBASE_EXPORT ModuleBase_WidgetTreeDataSelect : public ModuleBase_ModelWidget
+{
+ Q_OBJECT
+public:
+ /// Constructor
+ /// \param theParent the parent object
+ /// \param theWorkshop a reference to workshop
+ /// \param theData the widget configuation. The attribute of the model widget is obtained from
+ ModuleBase_WidgetTreeDataSelect(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
+ const Config_WidgetAPI* theData);
+
+ virtual ~ModuleBase_WidgetTreeDataSelect();
+
+ /// Returns list of widget controls
+ /// \return a control list
+ virtual QList<QWidget*> getControls() const;
+
+ /// Saves the internal parameters to the given feature
+ /// \return True in success
+ virtual bool storeValueCustom();
+
+ /// Restore value from attribute data to the widget's control
+ virtual bool restoreValueCustom();
+
+protected:
+ ModuleBase_IWorkshop* myWorkshop; ///< the active workshop
+
+private:
+ QTreeView* myTreeView;
+};
+
+#endif
\ No newline at end of file