const static char* ATTR_INTERNAL = "internal";
const static char* ATTR_OBLIGATORY = "obligatory";
const static char* ATTR_CONCEALMENT = "concealment";
+const static char* ATTR_USE_RESET = "use_reset";
+
// WDG_INFO properties
const static char* INFO_WDG_TEXT = FEATURE_TEXT;
const static char* INFO_WDG_TOOLTIP = FEATURE_TOOLTIP;
myIsEditing(false)
{
myDefaultValue = theData->getProperty(ATTR_DEFAULT);
+ myUseReset = theData->getBooleanAttribute(ATTR_USE_RESET, true);
myIsComputedDefault = theData->getProperty(ATTR_DEFAULT) == DOUBLE_WDG_DEFAULT_COMPUTED;
myAttributeID = theData ? theData->widgetId() : "";
myIsObligatory = theData->getBooleanAttribute(ATTR_OBLIGATORY, true);
/// \return the boolean result
bool isObligatory() const { return myIsObligatory; }
+ /// Returns this parameter value in the xml file
+ /// \return the boolean result
+ bool isUseReset() const { return myUseReset; }
+
/// Defines if it is supposed that the widget should interact with the viewer.
virtual bool isViewerSelector() { return false; }
/// the default value, which is defined in the XML for this attribute
std::string myDefaultValue;
+
+ /// the reset state. If it is false, the reset method of the widget is not performed
+ bool myUseReset;
};
#endif
void ModuleBase_WidgetDoubleValue::reset()
{
+ if (!isUseReset())
+ return;
+
if (isComputedDefault() || mySpinBox->hasVariable()) {
return;
//if (myFeature->compute(myAttributeID))
void ModuleBase_WidgetIntValue::reset()
{
+ if (!isUseReset())
+ return;
+
if (isComputedDefault()) {
return;
//if (myFeature->compute(myAttributeID))
void PartSet_WidgetPoint2D::reset()
{
+ if (!isUseReset())
+ return;
+
if (isComputedDefault()) {
//return;
if (myFeature->compute(myAttributeID))
<integervalue id="MultiTranslationCopies"
label="Number of copies"
tooltip="Number of copies"
- default="1" min="1">
+ default="1" min="1" use_reset="false">
<validator id="GeomValidators_Positive"/>
</integervalue>
</feature>
<integervalue id="MultiRotationCopies"
label="Number of copies"
tooltip="Number of copies"
- default="1" min="1">
+ default="1" min="1" use_reset="false">
<validator id="GeomValidators_Positive"/>
</integervalue>
</feature>