remake ui event system and reimplement line edit

This commit is contained in:
Eduardo Bart
2011-08-14 11:09:26 -03:00
parent e22e5e2918
commit 09af50c990
24 changed files with 833 additions and 672 deletions

View File

@@ -29,6 +29,7 @@ void LuaInterface::registerFunctions()
g_lua.bindClassMemberFunction<UIWidget>("addAnchor", &UIWidget::addAnchor);
g_lua.bindClassMemberFunction<UIWidget>("getChild", &UIWidget::getChildById);
g_lua.bindClassMemberFunction<UIWidget>("addChild", &UIWidget::addChild);
g_lua.bindClassMemberFunction<UIWidget>("lock", &UIWidget::lock);
// UILabel
g_lua.registerClass<UILabel, UIWidget>();

View File

@@ -53,17 +53,20 @@ private:
template<typename... T>
int LuaObject::callLuaField(const std::string& field, const T&... args) {
// note that the field must be retrieved from this object lua value
// to force using the __index metamethod of it's metatable
// so cannot use LuaObject::getField here
// push field
g_lua.pushObject(asLuaObject());
g_lua.getField(field);
if(m_fieldsTableRef != -1) {
// note that the field must be retrieved from this object lua value
// to force using the __index metamethod of it's metatable
// so cannot use LuaObject::getField here
// push field
g_lua.pushObject(asLuaObject());
g_lua.getField(field);
// the first argument is always this object (self)
g_lua.insert(-2);
g_lua.polymorphicPush(args...);
return g_lua.protectedCall(1 + sizeof...(args));
// the first argument is always this object (self)
g_lua.insert(-2);
g_lua.polymorphicPush(args...);
return g_lua.protectedCall(1 + sizeof...(args));
} else
return 0;
}
template<typename T>