Salome HOME
refs #80 - Sketch base GUI: create/draw point, circle and arc
authornds <natalia.donis@opencascade.com>
Fri, 6 Jun 2014 12:32:01 +0000 (16:32 +0400)
committernds <natalia.donis@opencascade.com>
Fri, 6 Jun 2014 12:32:01 +0000 (16:32 +0400)
Code correction to set the focus widget for all ModelWidget children.

src/ModuleBase/CMakeLists.txt
src/ModuleBase/ModuleBase_MetaWidget.cpp [deleted file]
src/ModuleBase/ModuleBase_MetaWidget.h [deleted file]
src/ModuleBase/ModuleBase_WidgetBoolValue.cpp [new file with mode: 0644]
src/ModuleBase/ModuleBase_WidgetBoolValue.h [new file with mode: 0644]
src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp [new file with mode: 0644]
src/ModuleBase/ModuleBase_WidgetDoubleValue.h [new file with mode: 0644]
src/ModuleBase/ModuleBase_WidgetFactory.cpp
src/ModuleBase/ModuleBase_Widgets.cpp [deleted file]
src/ModuleBase/ModuleBase_Widgets.h [deleted file]

index 8679b5724cfd008ff0d8246e63ac62ce35651ca1..22c359484374cdee38fcc68eda2918bc4fa64045 100644 (file)
@@ -2,30 +2,30 @@ INCLUDE(Common)
 SET(CMAKE_AUTOMOC ON)
 
 SET(PROJECT_HEADERS
-    ModuleBase.h
+       ModuleBase.h
        ModuleBase_IOperation.h
        ModuleBase_Operation.h
        ModuleBase_OperationDescription.h       
        ModuleBase_ModelWidget.h
+       ModuleBase_WidgetBoolValue.h
+       ModuleBase_WidgetDoubleValue.h
        ModuleBase_WidgetFactory.h
        ModuleBase_WidgetPoint2D.h
        ModuleBase_WidgetSwitch.h
-       ModuleBase_MetaWidget.h
-    ModuleBase_SelectorWidget.h
-    ModuleBase_IWorkshop.h
-    ModuleBase_Widgets.h
+       ModuleBase_SelectorWidget.h
+       ModuleBase_IWorkshop.h
 )
 
 SET(PROJECT_SOURCES
        ModuleBase_IOperation.cpp
        ModuleBase_Operation.cpp
        ModuleBase_OperationDescription.cpp
+       ModuleBase_WidgetBoolValue.cpp
+       ModuleBase_WidgetDoubleValue.cpp
        ModuleBase_WidgetFactory.cpp
        ModuleBase_WidgetPoint2D.cpp
        ModuleBase_WidgetSwitch.cpp
-       ModuleBase_MetaWidget.cpp
-    ModuleBase_SelectorWidget.cpp
-    ModuleBase_Widgets.cpp
+       ModuleBase_SelectorWidget.cpp
 )
 
 SET(PROJECT_LIBRARIES
diff --git a/src/ModuleBase/ModuleBase_MetaWidget.cpp b/src/ModuleBase/ModuleBase_MetaWidget.cpp
deleted file mode 100644 (file)
index ba8eb26..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- */
-
-#include <ModuleBase_MetaWidget.h>
-#include <QMetaObject>
-
-#ifdef _DEBUG
-#include <iostream>
-#endif
-
-ModuleBase_MetaWidget::ModuleBase_MetaWidget(QWidget* theWrapped)
-    : ModuleBase_ModelWidget(theWrapped->parent()),
-      myWrappedWidget(theWrapped)
-{
-
-}
-
-ModuleBase_MetaWidget::~ModuleBase_MetaWidget()
-{
-
-}
-
-bool ModuleBase_MetaWidget::storeValue(FeaturePtr theFeature)
-{
-  #ifdef _DEBUG
-  std::cout << "ModuleBase_MetaWidget::storeValue"
-            << myWrappedWidget->metaObject()->className() << std::endl;
-  #endif
-  return true;
-}
-
-bool ModuleBase_MetaWidget::restoreValue(FeaturePtr theFeature)
-{
-  #ifdef _DEBUG
-  std::cout << "ModuleBase_MetaWidget::restoreValue"
-            << myWrappedWidget->metaObject()->className() << std::endl;
-  #endif
-  return true;
-}
-
-bool ModuleBase_MetaWidget::focusTo(const std::string& theAttributeName)
-{
-  #ifdef _DEBUG
-  std::cout << "ModuleBase_MetaWidget::focusTo"
-            << myWrappedWidget->metaObject()->className() << std::endl;
-  #endif
-  return true;
-}
-
-QList<QWidget*> ModuleBase_MetaWidget::getControls() const
-{
-  return QList<QWidget*>();
-}
diff --git a/src/ModuleBase/ModuleBase_MetaWidget.h b/src/ModuleBase/ModuleBase_MetaWidget.h
deleted file mode 100644 (file)
index 42504e0..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- */
-
-#ifndef MODULEBASE_METAWIDGET_H_
-#define MODULEBASE_METAWIDGET_H_
-
-#include <ModuleBase.h>
-#include <ModuleBase_ModelWidget.h>
-
-#include <ModelAPI_Feature.h>
-
-#include <QWidget>
-
-#include <boost/shared_ptr.hpp>
-
-/*
- *
- */
-class ModuleBase_MetaWidget : public ModuleBase_ModelWidget
-{
-public:
-  MODULEBASE_EXPORT ModuleBase_MetaWidget(QWidget* theWrapped);
-  virtual ~ModuleBase_MetaWidget();
-  //! Interface for saving widget's data into the data model
-  MODULEBASE_EXPORT virtual bool storeValue(FeaturePtr theFeature);
-  //! Interface for loading widget's data from the data model
-  MODULEBASE_EXPORT virtual bool restoreValue(FeaturePtr theFeature);
-
-  /// Set focus to the current widget if it corresponds to the given attribute
-  /// \param theAttribute name
-  MODULEBASE_EXPORT virtual bool focusTo(const std::string& theAttributeName);
-
-  /// Returns list of widget controls
-  /// \return a control list
-  virtual QList<QWidget*> getControls() const;
-
-private:
-  QWidget* myWrappedWidget;
-};
-
-#endif /* MODULEBASE_METAWIDGET_H_ */
diff --git a/src/ModuleBase/ModuleBase_WidgetBoolValue.cpp b/src/ModuleBase/ModuleBase_WidgetBoolValue.cpp
new file mode 100644 (file)
index 0000000..d55bd18
--- /dev/null
@@ -0,0 +1,76 @@
+// File:        ModuleBase_Widgets.h
+// Created:     04 June 2014
+// Author:      Vitaly Smetannikov
+
+#include <ModuleBase_WidgetBoolValue.h>
+
+#include <ModelAPI_AttributeDouble.h>
+#include <ModelAPI_AttributeBoolean.h>
+#include <ModelAPI_Data.h>
+
+#include <Config_Keywords.h>
+#include <Config_WidgetAPI.h>
+
+#include <Events_Loop.h>
+#include <Model_Events.h>
+
+#include <QWidget>
+#include <QLayout>
+#include <QLabel>
+#include <QDoubleSpinBox>
+#include <QCheckBox>
+
+ModuleBase_WidgetBoolValue::ModuleBase_WidgetBoolValue(QWidget* theParent, const Config_WidgetAPI* theData)
+  : ModuleBase_ModelWidget(theParent)
+{
+  myAttributeID = theData->widgetId();
+  QString aText = QString::fromStdString(theData->widgetLabel());
+  QString aToolTip = QString::fromStdString(theData->widgetTooltip());
+  QString aDefault = QString::fromStdString(theData->getProperty("default"));
+
+  myCheckBox = new QCheckBox(aText, theParent);
+  myCheckBox->setToolTip(aToolTip);
+  myCheckBox->setChecked(aDefault == "true");
+
+  connect(myCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(valuesChanged()));
+}
+
+ModuleBase_WidgetBoolValue::~ModuleBase_WidgetBoolValue()
+{
+}
+
+QWidget* ModuleBase_WidgetBoolValue::getControl() const 
+{ 
+  return myCheckBox; 
+}
+
+bool ModuleBase_WidgetBoolValue::storeValue(FeaturePtr theFeature) const
+{
+  DataPtr aData = theFeature->data();
+  boost::shared_ptr<ModelAPI_AttributeBoolean> aBool = aData->boolean(myAttributeID);
+
+  if (aBool->value() != myCheckBox->isChecked()) {
+    aBool->setValue(myCheckBox->isChecked());
+    Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_FEATURE_UPDATED));
+  }
+  return true;
+}
+
+bool ModuleBase_WidgetBoolValue::restoreValue(FeaturePtr theFeature)
+{
+  DataPtr aData = theFeature->data();
+  boost::shared_ptr<ModelAPI_AttributeBoolean> aRef = aData->boolean(myAttributeID);
+
+  bool isBlocked = myCheckBox->blockSignals(true);
+  myCheckBox->setChecked(aRef->value());
+  myCheckBox->blockSignals(isBlocked);
+
+  return true;
+}
+
+QList<QWidget*> ModuleBase_WidgetBoolValue::getControls() const
+{
+  QList<QWidget*> aList;
+  aList.append(myCheckBox);
+  return aList;
+}
diff --git a/src/ModuleBase/ModuleBase_WidgetBoolValue.h b/src/ModuleBase/ModuleBase_WidgetBoolValue.h
new file mode 100644 (file)
index 0000000..8753c4c
--- /dev/null
@@ -0,0 +1,45 @@
+// File:        ModuleBase_WidgetBoolValue.h
+// Created:     04 June 2014
+// Author:      Vitaly Smetannikov
+
+#ifndef ModuleBase_WidgetBoolValue_H
+#define ModuleBase_WidgetBoolValue_H
+
+#include "ModuleBase.h"
+#include "ModuleBase_ModelWidget.h"
+
+class Config_WidgetAPI;
+class QWidget;
+class QLabel;
+class QDoubleSpinBox;
+class QCheckBox;
+
+class MODULEBASE_EXPORT ModuleBase_WidgetBoolValue: public ModuleBase_ModelWidget
+{
+  Q_OBJECT
+public:
+  ModuleBase_WidgetBoolValue(QWidget* theParent, const Config_WidgetAPI* theData);
+
+  virtual ~ModuleBase_WidgetBoolValue();
+
+  /// Saves the internal parameters to the given feature
+  /// \param theFeature a model feature to be changed
+  virtual bool storeValue(FeaturePtr theFeature) const;
+
+  virtual bool restoreValue(FeaturePtr theFeature);
+
+  /// Returns list of widget controls
+  /// \return a control list
+  virtual QList<QWidget*> getControls() const;
+
+  /// Returns the internal parent wiget control, that can be shown anywhere
+  /// \returns the widget
+  QWidget* getControl() const;
+
+private:
+  std::string myAttributeID;
+  
+  QCheckBox* myCheckBox;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp
new file mode 100644 (file)
index 0000000..d65091f
--- /dev/null
@@ -0,0 +1,113 @@
+// File:        ModuleBase_Widgets.h
+// Created:     04 June 2014
+// Author:      Vitaly Smetannikov
+
+#include <ModuleBase_WidgetDoubleValue.h>
+
+#include <ModelAPI_AttributeDouble.h>
+#include <ModelAPI_AttributeBoolean.h>
+#include <ModelAPI_Data.h>
+
+#include <Config_Keywords.h>
+#include <Config_WidgetAPI.h>
+
+#include <Events_Loop.h>
+#include <Model_Events.h>
+
+#include <QWidget>
+#include <QLayout>
+#include <QLabel>
+#include <QDoubleSpinBox>
+#include <QCheckBox>
+
+
+ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent, const Config_WidgetAPI* theData)
+  : ModuleBase_ModelWidget(theParent)
+{
+  myContainer = new QWidget(theParent);
+  QHBoxLayout* aControlLay = new QHBoxLayout(myContainer);
+  aControlLay->setContentsMargins(0, 0, 0, 0);
+
+  QString aLabelText = QString::fromStdString(theData->widgetLabel());
+  QString aLabelIcon = QString::fromStdString(theData->widgetIcon());
+  myLabel = new QLabel(aLabelText, myContainer);
+  myLabel->setPixmap(QPixmap(aLabelIcon));
+  aControlLay->addWidget(myLabel);
+
+  myAttributeID = theData->widgetId();
+  mySpinBox = new QDoubleSpinBox(myContainer);
+  QString anObjName = QString::fromStdString(myAttributeID);
+  mySpinBox->setObjectName(anObjName);
+
+  bool isOk = false;
+  std::string aProp = theData->getProperty(DOUBLE_WDG_MIN);
+  double aMinVal = QString::fromStdString(aProp).toDouble(&isOk);
+  if (isOk) {
+    mySpinBox->setMinimum(aMinVal);
+  } else {
+    mySpinBox->setMinimum(-DBL_MAX);
+  }
+
+  aProp = theData->getProperty(DOUBLE_WDG_MAX);
+  double aMaxVal = QString::fromStdString(aProp).toDouble(&isOk);
+  if (isOk) {
+    mySpinBox->setMaximum(aMaxVal);
+  } else {
+    mySpinBox->setMaximum(DBL_MAX);
+  }
+
+  aProp = theData->getProperty(DOUBLE_WDG_STEP);
+  double aStepVal = QString::fromStdString(aProp).toDouble(&isOk);
+  if (isOk) {
+    mySpinBox->setSingleStep(aStepVal);
+  }
+
+  aProp = theData->getProperty(DOUBLE_WDG_DFLT);
+  double aDefVal = QString::fromStdString(aProp).toDouble(&isOk);
+  if (isOk) {
+    mySpinBox->setValue(aDefVal);
+  }
+
+  QString aTTip = QString::fromStdString(theData->widgetTooltip());
+  mySpinBox->setToolTip(aTTip);
+
+  aControlLay->addWidget(mySpinBox);
+  aControlLay->setStretch(1, 1);
+
+  connect(mySpinBox, SIGNAL(valueChanged(double)), this, SIGNAL(valuesChanged()));
+}
+
+ModuleBase_WidgetDoubleValue::~ModuleBase_WidgetDoubleValue()
+{
+}
+
+bool ModuleBase_WidgetDoubleValue::storeValue(FeaturePtr theFeature) const
+{
+  DataPtr aData = theFeature->data();
+  boost::shared_ptr<ModelAPI_AttributeDouble> aReal = aData->real(myAttributeID);
+  if (aReal->value() != mySpinBox->value()) {
+    aReal->setValue(mySpinBox->value());
+    Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_FEATURE_UPDATED));
+  }
+  return true;
+}
+
+bool ModuleBase_WidgetDoubleValue::restoreValue(FeaturePtr theFeature)
+{
+  DataPtr aData = theFeature->data();
+  boost::shared_ptr<ModelAPI_AttributeDouble> aRef = aData->real(myAttributeID);
+
+  bool isBlocked = mySpinBox->blockSignals(true);
+  mySpinBox->setValue(aRef->value());
+  mySpinBox->blockSignals(isBlocked);
+
+  return true;
+}
+
+QList<QWidget*> ModuleBase_WidgetDoubleValue::getControls() const
+{
+  QList<QWidget*> aList;
+  aList.append(myLabel);
+  aList.append(mySpinBox);
+  return aList;
+}
diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.h b/src/ModuleBase/ModuleBase_WidgetDoubleValue.h
new file mode 100644 (file)
index 0000000..caab195
--- /dev/null
@@ -0,0 +1,47 @@
+// File:        ModuleBase_WidgetDoubleValue.h
+// Created:     04 June 2014
+// Author:      Vitaly Smetannikov
+
+#ifndef ModuleBase_WidgetDoubleValue_H
+#define ModuleBase_WidgetDoubleValue_H
+
+#include "ModuleBase.h"
+#include "ModuleBase_ModelWidget.h"
+
+class Config_WidgetAPI;
+class QWidget;
+class QLabel;
+class QDoubleSpinBox;
+class QCheckBox;
+
+class MODULEBASE_EXPORT ModuleBase_WidgetDoubleValue: public ModuleBase_ModelWidget
+{
+  Q_OBJECT
+public:
+  ModuleBase_WidgetDoubleValue(QWidget* theParent, const Config_WidgetAPI* theData);
+
+  virtual ~ModuleBase_WidgetDoubleValue();
+
+  /// Saves the internal parameters to the given feature
+  /// \param theFeature a model feature to be changed
+  virtual bool storeValue(FeaturePtr theFeature) const;
+
+  virtual bool restoreValue(FeaturePtr theFeature);
+
+  /// Returns list of widget controls
+  /// \return a control list
+  virtual QList<QWidget*> getControls() const;
+
+  /// Returns the internal parent wiget control, that can be shown anywhere
+  /// \returns the widget
+  QWidget* getControl() const { return myContainer; }
+
+private:
+  std::string myAttributeID;
+  
+  QWidget*     myContainer;
+  QLabel*      myLabel;
+  QDoubleSpinBox* mySpinBox;
+};
+
+#endif
\ No newline at end of file
index 63646b9565474d81917db69ca089bd0cf30155bb..1f2f6a673f3fe603a9b8df7adca4f5400123a1b3 100644 (file)
@@ -12,7 +12,8 @@
 #include <ModuleBase_WidgetPoint2D.h>
 #include <ModuleBase_WidgetSwitch.h>
 #include <ModuleBase_SelectorWidget.h>
