save window position and size

This commit is contained in:
Eduardo Bart
2012-01-06 06:48:59 -02:00
parent 0cb5facd7a
commit 028441831d
31 changed files with 315 additions and 158 deletions

View File

@@ -302,25 +302,26 @@ void LuaInterface::loadScript(const std::string& fileName)
void LuaInterface::loadFunction(const std::string& buffer, const std::string& source)
{
// gets the function contained in that buffer
if(boost::starts_with(buffer, "function")) {
// evaluate the function
std::string buf = Fw::mkstr("__func = ", buffer);
loadBuffer(buf, source);
safeCall();
// get the function
getGlobal("__func");
// reset the global __func
if(buffer.empty()) {
pushNil();
setGlobal("__func");
return;
}
// gets the buffer as a function
else if(!buffer.empty())
loadBuffer(buffer, source);
std::string buf;
if(boost::starts_with(buffer, "function"))
buf = Fw::mkstr("__func = ", buffer);
else
pushNil();
buf = Fw::mkstr("__func = function(self)\n", buffer,"\nend");
loadBuffer(buf, source);
safeCall();
// get the function
getGlobal("__func");
// reset the global __func
pushNil();
setGlobal("__func");
}
void LuaInterface::evaluateExpression(const std::string& expression, const std::string& source)