From 60df1eeac2bc9a661e43308de2cfe9fdbf7559e0 Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 13 Jan 2016 10:53:33 +0300 Subject: [PATCH] Checking Enter processing functionality(with Delete processing). Sketch-Mirror feature do not deactivate multi-selector control however focus is moved to Apply button. It is corrected. --- src/ModuleBase/ModuleBase_IPropertyPanel.h | 4 +++- src/PartSet/PartSet_SketcherReetntrantMgr.cpp | 7 +++++++ src/XGUI/XGUI_PropertyPanel.cpp | 4 ++-- src/XGUI/XGUI_PropertyPanel.h | 3 ++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/ModuleBase/ModuleBase_IPropertyPanel.h b/src/ModuleBase/ModuleBase_IPropertyPanel.h index afafce7a7..b5b302d22 100644 --- a/src/ModuleBase/ModuleBase_IPropertyPanel.h +++ b/src/ModuleBase/ModuleBase_IPropertyPanel.h @@ -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: diff --git a/src/PartSet/PartSet_SketcherReetntrantMgr.cpp b/src/PartSet/PartSet_SketcherReetntrantMgr.cpp index d491b9a57..15cf843d3 100755 --- a/src/PartSet/PartSet_SketcherReetntrantMgr.cpp +++ b/src/PartSet/PartSet_SketcherReetntrantMgr.cpp @@ -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(PROP_PANEL_OK); diff --git a/src/XGUI/XGUI_PropertyPanel.cpp b/src/XGUI/XGUI_PropertyPanel.cpp index fcb16a376..2ebf8973f 100755 --- a/src/XGUI/XGUI_PropertyPanel.cpp +++ b/src/XGUI/XGUI_PropertyPanel.cpp @@ -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); diff --git a/src/XGUI/XGUI_PropertyPanel.h b/src/XGUI/XGUI_PropertyPanel.h index a73d896dd..4091de92d 100644 --- a/src/XGUI/XGUI_PropertyPanel.h +++ b/src/XGUI/XGUI_PropertyPanel.h @@ -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); -- 2.39.2