new lua function for creating widgets: createWidget

This commit is contained in:
Eduardo Bart
2012-01-02 22:42:53 -02:00
parent 9fbdf3f5cb
commit 05230f44e4
29 changed files with 137 additions and 120 deletions

View File

@@ -226,7 +226,7 @@ bool luavalue_cast(int index, Size& size)
}
// otml nodes
void push_luavalue(const OTMLNodePtr& node)
void push_otml_subnode_luavalue(const OTMLNodePtr& node)
{
if(node->hasValue()) {
g_lua.pushString(node->value());
@@ -251,6 +251,20 @@ void push_luavalue(const OTMLNodePtr& node)
g_lua.pushNil();
}
void push_luavalue(const OTMLNodePtr& node)
{
g_lua.newTable();
for(const OTMLNodePtr& cnode : node->children()) {
if(cnode->isUnique()) {
push_otml_subnode_luavalue(cnode);
if(!g_lua.isNil()) {
g_lua.setField(cnode->tag());
} else
g_lua.pop();
}
}
}
bool luavalue_cast(int index, OTMLNodePtr& node)
{
node = OTMLNode::create();