From af73a3e00de48eeff2610b25e2d5f851df7a5075 Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 30 Mar 2016 08:36:17 +0300 Subject: [PATCH] Issue #1278 In the sketch the creation line is not functional when I check the box "Auxiliary": rename canSetValue to canAcceptFocus. --- src/ModuleBase/ModuleBase_IPropertyPanel.cpp | 2 +- src/ModuleBase/ModuleBase_IPropertyPanel.h | 4 ++-- src/ModuleBase/ModuleBase_ModelWidget.h | 2 +- src/ModuleBase/ModuleBase_OperationFeature.cpp | 2 +- src/ModuleBase/ModuleBase_WidgetBoolValue.h | 2 +- src/ModuleBase/ModuleBase_WidgetChoice.h | 2 +- src/ModuleBase/ModuleBase_WidgetLabel.h | 2 +- src/ModuleBase/ModuleBase_WidgetSwitch.h | 2 +- src/ModuleBase/ModuleBase_WidgetToolbox.h | 2 +- src/XGUI/XGUI_PropertyPanel.cpp | 2 +- src/XGUI/XGUI_Workshop.cpp | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/ModuleBase/ModuleBase_IPropertyPanel.cpp b/src/ModuleBase/ModuleBase_IPropertyPanel.cpp index c37673303..eb338776b 100644 --- a/src/ModuleBase/ModuleBase_IPropertyPanel.cpp +++ b/src/ModuleBase/ModuleBase_IPropertyPanel.cpp @@ -39,7 +39,7 @@ ModuleBase_ModelWidget* ModuleBase_IPropertyPanel::findFirstAcceptingValueWidget if (!aValidators->isCase(aWgt->feature(), aWgt->attributeID())) continue; // this attribute is not participated in the current case - if (!aWgt->canSetValue()) + if (!aWgt->canAcceptFocus()) continue; /// workaround for the same attributes used in different stacked widgets(attribute types) diff --git a/src/ModuleBase/ModuleBase_IPropertyPanel.h b/src/ModuleBase/ModuleBase_IPropertyPanel.h index c9f51e122..f463cefbe 100644 --- a/src/ModuleBase/ModuleBase_IPropertyPanel.h +++ b/src/ModuleBase/ModuleBase_IPropertyPanel.h @@ -64,11 +64,11 @@ public: /// Sets widget processed by preselection virtual void setPreselectionWidget(ModuleBase_ModelWidget* theWidget) = 0; - /// Returns the first widget, where canSetValue returns true + /// Returns the first widget, where canAcceptFocus returns true /// \return a widget or null ModuleBase_ModelWidget* findFirstAcceptingValueWidget(); - /// Returns the first widget, where canSetValue returns true + /// Returns the first widget, where canAcceptFocus returns true /// \return a widget or null static ModuleBase_ModelWidget* findFirstAcceptingValueWidget( const QList& theWidgets); diff --git a/src/ModuleBase/ModuleBase_ModelWidget.h b/src/ModuleBase/ModuleBase_ModelWidget.h index c2859e975..9162f4675 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.h +++ b/src/ModuleBase/ModuleBase_ModelWidget.h @@ -93,7 +93,7 @@ Q_OBJECT /// Defines if it is supported to set the value in this widget /// By default it returns true - virtual bool canSetValue() const { return true; }; + virtual bool canAcceptFocus() const { return true; }; //! Returns the widget error, get it from the attribute validator and state of the widget //! If the feature is correct, it returns an empty value diff --git a/src/ModuleBase/ModuleBase_OperationFeature.cpp b/src/ModuleBase/ModuleBase_OperationFeature.cpp index c460480fd..f331ed72f 100755 --- a/src/ModuleBase/ModuleBase_OperationFeature.cpp +++ b/src/ModuleBase/ModuleBase_OperationFeature.cpp @@ -365,7 +365,7 @@ ModuleBase_ModelWidget* ModuleBase_OperationFeature::activateByPreselection( // 1. apply the selection to controls for (aWIt = aWidgets.constBegin(); aWIt != aWidgets.constEnd(); ++aWIt) { aWgt = (*aWIt); - if (!aWgt->canSetValue()) + if (!aWgt->canAcceptFocus()) continue; aPropertyPanel->setPreselectionWidget(aWgt); if (!aWgt->setSelection(myPreSelection, true)) { diff --git a/src/ModuleBase/ModuleBase_WidgetBoolValue.h b/src/ModuleBase/ModuleBase_WidgetBoolValue.h index 58561d35e..c3764bdcc 100644 --- a/src/ModuleBase/ModuleBase_WidgetBoolValue.h +++ b/src/ModuleBase/ModuleBase_WidgetBoolValue.h @@ -29,7 +29,7 @@ Q_OBJECT virtual ~ModuleBase_WidgetBoolValue(); - virtual bool canSetValue() const { return false; }; + virtual bool canAcceptFocus() const { return false; }; virtual QList getControls() const; diff --git a/src/ModuleBase/ModuleBase_WidgetChoice.h b/src/ModuleBase/ModuleBase_WidgetChoice.h index 0cdf589ee..e0f90d720 100644 --- a/src/ModuleBase/ModuleBase_WidgetChoice.h +++ b/src/ModuleBase/ModuleBase_WidgetChoice.h @@ -46,7 +46,7 @@ Q_OBJECT /// Defines if it is supported to set the value in this widget /// It returns false because this is an info widget - virtual bool canSetValue() const { return false; }; + virtual bool canAcceptFocus() const { return false; }; virtual bool focusTo(); diff --git a/src/ModuleBase/ModuleBase_WidgetLabel.h b/src/ModuleBase/ModuleBase_WidgetLabel.h index b024b17c9..97454bf6f 100644 --- a/src/ModuleBase/ModuleBase_WidgetLabel.h +++ b/src/ModuleBase/ModuleBase_WidgetLabel.h @@ -29,7 +29,7 @@ Q_OBJECT /// Defines if it is supported to set the value in this widget /// It returns false because this is an info widget - virtual bool canSetValue() const { return false; }; + virtual bool canAcceptFocus() const { return false; }; virtual bool restoreValueCustom() { diff --git a/src/ModuleBase/ModuleBase_WidgetSwitch.h b/src/ModuleBase/ModuleBase_WidgetSwitch.h index 8b127f4d2..1121d11fd 100644 --- a/src/ModuleBase/ModuleBase_WidgetSwitch.h +++ b/src/ModuleBase/ModuleBase_WidgetSwitch.h @@ -33,7 +33,7 @@ class MODULEBASE_EXPORT ModuleBase_WidgetSwitch : public ModuleBase_PagedContain /// Defines if it is supported to set the value in this widget /// It returns false because this is an info widget - virtual bool canSetValue() const { return false; }; + virtual bool canAcceptFocus() const { return false; }; /// Add a page to the widget /// \param theWidget a page widget diff --git a/src/ModuleBase/ModuleBase_WidgetToolbox.h b/src/ModuleBase/ModuleBase_WidgetToolbox.h index 08d851a14..f92d79f4c 100644 --- a/src/ModuleBase/ModuleBase_WidgetToolbox.h +++ b/src/ModuleBase/ModuleBase_WidgetToolbox.h @@ -30,7 +30,7 @@ class MODULEBASE_EXPORT ModuleBase_WidgetToolbox : public ModuleBase_PagedContai /// Defines if it is supported to set the value in this widget /// \return false because this is an info widget - virtual bool canSetValue() const { return false; }; + virtual bool canAcceptFocus() const { return false; }; /// Add a page to the widget /// \param theWidget a page widget diff --git a/src/XGUI/XGUI_PropertyPanel.cpp b/src/XGUI/XGUI_PropertyPanel.cpp index 5930c5e9f..8b1ab4f03 100755 --- a/src/XGUI/XGUI_PropertyPanel.cpp +++ b/src/XGUI/XGUI_PropertyPanel.cpp @@ -164,7 +164,7 @@ void XGUI_PropertyPanel::activateNextWidget(ModuleBase_ModelWidget* theWidget) void XGUI_PropertyPanel::onFocusInWidget(ModuleBase_ModelWidget* theWidget) { - if (theWidget->canSetValue()) + if (theWidget->canAcceptFocus()) activateWidget(theWidget); } diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 73894bc4b..0b7c71c35 100755 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -872,7 +872,7 @@ void XGUI_Workshop::onWidgetStateChanged(int thePreviousState) void XGUI_Workshop::onValuesChanged() { ModuleBase_ModelWidget* aSenderWidget = (ModuleBase_ModelWidget*)(sender()); - if (!aSenderWidget || aSenderWidget->canSetValue()) + if (!aSenderWidget || aSenderWidget->canAcceptFocus()) return; ModuleBase_ModelWidget* anActiveWidget = 0; -- 2.39.2