#include "PartSet_WidgetPoint2dDistance.h"
#include "PartSet_Tools.h"
-#include <ModuleBase_DoubleSpinBox.h>
+#include <ModuleBase_ParamSpinBox.h>
#include <ModuleBase_IViewWindow.h>
+#include <ModuleBase_Tools.h>
#include <XGUI_ViewerProxy.h>
#include <XGUI_Workshop.h>
{
}
+// 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)
{
AttributeDoublePtr aReal = aData->real(attributeID());
if (aReal && (aReal->value() != aRadius)) {
aReal->setValue(aRadius);
- mySpinBox->blockSignals(true);
- mySpinBox->setValue(aRadius);
- mySpinBox->blockSignals(false);
- emit valuesChanged();
+
+ ModuleBase_Tools::setSpinValue(mySpinBox, aRadius);
+ storeValue();
}
}
-void PartSet_WidgetPoint2dDistance::activate()
+void PartSet_WidgetPoint2dDistance::activateCustom()
{
XGUI_ViewerProxy* aViewer = myWorkshop->viewer();
connect(aViewer, SIGNAL(mouseMove(ModuleBase_IViewWindow*, QMouseEvent*)),
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;
void PartSet_WidgetPoint2dDistance::onMouseMove(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)
{
myWorkshop->operationMgr()->setLockValidating(true);
- myWorkshop->propertyPanel()->setOkEnabled(false);
+ myWorkshop->operationMgr()->setApplyEnabled(false);
gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theWnd->v3dView());