]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Provide editing flag for widgets
authorvsv <vitaly.smetannikov@opencascade.com>
Mon, 22 Dec 2014 15:59:28 +0000 (18:59 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 22 Dec 2014 15:59:28 +0000 (18:59 +0300)
src/ModuleBase/ModuleBase_IPropertyPanel.h
src/ModuleBase/ModuleBase_ModelWidget.h
src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp
src/PartSet/PartSet_WidgetPoint2d.cpp
src/XGUI/XGUI_PropertyPanel.cpp
src/XGUI/XGUI_PropertyPanel.h

index fdac20d135efb252e1fbd54b82a3ac17938d5fc5..77b65f2d6b0aeab6537ac9b6aef5126dc57efe80 100644 (file)
@@ -30,7 +30,7 @@ public:
   virtual const QList<ModuleBase_ModelWidget*>& modelWidgets() const = 0;
 
   /// Editing mode depends on mode of current operation. This value is defined by it.
-  void setEditingMode(bool isEditing) { myIsEditing = isEditing; }
+  virtual void setEditingMode(bool isEditing) { myIsEditing = isEditing; }
   bool isEditingMode() const { return myIsEditing; }
 
   /// Set Enable/Disable state of Ok button
index e2f23438474bb32d0d1e91f814f507a7eac47633..15a0c5b2a0b1865367690be3259fb972d1a5f60f 100644 (file)
@@ -123,6 +123,10 @@ Q_OBJECT
     myFeature = theFeature;
   }
 
+  /// Editing mode depends on mode of current operation. This value is defined by it.
+  void setEditingMode(bool isEditing) { myIsEditing = isEditing; }
+  bool isEditingMode() const { return myIsEditing; }
+
 signals:
   /// The signal about widget values changed
   void valuesChanged();
@@ -155,6 +159,8 @@ signals:
 
   bool myIsComputedDefault; /// Value should be computed on execute,
                             /// like radius for circle's constraint (can not be zero)
+
+  bool myIsEditing;
 };
 
 #endif
index 73f1f9057ee7b8b31a053a424c14a06bc6d48557..ba0f248af5dfabce8c8d9dcb2e65bb4de1b0bcb8 100644 (file)
@@ -444,19 +444,6 @@ void ModuleBase_WidgetShapeSelector::raisePanel() const
   }
 }
 
-//********************************************************************
-//bool ModuleBase_WidgetShapeSelector::setSelection(ModuleBase_ViewerPrs theValue)
-//{
-//  if (theValue.object()) {
-//    ObjectPtr aObject = theValue.object();
-//    if (acceptObjectShape(aObject)) {
-//      setObject(aObject);
-//      return true;
-//    }
-//  }
-//  return false;
-//}
-
 //********************************************************************
 void ModuleBase_WidgetShapeSelector::activate()
 {
index 8079d4885d32cdcf3295c06d15d9673c37c1f302..ad30fc24800b52b74abc58ee19c58c7060defe78 100644 (file)
@@ -256,6 +256,8 @@ void PartSet_WidgetPoint2D::onMouseRelease(ModuleBase_IViewWindow* theWnd, QMous
 
 void PartSet_WidgetPoint2D::onMouseMove(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)
 {
+  if (isEditingMode())
+    return;
   myWorkshop->operationMgr()->setLockValidating(true);
   myWorkshop->propertyPanel()->setOkEnabled(false);
 
index c3d200d41ae5f130f517a4802598062eafcd772e..2249d12a045e6c20f4a20f0ede0eb44cddf1c20b 100644 (file)
@@ -246,4 +246,10 @@ bool XGUI_PropertyPanel::isCancelEnabled() const
   return anCancelBtn->isEnabled();
 }
 
-
+void XGUI_PropertyPanel::setEditingMode(bool isEditing)
+{
+  ModuleBase_IPropertyPanel::setEditingMode(isEditing);
+  foreach(ModuleBase_ModelWidget* aWgt, myWidgets) {
+    aWgt->setEditingMode(isEditing);
+  }
+}
index 071779431999597d0f990657037c22dc8690f43f..1bd6e71be524168cc82d942f83ac66427bbfe083 100644 (file)
@@ -71,6 +71,9 @@ Q_OBJECT
   /// Returns state of Ok button
   virtual bool isCancelEnabled() const;
 
+  /// Editing mode depends on mode of current operation. This value is defined by it.
+  virtual void setEditingMode(bool isEditing);
+
  public slots:
   void updateContentWidget(FeaturePtr theFeature);
   // Enables / disables "ok" ("accept") button
@@ -81,13 +84,6 @@ Q_OBJECT
   // emits widgetActivated(theWidget) signal
   virtual void activateWidget(ModuleBase_ModelWidget* theWidget);
 
- signals:
-  /// Signal about the point 2d set to the feature
-  /// \param the feature
-  /// \param the attribute of the feature
-  //void storedPoint2D(ObjectPtr theFeature, const std::string& theAttribute);
-
-
  private:
   QWidget* myCustomWidget;
   QList<ModuleBase_ModelWidget*> myWidgets;