Allow implicit conversions when setting text property on some Lua API UI elements

This commit is contained in:
Simon Robertshaw 2013-02-16 14:52:29 +00:00
parent 8d04b260a7
commit a091f55fec
3 changed files with 2 additions and 6 deletions

View File

@ -53,7 +53,6 @@ int LuaCheckbox::checked(lua_State * l)
int args = lua_gettop(l);
if(args)
{
luaL_checktype(l, 1, LUA_TBOOLEAN);
checkbox->SetChecked(lua_toboolean(l, 1));
return 0;
}
@ -84,7 +83,6 @@ int LuaCheckbox::text(lua_State * l)
int args = lua_gettop(l);
if(args)
{
luaL_checktype(l, 1, LUA_TSTRING);
checkbox->SetText(lua_tostring(l, 1));
return 0;
}

View File

@ -40,8 +40,7 @@ int LuaLabel::text(lua_State * l)
int args = lua_gettop(l);
if(args)
{
luaL_checktype(l, 1, LUA_TSTRING);
label->SetText(lua_tostring(l, 1));
label->SetText(std::string(lua_tostring(l, 1)));
return 0;
}
else

View File

@ -100,8 +100,7 @@ int LuaTextbox::text(lua_State * l)
int args = lua_gettop(l);
if(args)
{
luaL_checktype(l, 1, LUA_TSTRING);
textbox->SetText(lua_tostring(l, 1));
textbox->SetText(std::string(lua_tostring(l, 1)));
return 0;
}
else