]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #487: Creating a Sketch point at the origin
authornds <natalia.donis@opencascade.com>
Tue, 26 May 2015 11:26:28 +0000 (14:26 +0300)
committernds <natalia.donis@opencascade.com>
Tue, 26 May 2015 11:27:09 +0000 (14:27 +0300)
src/PartSet/PartSet_WidgetPoint2d.cpp
src/PartSet/PartSet_WidgetPoint2d.h

index a44b8c9eeadc9a0cc632bf414e388df871a0de60..1bdd8dc03d25fc4782730dbb6b024a4c632d92ca 100644 (file)
@@ -213,6 +213,7 @@ void PartSet_WidgetPoint2D::activateCustom()
           this, SLOT(onMouseMove(ModuleBase_IViewWindow*, QMouseEvent*)));
   connect(aViewer, SIGNAL(mouseRelease(ModuleBase_IViewWindow*, QMouseEvent*)), 
           this, SLOT(onMouseRelease(ModuleBase_IViewWindow*, QMouseEvent*)));
+  connect(aViewer, SIGNAL(leaveViewPort()), this, SLOT(onLeaveViewPort()));
 
   QIntList aModes;
   aModes << TopAbs_VERTEX;
@@ -227,6 +228,8 @@ void PartSet_WidgetPoint2D::deactivate()
              this, SLOT(onMouseMove(ModuleBase_IViewWindow*, QMouseEvent*)));
   disconnect(aViewer, SIGNAL(mouseRelease(ModuleBase_IViewWindow*, QMouseEvent*)), 
              this, SLOT(onMouseRelease(ModuleBase_IViewWindow*, QMouseEvent*)));
+  disconnect(aViewer, SIGNAL(leaveViewPort()), this, SLOT(onLeaveViewPort()));
+
   myWorkshop->moduleConnector()->deactivateSubShapesSelection();
   myWorkshop->operationMgr()->setLockValidating(false);
 }
@@ -350,6 +353,17 @@ void PartSet_WidgetPoint2D::onMouseMove(ModuleBase_IViewWindow* theWnd, QMouseEv
   setPoint(aX, anY);
 }
 
+void PartSet_WidgetPoint2D::onLeaveViewPort()
+{
+  // it is important to restore the validity state in the property panel after leaving the
+  // view port. Unlock the validating.
+  XGUI_OperationMgr* anOperationMgr = myWorkshop->operationMgr();
+  if (anOperationMgr->isValidationLocked()) {
+    anOperationMgr->setLockValidating(false);
+    anOperationMgr->onValidateOperation();
+  }
+}
+
 double PartSet_WidgetPoint2D::x() const
 {
   return myXSpin->value();
index a2fe2aa8df1b53afbc3caca4e3fccd53ddf55756..07e33c759c3c003a75e3468d34b590b0c35d49e1 100644 (file)
@@ -106,6 +106,9 @@ protected slots:
   /// \param theEvent a mouse event
   void onMouseRelease(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
 
+  /// Process mouse leave view port to update validity state of the property panel
+  void onLeaveViewPort();
+
 protected:
   /// Saves the internal parameters to the given feature
   /// \return True in success