+bool ModuleBase_WidgetEditor::showPopupEditor(const bool theSendSignals)
+{
+ bool isValueAccepted = false;
+ // we need to emit the focus in event manually in order to save the widget as an active
+ // in the property panel before the mouse leave event happens in the viewer. The module
+ // ask an active widget and change the feature visualization if the widget is not the current
+ // one. Also we need this widget as active to provide call of processEnter() applyed
+ // by operation manager to the current widget. If not, the myEditorDialog will stay opened
+ emitFocusInWidget();
+
+ // nds: it seems, that the envents processing is not necessary anymore
+ // White while all events will be processed
+ //QApplication::processEvents();
+ double aValue = mySpinBox->value();
+ QString aText;
+ if (mySpinBox->hasVariable())
+ aText = mySpinBox->text();
+
+ isValueAccepted = editedValue(mySpinBox->minimum(), mySpinBox->maximum(), aValue, aText);
+ if (isValueAccepted) {
+ if (aText.isEmpty()) {
+ if (mySpinBox->hasVariable()) {
+ // variable text should be cleared before setting value as the value
+ // will not be set if there is a varable in control
+ ModuleBase_Tools::setSpinText(mySpinBox, "");
+ }
+ ModuleBase_Tools::setSpinValue(mySpinBox, aValue);
+ } else {
+ ModuleBase_Tools::setSpinText(mySpinBox, aText);
+ }
+ if (theSendSignals) {
+ emit valuesChanged();
+ // the focus leaves the control automatically by the Enter/Esc event
+ // it is processed in operation manager
+ //emit focusOutWidget(this);
+ }
+ else
+ storeValue();
+ }
+ ModuleBase_Tools::setFocus(mySpinBox, "ModuleBase_WidgetEditor::editedValue");
+ mySpinBox->selectAll();
+ // enter is processed, so we need not anymore emit clicked signal
+ //if (theSendSignals && !myIsEditing && isValueAccepted)
+ // emit enterClicked(this);