Salome HOME
Initial version of redesign of working with results
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetFeature.cpp
index fc095adedfd09f19890490542e91170832f27c47..7e43f4f5506b512cb5ff690b1413b9946885a61a 100644 (file)
@@ -4,6 +4,9 @@
 
 #include <ModuleBase_WidgetFeature.h>
 
+#include <ModuleBase_WidgetValueFeature.h>
+#include <ModuleBase_WidgetValue.h>
+
 #include <Config_Keywords.h>
 #include <Config_WidgetAPI.h>
 
@@ -52,6 +55,19 @@ ModuleBase_WidgetFeature::~ModuleBase_WidgetFeature()
 {
 }
 
+bool ModuleBase_WidgetFeature::setValue(ModuleBase_WidgetValue* theValue)
+{
+  bool isDone = false;
+
+  if (theValue) {
+    ModuleBase_WidgetValueFeature* aFeatureValue = 
+                         dynamic_cast<ModuleBase_WidgetValueFeature*>(theValue);
+    if (aFeatureValue)
+      isDone = setFeature(aFeatureValue->feature());
+  }
+  return isDone;
+}
+
 bool ModuleBase_WidgetFeature::setFeature(const FeaturePtr& theFeature)
 {
   if (!theFeature || !myFeatureKinds.contains(theFeature->getKind().c_str()))
@@ -72,7 +88,7 @@ bool ModuleBase_WidgetFeature::storeValue(FeaturePtr theFeature) const
   ModuleBase_WidgetFeature* that = (ModuleBase_WidgetFeature*) this;
   aRef->setFeature(myFeature);
   theFeature->execute();
-  Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_FEATURE_UPDATED));
+  Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
 
   return true;
 }