-#include <ModuleBase_Widgets.h>
+#include <ModuleBase_WidgetDoubleValue.h>
+#include <ModuleBase_WidgetBoolValue.h>
 
 #include <Config_Keywords.h>
 #include <Config_WidgetAPI.h>
@@ -149,7 +150,7 @@ QWidget* ModuleBase_WidgetFactory::createContainer(const std::string& theType, Q
 
 QWidget* ModuleBase_WidgetFactory::doubleSpinBoxControl(QWidget* theParent)
 {
-  ModuleBase_DoubleValueWidget* aDblWgt = new ModuleBase_DoubleValueWidget(theParent, myWidgetApi);
+  ModuleBase_WidgetDoubleValue* aDblWgt = new ModuleBase_WidgetDoubleValue(theParent, myWidgetApi);
   QObject::connect(aDblWgt, SIGNAL(valuesChanged()),  myOperation, SLOT(storeCustomValue()));
 
   myModelWidgets.append(aDblWgt);
@@ -203,7 +204,7 @@ QWidget* ModuleBase_WidgetFactory::selectorControl(QWidget* theParent)
 
 QWidget* ModuleBase_WidgetFactory::booleanControl(QWidget* theParent)
 {
-  ModuleBase_BoolValueWidget* aBoolWgt = new ModuleBase_BoolValueWidget(theParent, myWidgetApi);
+  ModuleBase_WidgetBoolValue* aBoolWgt = new ModuleBase_WidgetBoolValue(theParent, myWidgetApi);
   QObject::connect(aBoolWgt, SIGNAL(valuesChanged()),  myOperation, SLOT(storeCustomValue()));
 
   myModelWidgets.append(aBoolWgt);
diff --git a/src/ModuleBase/ModuleBase_Widgets.cpp b/src/ModuleBase/ModuleBase_Widgets.cpp
deleted file mode 100644 (file)
index 0d810ec..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-// File:        ModuleBase_Widgets.h
-// Created:     04 June 2014
-// Author:      Vitaly Smetannikov
-
-#include "ModuleBase_Widgets.h"
-
-#include <ModelAPI_AttributeDouble.h>
-#include <ModelAPI_AttributeBoolean.h>
-#include <ModelAPI_Data.h>
-
-#include <Config_Keywords.h>
-#include <Config_WidgetAPI.h>
-
-#include <Events_Loop.h>
-#include <Model_Events.h>
-
-#include <QWidget>
-#include <QLayout>
-#include <QLabel>
-#include <QDoubleSpinBox>
-#include <QCheckBox>
-
-
-ModuleBase_DoubleValueWidget::ModuleBase_DoubleValueWidget(QWidget* theParent, const Config_WidgetAPI* theData)
-  : ModuleBase_ModelWidget(theParent)
-{
-  myContainer = new QWidget(theParent);
-  QHBoxLayout* aControlLay = new QHBoxLayout(myContainer);
-  aControlLay->setContentsMargins(0, 0, 0, 0);
-
-  QString aLabelText = QString::fromStdString(theData->widgetLabel());
-  QString aLabelIcon = QString::fromStdString(theData->widgetIcon());
-  myLabel = new QLabel(aLabelText, myContainer);
-  myLabel->setPixmap(QPixmap(aLabelIcon));
-  aControlLay->addWidget(myLabel);
-
-  myAttributeID = theData->widgetId();
-  mySpinBox = new QDoubleSpinBox(myContainer);
-  QString anObjName = QString::fromStdString(myAttributeID);
-  mySpinBox->setObjectName(anObjName);
-
-  bool isOk = false;
-  std::string aProp = theData->getProperty(DOUBLE_WDG_MIN);
-  double aMinVal = QString::fromStdString(aProp).toDouble(&isOk);
-  if (isOk) {
-    mySpinBox->setMinimum(aMinVal);
-  } else {
-    mySpinBox->setMinimum(-DBL_MAX);
-  }
-
-  aProp = theData->getProperty(DOUBLE_WDG_MAX);
-  double aMaxVal = QString::fromStdString(aProp).toDouble(&isOk);
-  if (isOk) {
-    mySpinBox->setMaximum(aMaxVal);
-  } else {
-    mySpinBox->setMaximum(DBL_MAX);
-  }
-
-  aProp = theData->getProperty(DOUBLE_WDG_STEP);
-  double aStepVal = QString::fromStdString(aProp).toDouble(&isOk);
-  if (isOk) {
-    mySpinBox->setSingleStep(aStepVal);
-  }
-
-  aProp = theData->getProperty(DOUBLE_WDG_DFLT);
-  double aDefVal = QString::fromStdString(aProp).toDouble(&isOk);
-  if (isOk) {
-    mySpinBox->setValue(aDefVal);
-  }
-
-  QString aTTip = QString::fromStdString(theData->widgetTooltip());
-  mySpinBox->setToolTip(aTTip);
-
-  aControlLay->addWidget(mySpinBox);
-  aControlLay->setStretch(1, 1);
-
-  connect(mySpinBox, SIGNAL(valueChanged(double)), this, SIGNAL(valuesChanged()));
-}
-
-ModuleBase_DoubleValueWidget::~ModuleBase_DoubleValueWidget()
-{
-}
-
-bool ModuleBase_DoubleValueWidget::storeValue(FeaturePtr theFeature) const
-{
-  DataPtr aData = theFeature->data();
-  boost::shared_ptr<ModelAPI_AttributeDouble> aReal = aData->real(myAttributeID);
-  if (aReal->value() != mySpinBox->value()) {
-    aReal->setValue(mySpinBox->value());
-    Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_FEATURE_UPDATED));
-  }
-  return true;
-}
-
-bool ModuleBase_DoubleValueWidget::restoreValue(FeaturePtr theFeature)
-{
-  DataPtr aData = theFeature->data();
-  boost::shared_ptr<ModelAPI_AttributeDouble> aRef = aData->real(myAttributeID);
-
-  bool isBlocked = mySpinBox->blockSignals(true);
-  mySpinBox->setValue(aRef->value());
-  mySpinBox->blockSignals(isBlocked);
-
-  return true;
-}
-
-QList<QWidget*> ModuleBase_DoubleValueWidget::getControls() const
-{
-  QList<QWidget*> aList;
-  aList.append(myLabel);
-  aList.append(mySpinBox);
-  return aList;
-}
-
-
-//////////////////////////////////////////////////////////////////////////////////
-ModuleBase_BoolValueWidget::ModuleBase_BoolValueWidget(QWidget* theParent, const Config_WidgetAPI* theData)
-  : ModuleBase_ModelWidget(theParent)
-{
-  myAttributeID = theData->widgetId();
-  QString aText = QString::fromStdString(theData->widgetLabel());
-  QString aToolTip = QString::fromStdString(theData->widgetTooltip());
-  QString aDefault = QString::fromStdString(theData->getProperty("default"));
-
-  myCheckBox = new QCheckBox(aText, theParent);
-  myCheckBox->setToolTip(aToolTip);
-  myCheckBox->setChecked(aDefault == "true");
-
-  connect(myCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(valuesChanged()));
-}
-
-ModuleBase_BoolValueWidget::~ModuleBase_BoolValueWidget()
-{
-}
-
-QWidget* ModuleBase_BoolValueWidget::getControl() const 
-{ 
-  return myCheckBox; 
-}
-
-bool ModuleBase_BoolValueWidget::storeValue(FeaturePtr theFeature) const
-{
-  DataPtr aData = theFeature->data();
-  boost::shared_ptr<ModelAPI_AttributeBoolean> aBool = aData->boolean(myAttributeID);
-
-  if (aBool->value() != myCheckBox->isChecked()) {
-    aBool->setValue(myCheckBox->isChecked());
-    Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_FEATURE_UPDATED));
-  }
-  return true;
-}
-
-bool ModuleBase_BoolValueWidget::restoreValue(FeaturePtr theFeature)
-{
-  DataPtr aData = theFeature->data();
-  boost::shared_ptr<ModelAPI_AttributeBoolean> aRef = aData->boolean(myAttributeID);
-
-  bool isBlocked = myCheckBox->blockSignals(true);
-  myCheckBox->setChecked(aRef->value());
-  myCheckBox->blockSignals(isBlocked);
-
-  return true;
-}
-
-QList<QWidget*> ModuleBase_BoolValueWidget::getControls() const
-{
-  QList<QWidget*> aList;
-  aList.append(myCheckBox);
-  return aList;
-}
diff --git a/src/ModuleBase/ModuleBase_Widgets.h b/src/ModuleBase/ModuleBase_Widgets.h
deleted file mode 100644 (file)
index d8030f9..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-// File:        ModuleBase_Widgets.h
-// Created:     04 June 2014
-// Author:      Vitaly Smetannikov
-
-#ifndef ModuleBase_Widgets_H
-#define ModuleBase_Widgets_H
-
-#include "ModuleBase.h"
-#include "ModuleBase_ModelWidget.h"
-
-class Config_WidgetAPI;
-class QWidget;
-class QLabel;
-class QDoubleSpinBox;
-class QCheckBox;
-
-class MODULEBASE_EXPORT ModuleBase_DoubleValueWidget: public ModuleBase_ModelWidget
-{
-  Q_OBJECT
-public:
-  ModuleBase_DoubleValueWidget(QWidget* theParent, const Config_WidgetAPI* theData);
-
-  virtual ~ModuleBase_DoubleValueWidget();
-
-  /// Saves the internal parameters to the given feature
-  /// \param theFeature a model feature to be changed
-  virtual bool storeValue(FeaturePtr theFeature) const;
-
-  virtual bool restoreValue(FeaturePtr theFeature);
-
-  /// Returns list of widget controls
-  /// \return a control list
-  virtual QList<QWidget*> getControls() const;
-
-  /// Returns the internal parent wiget control, that can be shown anywhere
-  /// \returns the widget
-  QWidget* getControl() const { return myContainer; }
-
-private:
-  std::string myAttributeID;
-  
-  QWidget*     myContainer;
-  QLabel*      myLabel;
-  QDoubleSpinBox* mySpinBox;
-};
-
-
-//////////////////////////////////////////////////////////////////////////////////
-
-class MODULEBASE_EXPORT ModuleBase_BoolValueWidget: public ModuleBase_ModelWidget
-{
-  Q_OBJECT
-public:
-  ModuleBase_BoolValueWidget(QWidget* theParent, const Config_WidgetAPI* theData);
-
-  virtual ~ModuleBase_BoolValueWidget();
-
-  /// Saves the internal parameters to the given feature
-  /// \param theFeature a model feature to be changed
-  virtual bool storeValue(FeaturePtr theFeature) const;
-
-  virtual bool restoreValue(FeaturePtr theFeature);
-
-  /// Returns list of widget controls
-  /// \return a control list
-  virtual QList<QWidget*> getControls() const;
-
-  /// Returns the internal parent wiget control, that can be shown anywhere
-  /// \returns the widget
-  QWidget* getControl() const;
-
-private:
-  std::string myAttributeID;
-  
-  QCheckBox* myCheckBox;
-};
-
-#endif
\ No newline at end of file