+ activateCustom();
+}
+
+void ModuleBase_ModelWidget::setDefaultValue(const std::string& theValue)
+{
+ myDefaultValue = theValue;
+}
+
+bool ModuleBase_ModelWidget::storeValue()
+{
+ emit beforeValuesChanged();
+ bool isDone = storeValueCustom();
+ emit afterValuesChanged();
+
+ return isDone;
+}
+
+void ModuleBase_ModelWidget::updateObject(ObjectPtr theObj) const
+{
+ Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
+ static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY);
+ ModelAPI_EventCreator::get()->sendUpdated(theObj, anEvent);
+}
+
+void ModuleBase_ModelWidget::moveObject(ObjectPtr theObj) const
+{
+ static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_MOVED);
+ ModelAPI_EventCreator::get()->sendUpdated(theObj, anEvent);
+ Events_Loop::loop()->flush(anEvent);
+}
+
+bool ModuleBase_ModelWidget::eventFilter(QObject* theObject, QEvent *theEvent)
+{
+ QWidget* aWidget = qobject_cast<QWidget*>(theObject);
+ if (theEvent->type() == QEvent::FocusIn) {
+ #ifdef _DEBUG
+ // The following two lines are for debugging purpose only
+ QFocusEvent* aFocusEvent = dynamic_cast<QFocusEvent*>(theEvent);
+ bool isWinFocus = aFocusEvent->reason() == Qt::ActiveWindowFocusReason;
+ #endif
+ if (getControls().contains(aWidget)) {
+ emit focusInWidget(this);
+ }
+ }
+ // pass the event on to the parent class
+
+ return QObject::eventFilter(theObject, theEvent);
+}
+
+//**************************************************************
+void ModuleBase_ModelWidget::onWidgetValuesChanged()
+{
+ storeValue();