add options style for UIComboBox, fix push values of otml nodes

This commit is contained in:
Eduardo Bart
2012-01-16 06:26:57 -02:00
parent 186e3dc86b
commit e6cb3de637
5 changed files with 25 additions and 10 deletions

View File

@@ -219,15 +219,18 @@ void push_otml_subnode_luavalue(const OTMLNodePtr& node)
} else if(node->hasChildren()) {
g_lua.newTable();
bool pushedChild = false;
int currentIndex = 1;
for(const OTMLNodePtr& cnode : node->children()) {
if(cnode->isUnique()) {
push_luavalue(cnode);
if(!g_lua.isNil()) {
g_lua.setField(cnode->tag());
pushedChild = true;
push_otml_subnode_luavalue(cnode);
if(!g_lua.isNil()) {
if(cnode->isUnique()) {
g_lua.pushString(cnode->tag());
g_lua.rawSet();
} else
g_lua.pop();
}
g_lua.rawSeti(currentIndex++);
pushedChild = true;
} else
g_lua.pop();
}
if(!pushedChild) {
g_lua.pop();

View File

@@ -364,6 +364,9 @@ void UIWidget::unlockChild(const UIWidgetPtr& child)
void UIWidget::applyStyle(const OTMLNodePtr& styleNode)
{
if(styleNode->size() == 0)
return;
m_loadingStyle = true;
try {
onStyleApply(styleNode->tag(), styleNode);