]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Checking Enter processing functionality(with Delete processing). Sketch-Mirror featur...
authornds <nds@opencascade.com>
Wed, 13 Jan 2016 07:53:33 +0000 (10:53 +0300)
committernds <nds@opencascade.com>
Wed, 13 Jan 2016 07:53:33 +0000 (10:53 +0300)
src/ModuleBase/ModuleBase_IPropertyPanel.h
src/PartSet/PartSet_SketcherReetntrantMgr.cpp
src/XGUI/XGUI_PropertyPanel.cpp
src/XGUI/XGUI_PropertyPanel.h

index afafce7a756ce91ae5cf7506d52d0b16f3b3691b..b5b302d2232d963d9d16b5fcb9b74a09bbe9afa0 100644 (file)
@@ -103,8 +103,10 @@ public slots:
   * highlighting from the previous active widget
   * emits widgetActivated(theWidget) signal
   * \param theWidget which has to be activated
+  * \param theEmitSignal a flag to prohibit signal emit
   */
-  virtual void activateWidget(ModuleBase_ModelWidget* theWidget) = 0;
+  virtual void activateWidget(ModuleBase_ModelWidget* theWidget,
+                              const bool theEmitSignal = true) = 0;
 
 protected:
 
index d491b9a57caa522a11cc426f09870d4c39e8b535..15cf843d3072df5989d5dd1d08db2db2f0d81a1e 100755 (executable)
@@ -332,6 +332,13 @@ bool PartSet_SketcherReetntrantMgr::startInternalEdit(const std::string& thePrev
             aPreviousAttributeWidget->selectContent();
           }
           else {
+            // in case of shape multi selector, the widget does not lose focus by filling
+            // like it is in shape selector. So, if enter is pressed, the multi shape selector
+            // control should be deactivated. The focus is moved to Apply button and there
+            // should not be active control visualized in property panel
+            if (aPreviousAttributeWidget == aPanel->activeWidget()) {
+              aPanel->activateWidget(NULL, false);
+            }
             // if there is no the next widget to be automatically activated, the Ok button in property
             // panel should accept the focus(example is parallel constraint on sketch lines)
             QToolButton* anOkBtn = aPanel->findChild<QToolButton*>(PROP_PANEL_OK);
index fcb16a3764fbe6231225b5eafd122e4f48ce9194..2ebf8973f72d2e5e922eab8d92f87f8281bd8f07 100755 (executable)
@@ -359,14 +359,14 @@ void XGUI_PropertyPanel::activateNextWidget()
   activateNextWidget(myActiveWidget);
 }
 
-void XGUI_PropertyPanel::activateWidget(ModuleBase_ModelWidget* theWidget)
+void XGUI_PropertyPanel::activateWidget(ModuleBase_ModelWidget* theWidget, const bool theEmitSignal)
 {
   std::string aPreviosAttributeID;
   if(myActiveWidget)
     aPreviosAttributeID = myActiveWidget->attributeID();
 
   // Avoid activation of already actve widget. It could happen on focusIn event many times
-  if (setActiveWidget(theWidget)) {
+  if (setActiveWidget(theWidget) && theEmitSignal) {
     emit widgetActivated(myActiveWidget);
     if (!myActiveWidget && !isEditingMode()) {
       emit noMoreWidgets(aPreviosAttributeID);
index a73d896dd31a6cd0cd40cfcb9f0dbb67549f98d8..4091de92d0fc7bf87122fbea8ee11ab8e474a9d0 100644 (file)
@@ -116,8 +116,9 @@ public slots:
   * highlighting from the previous active widget
   * emits widgetActivated(theWidget) signal
   * \param theWidget which has to be activated
+  * \param theEmitSignal a flag to prohibit signal emit
   */
-  virtual void activateWidget(ModuleBase_ModelWidget* theWidget);
+  virtual void activateWidget(ModuleBase_ModelWidget* theWidget, const bool theEmitSignal = true);
 
   void onActivateNextWidget(ModuleBase_ModelWidget* theWidget);