if(!isElementNode(theNode))\r
return false;\r
// it's parent is "feature" or "source" or a page ("box", "case")\r
- if(!hasParent(theNode, NODE_FEATURE, NODE_SOURCE, WDG_GROUP,\r
+ if(!hasParent(theNode, NODE_FEATURE, NODE_SOURCE, WDG_GROUP, WDG_CHECK_GROUP,\r
WDG_TOOLBOX_BOX, WDG_SWITCH_CASE, NULL))\r
return false;\r
\r
if(!isElementNode(theNode))\r
return false;\r
\r
- return isNode(theNode, WDG_SWITCH_CASE, WDG_TOOLBOX_BOX, NULL);\r
+ return isNode(theNode, WDG_CHECK_GROUP, WDG_SWITCH_CASE, WDG_TOOLBOX_BOX, NULL);\r
}\r
\r
bool hasChild(xmlNodePtr theNode)\r
aMessage->setAttributeId(anAttributeID);
aMessage->setObligatory(getBooleanAttribute(theNode, ATTR_OBLIGATORY, true));
aMessage->setConcealment(getBooleanAttribute(theNode, ATTR_CONCEALMENT, false));
+ if (hasParentRecursive(theNode, WDG_CHECK_GROUP, NULL)) {
+ const char* kWdgCase = WDG_CHECK_GROUP;
+ const char* kWdgSwitch = WDG_CHECK_GROUP;
+ aMessage->setCaseId(restoreAttribute(kWdgCase, _ID));
+ aMessage->setSwitchId(restoreAttribute(kWdgSwitch, _ID));
+ }
// nested "paged" widgets are not allowed, this issue may be resolved here:
- if (hasParentRecursive(theNode, WDG_SWITCH_CASE, WDG_TOOLBOX_BOX, NULL)) {
+ else if (hasParentRecursive(theNode, WDG_SWITCH_CASE, WDG_TOOLBOX_BOX, NULL)) {
const char* kWdgCase = hasParentRecursive(theNode, WDG_SWITCH_CASE, NULL)
? WDG_SWITCH_CASE
: WDG_TOOLBOX_BOX;
Events_Loop::loop()->send(aMessage);
}
// container pages, like "case" or "box"
- } else if (isNode(theNode, WDG_SWITCH, WDG_SWITCH_CASE, WDG_TOOLBOX, WDG_TOOLBOX_BOX, NULL)) {
+ } else if (isNode(theNode, WDG_CHECK_GROUP, WDG_SWITCH, WDG_SWITCH_CASE,
+ WDG_TOOLBOX, WDG_TOOLBOX_BOX, NULL)) {
storeAttribute(theNode, _ID); // save case:caseId (or box:boxId)
}
}
void Config_FeatureReader::cleanup(xmlNodePtr theNode)
{
- if (isNode(theNode, WDG_SWITCH, WDG_SWITCH_CASE, WDG_TOOLBOX, WDG_TOOLBOX_BOX, NULL)) {
+ if (isNode(theNode, WDG_CHECK_GROUP, WDG_SWITCH, WDG_SWITCH_CASE,
+ WDG_TOOLBOX, WDG_TOOLBOX_BOX, NULL)) {
// cleanup id of cases when leave case node
cleanupAttribute(theNode, _ID);
}
// Author: Natalia ERMOLAEVA
#include <ModuleBase_WidgetCheckGroupBox.h>
-#include <ModelAPI_AttributeBoolean.h>
+#include <ModelAPI_AttributeString.h>
#include <Config_WidgetAPI.h>
#include <Config_Keywords.h>
bool ModuleBase_WidgetCheckGroupBox::storeValueCustom()
{
DataPtr aData = myFeature->data();
- std::shared_ptr<ModelAPI_AttributeBoolean> aBool = aData->boolean(attributeID());
- aBool->setValue(myGroupBox->isChecked());
+ AttributeStringPtr aStringAttr = aData->string(attributeID());
+ aStringAttr->setValue(myGroupBox->isChecked() ? attributeID() : "");
+
updateObject(myFeature);
return true;
bool ModuleBase_WidgetCheckGroupBox::restoreValueCustom()
{
DataPtr aData = myFeature->data();
- std::shared_ptr<ModelAPI_AttributeBoolean> aRef = aData->boolean(attributeID());
+ AttributeStringPtr aStringAttr = aData->string(attributeID());
bool isBlocked = myGroupBox->blockSignals(true);
- myGroupBox->setChecked(aRef->value());
+ myGroupBox->setChecked(!aStringAttr->value().empty());
myGroupBox->blockSignals(isBlocked);
return true;
ModuleBase_WidgetCheckGroupBox(QWidget* theParent, const Config_WidgetAPI* theData);
virtual ~ModuleBase_WidgetCheckGroupBox();
+ /// Defines if it is supported to set the value in this widget
+ /// \return false because this is an info widget
+ virtual bool canAcceptFocus() const { return false; };
+
/// Set the title of the group box
/// \param theTitle the text of the title
void setTitle(const QString& theTitle);