From 417aaae9c4c335cad27eaf82458d8c09bb263cc6 Mon Sep 17 00:00:00 2001 From: nds Date: Fri, 25 Dec 2015 18:45:41 +0300 Subject: [PATCH] #1150 Tab buttons problems #1112 tab key doesn't work on the last field of left panels We should not check visibility of internal widget: flyout point in dimention constraints. --- src/ModuleBase/ModuleBase_ModelWidget.cpp | 2 ++ src/ModuleBase/ModuleBase_ModelWidget.h | 7 +++++++ src/PartSet/PartSet_WidgetPoint2DFlyout.cpp | 3 +-- src/PartSet/PartSet_WidgetPoint2DFlyout.h | 3 --- src/XGUI/XGUI_PropertyPanel.cpp | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/ModuleBase/ModuleBase_ModelWidget.cpp b/src/ModuleBase/ModuleBase_ModelWidget.cpp index f0f959480..86fe765da 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.cpp +++ b/src/ModuleBase/ModuleBase_ModelWidget.cpp @@ -31,6 +31,8 @@ ModuleBase_ModelWidget::ModuleBase_ModelWidget(QWidget* theParent, myState(Stored), myIsValueStateBlocked(false) { + myIsInternal = theData->getBooleanAttribute(ATTR_INTERNAL, false); + myDefaultValue = theData->getProperty(ATTR_DEFAULT); myUseReset = theData->getBooleanAttribute(ATTR_USE_RESET, true); myIsComputedDefault = theData->getProperty(ATTR_DEFAULT) == DOUBLE_WDG_DEFAULT_COMPUTED; diff --git a/src/ModuleBase/ModuleBase_ModelWidget.h b/src/ModuleBase/ModuleBase_ModelWidget.h index bed820c97..b08a0a551 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.h +++ b/src/ModuleBase/ModuleBase_ModelWidget.h @@ -69,6 +69,10 @@ Q_OBJECT /// \return the boolean result std::string getDefaultValue() const { return myDefaultValue; } + /// Returns true, if widget is internal + /// \return the boolean result + bool isInternal() const { return myIsInternal; } + /// Returns true, if the obligatory value of the widget is not defined in the XML or has true value /// \return the boolean result bool isObligatory() const { return myIsObligatory; } @@ -302,6 +306,9 @@ private: /// the default value, which is defined in the XML for this attribute std::string myDefaultValue; + /// an XML internal state + bool myIsInternal; + /// the reset state. If it is false, the reset method of the widget is not performed bool myUseReset; /// blocked flag of modification of the value state diff --git a/src/PartSet/PartSet_WidgetPoint2DFlyout.cpp b/src/PartSet/PartSet_WidgetPoint2DFlyout.cpp index 61c2aba45..e501d9ac4 100755 --- a/src/PartSet/PartSet_WidgetPoint2DFlyout.cpp +++ b/src/PartSet/PartSet_WidgetPoint2DFlyout.cpp @@ -22,13 +22,12 @@ PartSet_WidgetPoint2DFlyout::PartSet_WidgetPoint2DFlyout(QWidget* theParent, const std::string& theParentId) : PartSet_WidgetPoint2D(theParent, theWorkshop, theData, theParentId) { - myIsInternal = theData->getBooleanAttribute(ATTR_INTERNAL, false); } bool PartSet_WidgetPoint2DFlyout::focusTo() { bool aCanAcceptFocus = true; - if (myIsInternal && isComputedDefault()) { + if (isInternal() && isComputedDefault()) { AISObjectPtr anObject = workshop()->displayer()->getAISObject(feature()); aCanAcceptFocus = anObject.get() && !anObject->isEmptyDistanceGeometry(); } diff --git a/src/PartSet/PartSet_WidgetPoint2DFlyout.h b/src/PartSet/PartSet_WidgetPoint2DFlyout.h index cbcdc473f..6a76e19bc 100755 --- a/src/PartSet/PartSet_WidgetPoint2DFlyout.h +++ b/src/PartSet/PartSet_WidgetPoint2DFlyout.h @@ -40,9 +40,6 @@ public: private: //! Returns workshop XGUI_Workshop* workshop() const; - -private: - bool myIsInternal; /// an XML internal state }; #endif diff --git a/src/XGUI/XGUI_PropertyPanel.cpp b/src/XGUI/XGUI_PropertyPanel.cpp index aba8f914e..0d9683d9b 100755 --- a/src/XGUI/XGUI_PropertyPanel.cpp +++ b/src/XGUI/XGUI_PropertyPanel.cpp @@ -194,7 +194,7 @@ void XGUI_PropertyPanel::activateNextWidget(ModuleBase_ModelWidget* theWidget, if (!aValidators->isCase(aCurrentWidget->feature(), aCurrentWidget->attributeID())) continue; // this attribute is not participated in the current case - if (isCheckVisibility) { + if (isCheckVisibility && !aCurrentWidget->isInternal()) { if (!aCurrentWidget->isVisible()) continue; } -- 2.30.2