]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/PartSet/PartSet_WidgetPoint2dDistance.cpp
Salome HOME
Provide editing of parameters
[modules/shaper.git] / src / PartSet / PartSet_WidgetPoint2dDistance.cpp
index 14ac4592178c9bb0adae1f0cc05e963d1551ec2d..9da73baae95e48448ac950f7da75148ff736f551 100644 (file)
@@ -7,7 +7,7 @@
 #include "PartSet_WidgetPoint2dDistance.h"
 #include "PartSet_Tools.h"
 
-#include <ModuleBase_DoubleSpinBox.h>
+#include <ModuleBase_ParamSpinBox.h>
 #include <ModuleBase_IViewWindow.h>
 #include <ModuleBase_Tools.h>
 
@@ -41,13 +41,15 @@ PartSet_WidgetPoint2dDistance::~PartSet_WidgetPoint2dDistance()
 {
 }
 
-void PartSet_WidgetPoint2dDistance::reset()
-{
-  bool isOk;
-  double aDefValue = QString::fromStdString(getDefaultValue()).toDouble(&isOk);
-
-  ModuleBase_Tools::setSpinValue(mySpinBox, isOk ? aDefValue : 0.0);
-}
+// It is not clear a necesity of this method also it contradicts to scenario defined in parent class
+//void PartSet_WidgetPoint2dDistance::reset()
+//{
+//  bool isOk;
+//  double aDefValue = QString::fromStdString(getDefaultValue()).toDouble(&isOk);
+//
+//  ModuleBase_Tools::setSpinValue(mySpinBox, isOk ? aDefValue : 0.0);
+//  storeValueCustom();
+//}
 
 void PartSet_WidgetPoint2dDistance::setPoint(FeaturePtr theFeature,
                                              const std::shared_ptr<GeomAPI_Pnt2d>& thePnt)
@@ -89,6 +91,10 @@ void PartSet_WidgetPoint2dDistance::deactivate()
 
 void PartSet_WidgetPoint2dDistance::onMouseRelease(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)
 {
+  // the contex menu release by the right button should not be processed by this widget
+  if (theEvent->button() != Qt::LeftButton)
+    return;
+
   gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theWnd->v3dView());
 
   double aX, aY;