Salome HOME
Fix for the issue #2808 : Documentation on the "Groups" panel. Added description...
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetEditor.cpp
index 6fcd6cf784993c810673e7768dfa7223868b3d0f..adadd23b0f24dc6a7e3dda54df8915005ed70247 100644 (file)
@@ -52,7 +52,10 @@ class ModuleBase_EditorDialog : public QDialog
 {
 public:
   ModuleBase_EditorDialog(QWidget* theParent, Qt::WindowFlags theFlags)
-    : QDialog(theParent, theFlags) {}
+    : QDialog(theParent, theFlags)
+  {
+    setMinimumWidth(100);
+  }
   ~ModuleBase_EditorDialog() {}
 
 protected:
@@ -75,7 +78,8 @@ ModuleBase_WidgetEditor::~ModuleBase_WidgetEditor()
 {
 }
 
-bool ModuleBase_WidgetEditor::editedValue(double& outValue, QString& outText)
+bool ModuleBase_WidgetEditor::editedValue(double theSpinMinValue, double theSpinMaxValue,
+                                          double& outValue, QString& outText)
 {
   bool isValueAccepted = false;
 
@@ -85,8 +89,13 @@ bool ModuleBase_WidgetEditor::editedValue(double& outValue, QString& outText)
   aLay->setContentsMargins(2, 2, 2, 2);
 
   ModuleBase_ParamSpinBox* anEditor = new ModuleBase_ParamSpinBox(myEditorDialog);
-  anEditor->setMinimum(0);
-  anEditor->setMaximum(DBL_MAX);
+  anEditor->setMinimum(theSpinMinValue);
+  anEditor->setMaximum(theSpinMaxValue);
+
+  QStringList aParameters;
+  ModuleBase_Tools::getParameters(aParameters);
+  anEditor->setCompletionList(aParameters);
+
   if (outText.isEmpty())
     anEditor->setValue(outValue);
   else
@@ -141,7 +150,7 @@ bool ModuleBase_WidgetEditor::showPopupEditor(const bool theSendSignals)
   if (mySpinBox->hasVariable())
     aText = mySpinBox->text();
 
-  isValueAccepted = editedValue(aValue, aText);
+  isValueAccepted = editedValue(mySpinBox->minimum(), mySpinBox->maximum(), aValue, aText);
   if (isValueAccepted) {
     if (aText.isEmpty()) {
       if (mySpinBox->hasVariable()) {