add xml attributes for combobox node and add resolution selection for new doc

This commit is contained in:
2017-11-12 22:39:23 +00:00
parent 4473bc8bd4
commit 8bc440b9b8
11 changed files with 53 additions and 25 deletions

View File

@@ -8,11 +8,18 @@ Node* NodeComboBox::clone_instantiate() const
return new NodeComboBox;
}
void NodeComboBox::clone_copy(Node* dest) const
{
NodeButton::clone_copy(dest);
NodeComboBox* n = static_cast<NodeComboBox*>(dest);
n->labels = labels;
n->m_current_index = m_current_index;
}
void NodeComboBox::loaded()
{
NodeButton::loaded();
on_click = [this](Node* target) {
LOG("ComboBox");
NodePopupMenu* popup = new NodePopupMenu;
popup->init();
popup->create();
@@ -51,8 +58,19 @@ void NodeComboBox::loaded()
popup->m_capture_children = false;
};
}
void NodeComboBox::clone_copy(Node* dest) const
void NodeComboBox::parse_attributes(kAttribute ka, const tinyxml2::XMLAttribute* attr)
{
NodeButton::clone_copy(dest);
NodeComboBox* n = static_cast<NodeComboBox*>(dest);
}
NodeButton::parse_attributes(ka, attr);
switch (ka)
{
case kAttribute::ComboList:
{
labels = split(attr->Value(), ',');
break;
}
case kAttribute::Default:
m_current_index = attr->IntValue();
break;
}
}