|
|
@@ -46,12 +46,14 @@ void luaRegister_Form()
|
|
|
{"addListener", lua_Form_addListener},
|
|
|
{"addRef", lua_Form_addRef},
|
|
|
{"addScriptCallback", lua_Form_addScriptCallback},
|
|
|
+ {"canFocus", lua_Form_canFocus},
|
|
|
{"createAnimation", lua_Form_createAnimation},
|
|
|
{"createAnimationFromBy", lua_Form_createAnimationFromBy},
|
|
|
{"createAnimationFromTo", lua_Form_createAnimationFromTo},
|
|
|
{"destroyAnimation", lua_Form_destroyAnimation},
|
|
|
{"draw", lua_Form_draw},
|
|
|
{"getAbsoluteBounds", lua_Form_getAbsoluteBounds},
|
|
|
+ {"getActiveControl", lua_Form_getActiveControl},
|
|
|
{"getAlignment", lua_Form_getAlignment},
|
|
|
{"getAnimation", lua_Form_getAnimation},
|
|
|
{"getAnimationPropertyComponentCount", lua_Form_getAnimationPropertyComponentCount},
|
|
|
@@ -64,6 +66,7 @@ void luaRegister_Form()
|
|
|
{"getClipBounds", lua_Form_getClipBounds},
|
|
|
{"getConsumeInputEvents", lua_Form_getConsumeInputEvents},
|
|
|
{"getControl", lua_Form_getControl},
|
|
|
+ {"getControlCount", lua_Form_getControlCount},
|
|
|
{"getCursorColor", lua_Form_getCursorColor},
|
|
|
{"getCursorRegion", lua_Form_getCursorRegion},
|
|
|
{"getCursorUVs", lua_Form_getCursorUVs},
|
|
|
@@ -94,18 +97,24 @@ void luaRegister_Form()
|
|
|
{"getTextColor", lua_Form_getTextColor},
|
|
|
{"getTextRightToLeft", lua_Form_getTextRightToLeft},
|
|
|
{"getTheme", lua_Form_getTheme},
|
|
|
+ {"getTopLevelForm", lua_Form_getTopLevelForm},
|
|
|
{"getType", lua_Form_getType},
|
|
|
{"getWidth", lua_Form_getWidth},
|
|
|
{"getX", lua_Form_getX},
|
|
|
{"getY", lua_Form_getY},
|
|
|
{"getZIndex", lua_Form_getZIndex},
|
|
|
+ {"hasFocus", lua_Form_hasFocus},
|
|
|
{"insertControl", lua_Form_insertControl},
|
|
|
+ {"isChild", lua_Form_isChild},
|
|
|
{"isContainer", lua_Form_isContainer},
|
|
|
{"isEnabled", lua_Form_isEnabled},
|
|
|
+ {"isEnabledInHierarchy", lua_Form_isEnabledInHierarchy},
|
|
|
+ {"isForm", lua_Form_isForm},
|
|
|
{"isHeightPercentage", lua_Form_isHeightPercentage},
|
|
|
{"isScrollBarsAutoHide", lua_Form_isScrollBarsAutoHide},
|
|
|
{"isScrolling", lua_Form_isScrolling},
|
|
|
{"isVisible", lua_Form_isVisible},
|
|
|
+ {"isVisibleInHierarchy", lua_Form_isVisibleInHierarchy},
|
|
|
{"isWidthPercentage", lua_Form_isWidthPercentage},
|
|
|
{"isXPercentage", lua_Form_isXPercentage},
|
|
|
{"isYPercentage", lua_Form_isYPercentage},
|
|
|
@@ -113,16 +122,19 @@ void luaRegister_Form()
|
|
|
{"removeControl", lua_Form_removeControl},
|
|
|
{"removeListener", lua_Form_removeListener},
|
|
|
{"removeScriptCallback", lua_Form_removeScriptCallback},
|
|
|
+ {"setActiveControl", lua_Form_setActiveControl},
|
|
|
{"setAlignment", lua_Form_setAlignment},
|
|
|
{"setAnimationPropertyValue", lua_Form_setAnimationPropertyValue},
|
|
|
{"setAutoHeight", lua_Form_setAutoHeight},
|
|
|
{"setAutoWidth", lua_Form_setAutoWidth},
|
|
|
{"setBorder", lua_Form_setBorder},
|
|
|
{"setBounds", lua_Form_setBounds},
|
|
|
+ {"setCanFocus", lua_Form_setCanFocus},
|
|
|
{"setConsumeInputEvents", lua_Form_setConsumeInputEvents},
|
|
|
{"setCursorColor", lua_Form_setCursorColor},
|
|
|
{"setCursorRegion", lua_Form_setCursorRegion},
|
|
|
{"setEnabled", lua_Form_setEnabled},
|
|
|
+ {"setFocus", lua_Form_setFocus},
|
|
|
{"setFocusIndex", lua_Form_setFocusIndex},
|
|
|
{"setFont", lua_Form_setFont},
|
|
|
{"setFontSize", lua_Form_setFontSize},
|
|
|
@@ -165,8 +177,10 @@ void luaRegister_Form()
|
|
|
{"ANIMATE_SIZE", lua_Form_static_ANIMATE_SIZE},
|
|
|
{"ANIMATE_SIZE_HEIGHT", lua_Form_static_ANIMATE_SIZE_HEIGHT},
|
|
|
{"ANIMATE_SIZE_WIDTH", lua_Form_static_ANIMATE_SIZE_WIDTH},
|
|
|
+ {"clearFocus", lua_Form_static_clearFocus},
|
|
|
{"create", lua_Form_static_create},
|
|
|
{"getActiveControl", lua_Form_static_getActiveControl},
|
|
|
+ {"getFocusControl", lua_Form_static_getFocusControl},
|
|
|
{"getForm", lua_Form_static_getForm},
|
|
|
{NULL, NULL}
|
|
|
};
|
|
|
@@ -383,6 +397,41 @@ int lua_Form_addScriptCallback(lua_State* state)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+int lua_Form_canFocus(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA))
|
|
|
+ {
|
|
|
+ Form* instance = getInstance(state);
|
|
|
+ bool result = instance->canFocus();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushboolean(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ lua_pushstring(state, "lua_Form_canFocus - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
int lua_Form_createAnimation(lua_State* state)
|
|
|
{
|
|
|
// Get the number of parameters.
|
|
|
@@ -851,6 +900,50 @@ int lua_Form_getAbsoluteBounds(lua_State* state)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+int lua_Form_getActiveControl(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA))
|
|
|
+ {
|
|
|
+ Form* instance = getInstance(state);
|
|
|
+ void* returnPtr = (void*)instance->getActiveControl();
|
|
|
+ if (returnPtr)
|
|
|
+ {
|
|
|
+ gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
|
|
|
+ object->instance = returnPtr;
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Control");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushnil(state);
|
|
|
+ }
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ lua_pushstring(state, "lua_Form_getActiveControl - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
int lua_Form_getAlignment(lua_State* state)
|
|
|
{
|
|
|
// Get the number of parameters.
|
|
|
@@ -1434,6 +1527,41 @@ int lua_Form_getControl(lua_State* state)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+int lua_Form_getControlCount(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA))
|
|
|
+ {
|
|
|
+ Form* instance = getInstance(state);
|
|
|
+ unsigned int result = instance->getControlCount();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushunsigned(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ lua_pushstring(state, "lua_Form_getControlCount - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
int lua_Form_getCursorColor(lua_State* state)
|
|
|
{
|
|
|
// Get the number of parameters.
|
|
|
@@ -2877,6 +3005,50 @@ int lua_Form_getTheme(lua_State* state)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+int lua_Form_getTopLevelForm(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA))
|
|
|
+ {
|
|
|
+ Form* instance = getInstance(state);
|
|
|
+ void* returnPtr = (void*)instance->getTopLevelForm();
|
|
|
+ if (returnPtr)
|
|
|
+ {
|
|
|
+ gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
|
|
|
+ object->instance = returnPtr;
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Form");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushnil(state);
|
|
|
+ }
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ lua_pushstring(state, "lua_Form_getTopLevelForm - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
int lua_Form_getType(lua_State* state)
|
|
|
{
|
|
|
// Get the number of parameters.
|
|
|
@@ -3052,6 +3224,41 @@ int lua_Form_getZIndex(lua_State* state)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+int lua_Form_hasFocus(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA))
|
|
|
+ {
|
|
|
+ Form* instance = getInstance(state);
|
|
|
+ bool result = instance->hasFocus();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushboolean(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ lua_pushstring(state, "lua_Form_hasFocus - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
int lua_Form_insertControl(lua_State* state)
|
|
|
{
|
|
|
// Get the number of parameters.
|
|
|
@@ -3098,6 +3305,51 @@ int lua_Form_insertControl(lua_State* state)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+int lua_Form_isChild(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
+ (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1Valid;
|
|
|
+ gameplay::ScriptUtil::LuaArray<Control> param1 = gameplay::ScriptUtil::getObjectPointer<Control>(2, "Control", false, ¶m1Valid);
|
|
|
+ if (!param1Valid)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to convert parameter 1 to type 'Control'.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+
|
|
|
+ Form* instance = getInstance(state);
|
|
|
+ bool result = instance->isChild(param1);
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushboolean(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ lua_pushstring(state, "lua_Form_isChild - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
int lua_Form_isContainer(lua_State* state)
|
|
|
{
|
|
|
// Get the number of parameters.
|
|
|
@@ -3168,6 +3420,76 @@ int lua_Form_isEnabled(lua_State* state)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+int lua_Form_isEnabledInHierarchy(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA))
|
|
|
+ {
|
|
|
+ Form* instance = getInstance(state);
|
|
|
+ bool result = instance->isEnabledInHierarchy();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushboolean(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ lua_pushstring(state, "lua_Form_isEnabledInHierarchy - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_Form_isForm(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA))
|
|
|
+ {
|
|
|
+ Form* instance = getInstance(state);
|
|
|
+ bool result = instance->isForm();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushboolean(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ lua_pushstring(state, "lua_Form_isForm - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
int lua_Form_isHeightPercentage(lua_State* state)
|
|
|
{
|
|
|
// Get the number of parameters.
|
|
|
@@ -3308,6 +3630,41 @@ int lua_Form_isVisible(lua_State* state)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+int lua_Form_isVisibleInHierarchy(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA))
|
|
|
+ {
|
|
|
+ Form* instance = getInstance(state);
|
|
|
+ bool result = instance->isVisibleInHierarchy();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushboolean(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ lua_pushstring(state, "lua_Form_isVisibleInHierarchy - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
int lua_Form_isWidthPercentage(lua_State* state)
|
|
|
{
|
|
|
// Get the number of parameters.
|
|
|
@@ -3599,6 +3956,48 @@ int lua_Form_removeScriptCallback(lua_State* state)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+int lua_Form_setActiveControl(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
+ (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1Valid;
|
|
|
+ gameplay::ScriptUtil::LuaArray<Control> param1 = gameplay::ScriptUtil::getObjectPointer<Control>(2, "Control", false, ¶m1Valid);
|
|
|
+ if (!param1Valid)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to convert parameter 1 to type 'Control'.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+
|
|
|
+ Form* instance = getInstance(state);
|
|
|
+ instance->setActiveControl(param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ lua_pushstring(state, "lua_Form_setActiveControl - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
int lua_Form_setAlignment(lua_State* state)
|
|
|
{
|
|
|
// Get the number of parameters.
|
|
|
@@ -3945,6 +4344,42 @@ int lua_Form_setBounds(lua_State* state)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+int lua_Form_setCanFocus(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
+ lua_type(state, 2) == LUA_TBOOLEAN)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
|
|
|
+
|
|
|
+ Form* instance = getInstance(state);
|
|
|
+ instance->setCanFocus(param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ lua_pushstring(state, "lua_Form_setCanFocus - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
int lua_Form_setConsumeInputEvents(lua_State* state)
|
|
|
{
|
|
|
// Get the number of parameters.
|
|
|
@@ -4109,6 +4544,41 @@ int lua_Form_setEnabled(lua_State* state)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+int lua_Form_setFocus(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA))
|
|
|
+ {
|
|
|
+ Form* instance = getInstance(state);
|
|
|
+ bool result = instance->setFocus();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushboolean(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ lua_pushstring(state, "lua_Form_setFocus - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
int lua_Form_setFocusIndex(lua_State* state)
|
|
|
{
|
|
|
// Get the number of parameters.
|
|
|
@@ -5735,6 +6205,31 @@ int lua_Form_static_ANIMATE_SIZE_WIDTH(lua_State* state)
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
+int lua_Form_static_clearFocus(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 0:
|
|
|
+ {
|
|
|
+ Form::clearFocus();
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 0).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
int lua_Form_static_create(lua_State* state)
|
|
|
{
|
|
|
// Get the number of parameters.
|
|
|
@@ -5901,6 +6396,43 @@ int lua_Form_static_getActiveControl(lua_State* state)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+int lua_Form_static_getFocusControl(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 0:
|
|
|
+ {
|
|
|
+ void* returnPtr = (void*)Form::getFocusControl();
|
|
|
+ if (returnPtr)
|
|
|
+ {
|
|
|
+ gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
|
|
|
+ object->instance = returnPtr;
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Control");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushnil(state);
|
|
|
+ }
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 0).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
int lua_Form_static_getForm(lua_State* state)
|
|
|
{
|
|
|
// Get the number of parameters.
|