diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_ui_auto_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_ui_auto_api.js index 7aa9d40f6f..7212865cac 100644 --- a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_ui_auto_api.js +++ b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_ui_auto_api.js @@ -3555,6 +3555,16 @@ removeLastItem : function ( { }, +/** + * @method getLeftPadding + * @return {float} + */ +getLeftPadding : function ( +) +{ + return 0; +}, + /** * @method getCenterItemInCurrentView * @return {ccui.Widget} @@ -3585,6 +3595,16 @@ getScrollDuration : function ( return 0; }, +/** + * @method getMagneticAllowedOutOfBoundary + * @return {bool} + */ +getMagneticAllowedOutOfBoundary : function ( +) +{ + return false; +}, + /** * @method getItemsMargin * @return {float} @@ -3595,6 +3615,22 @@ getItemsMargin : function ( return 0; }, +/** + * @method scrollToItem +* @param {int|int} int +* @param {vec2_object|vec2_object} vec2 +* @param {vec2_object|vec2_object} vec2 +* @param {float} float +*/ +scrollToItem : function( +int, +vec2, +vec2, +float +) +{ +}, + /** * @method jumpToItem * @param {int} arg0 @@ -3610,11 +3646,11 @@ vec2 }, /** - * @method setMagneticType - * @param {ccui.ListView::MagneticType} arg0 + * @method setTopPadding + * @param {float} arg0 */ -setMagneticType : function ( -magnetictype +setTopPadding : function ( +float ) { }, @@ -3661,6 +3697,16 @@ int { }, +/** + * @method setMagneticType + * @param {ccui.ListView::MagneticType} arg0 + */ +setMagneticType : function ( +magnetictype +) +{ +}, + /** * @method setMagneticAllowedOutOfBoundary * @param {bool} arg0 @@ -3699,6 +3745,22 @@ getTopmostItemInCurrentView : function ( return ccui.Widget; }, +/** + * @method setPadding + * @param {float} arg0 + * @param {float} arg1 + * @param {float} arg2 + * @param {float} arg3 + */ +setPadding : function ( +float, +float, +float, +float +) +{ +}, + /** * @method removeAllItems */ @@ -3707,6 +3769,16 @@ removeAllItems : function ( { }, +/** + * @method getRightPadding + * @return {float} + */ +getRightPadding : function ( +) +{ + return 0; +}, + /** * @method getBottommostItemInCurrentView * @return {ccui.Widget} @@ -3780,19 +3852,13 @@ int }, /** - * @method scrollToItem -* @param {int|int} int -* @param {vec2_object|vec2_object} vec2 -* @param {vec2_object|vec2_object} vec2 -* @param {float} float -*/ -scrollToItem : function( -int, -vec2, -vec2, -float + * @method getTopPadding + * @return {float} + */ +getTopPadding : function ( ) { + return 0; }, /** @@ -3804,13 +3870,13 @@ pushBackDefaultItem : function ( }, /** - * @method getMagneticAllowedOutOfBoundary - * @return {bool} + * @method setLeftPadding + * @param {float} arg0 */ -getMagneticAllowedOutOfBoundary : function ( +setLeftPadding : function ( +float ) { - return false; }, /** @@ -3828,13 +3894,13 @@ vec2 }, /** - * @method getRightmostItemInCurrentView - * @return {ccui.Widget} + * @method setBottomPadding + * @param {float} arg0 */ -getRightmostItemInCurrentView : function ( +setBottomPadding : function ( +float ) { - return ccui.Widget; }, /** @@ -3861,6 +3927,26 @@ vec2 return ccui.Widget; }, +/** + * @method getRightmostItemInCurrentView + * @return {ccui.Widget} + */ +getRightmostItemInCurrentView : function ( +) +{ + return ccui.Widget; +}, + +/** + * @method setRightPadding + * @param {float} arg0 + */ +setRightPadding : function ( +float +) +{ +}, + /** * @method setItemModel * @param {ccui.Widget} arg0 @@ -3871,6 +3957,16 @@ widget { }, +/** + * @method getBottomPadding + * @return {float} + */ +getBottomPadding : function ( +) +{ + return 0; +}, + /** * @method insertCustomItem * @param {ccui.Widget} arg0 diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp index f83424b39c..bb3a9f7485 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp @@ -8738,6 +8738,24 @@ bool js_cocos2dx_ui_ListView_removeLastItem(JSContext *cx, uint32_t argc, jsval JS_ReportError(cx, "js_cocos2dx_ui_ListView_removeLastItem : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_ui_ListView_getLeftPadding(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::ui::ListView* cobj = (cocos2d::ui::ListView *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ListView_getLeftPadding : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getLeftPadding(); + JS::RootedValue jsret(cx); + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_ui_ListView_getLeftPadding : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_ui_ListView_getCenterItemInCurrentView(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -8796,6 +8814,24 @@ bool js_cocos2dx_ui_ListView_getScrollDuration(JSContext *cx, uint32_t argc, jsv JS_ReportError(cx, "js_cocos2dx_ui_ListView_getScrollDuration : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_ui_ListView_getMagneticAllowedOutOfBoundary(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::ui::ListView* cobj = (cocos2d::ui::ListView *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ListView_getMagneticAllowedOutOfBoundary : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->getMagneticAllowedOutOfBoundary(); + JS::RootedValue jsret(cx); + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_ui_ListView_getMagneticAllowedOutOfBoundary : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_ui_ListView_getItemsMargin(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -8814,6 +8850,57 @@ bool js_cocos2dx_ui_ListView_getItemsMargin(JSContext *cx, uint32_t argc, jsval JS_ReportError(cx, "js_cocos2dx_ui_ListView_getItemsMargin : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_ui_ListView_scrollToItem(JSContext *cx, uint32_t argc, jsval *vp) +{ + bool ok = true; + cocos2d::ui::ListView* cobj = nullptr; + + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx); + obj.set(args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::ui::ListView *)(proxy ? proxy->ptr : nullptr); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ListView_scrollToItem : Invalid Native Object"); + do { + if (argc == 4) { + ssize_t arg0 = 0; + ok &= jsval_to_ssize(cx, args.get(0), &arg0); + if (!ok) { ok = true; break; } + cocos2d::Vec2 arg1; + ok &= jsval_to_vector2(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + cocos2d::Vec2 arg2; + ok &= jsval_to_vector2(cx, args.get(2), &arg2); + if (!ok) { ok = true; break; } + double arg3 = 0; + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); + if (!ok) { ok = true; break; } + cobj->scrollToItem(arg0, arg1, arg2, arg3); + args.rval().setUndefined(); + return true; + } + } while(0); + + do { + if (argc == 3) { + ssize_t arg0 = 0; + ok &= jsval_to_ssize(cx, args.get(0), &arg0); + if (!ok) { ok = true; break; } + cocos2d::Vec2 arg1; + ok &= jsval_to_vector2(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + cocos2d::Vec2 arg2; + ok &= jsval_to_vector2(cx, args.get(2), &arg2); + if (!ok) { ok = true; break; } + cobj->scrollToItem(arg0, arg1, arg2); + args.rval().setUndefined(); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_ui_ListView_scrollToItem : wrong number of arguments"); + return false; +} bool js_cocos2dx_ui_ListView_jumpToItem(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -8838,24 +8925,24 @@ bool js_cocos2dx_ui_ListView_jumpToItem(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_ui_ListView_jumpToItem : wrong number of arguments: %d, was expecting %d", argc, 3); return false; } -bool js_cocos2dx_ui_ListView_setMagneticType(JSContext *cx, uint32_t argc, jsval *vp) +bool js_cocos2dx_ui_ListView_setTopPadding(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); bool ok = true; JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); js_proxy_t *proxy = jsb_get_js_proxy(obj); cocos2d::ui::ListView* cobj = (cocos2d::ui::ListView *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ListView_setMagneticType : Invalid Native Object"); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ListView_setTopPadding : Invalid Native Object"); if (argc == 1) { - cocos2d::ui::ListView::MagneticType arg0; - ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ListView_setMagneticType : Error processing arguments"); - cobj->setMagneticType(arg0); + double arg0 = 0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ListView_setTopPadding : Error processing arguments"); + cobj->setTopPadding(arg0); args.rval().setUndefined(); return true; } - JS_ReportError(cx, "js_cocos2dx_ui_ListView_setMagneticType : wrong number of arguments: %d, was expecting %d", argc, 1); + JS_ReportError(cx, "js_cocos2dx_ui_ListView_setTopPadding : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } bool js_cocos2dx_ui_ListView_getIndex(JSContext *cx, uint32_t argc, jsval *vp) @@ -8956,6 +9043,26 @@ bool js_cocos2dx_ui_ListView_insertDefaultItem(JSContext *cx, uint32_t argc, jsv JS_ReportError(cx, "js_cocos2dx_ui_ListView_insertDefaultItem : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_ui_ListView_setMagneticType(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::ui::ListView* cobj = (cocos2d::ui::ListView *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ListView_setMagneticType : Invalid Native Object"); + if (argc == 1) { + cocos2d::ui::ListView::MagneticType arg0; + ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ListView_setMagneticType : Error processing arguments"); + cobj->setMagneticType(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_ui_ListView_setMagneticType : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} bool js_cocos2dx_ui_ListView_setMagneticAllowedOutOfBoundary(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -9061,6 +9168,32 @@ bool js_cocos2dx_ui_ListView_getTopmostItemInCurrentView(JSContext *cx, uint32_t JS_ReportError(cx, "js_cocos2dx_ui_ListView_getTopmostItemInCurrentView : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_ui_ListView_setPadding(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::ui::ListView* cobj = (cocos2d::ui::ListView *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ListView_setPadding : Invalid Native Object"); + if (argc == 4) { + double arg0 = 0; + double arg1 = 0; + double arg2 = 0; + double arg3 = 0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ListView_setPadding : Error processing arguments"); + cobj->setPadding(arg0, arg1, arg2, arg3); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_ui_ListView_setPadding : wrong number of arguments: %d, was expecting %d", argc, 4); + return false; +} bool js_cocos2dx_ui_ListView_removeAllItems(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -9077,6 +9210,24 @@ bool js_cocos2dx_ui_ListView_removeAllItems(JSContext *cx, uint32_t argc, jsval JS_ReportError(cx, "js_cocos2dx_ui_ListView_removeAllItems : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_ui_ListView_getRightPadding(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::ui::ListView* cobj = (cocos2d::ui::ListView *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ListView_getRightPadding : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getRightPadding(); + JS::RootedValue jsret(cx); + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_ui_ListView_getRightPadding : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_ui_ListView_getBottommostItemInCurrentView(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -9223,55 +9374,22 @@ bool js_cocos2dx_ui_ListView_removeItem(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_ui_ListView_removeItem : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } -bool js_cocos2dx_ui_ListView_scrollToItem(JSContext *cx, uint32_t argc, jsval *vp) +bool js_cocos2dx_ui_ListView_getTopPadding(JSContext *cx, uint32_t argc, jsval *vp) { - bool ok = true; - cocos2d::ui::ListView* cobj = nullptr; - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - JS::RootedObject obj(cx); - obj.set(args.thisv().toObjectOrNull()); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); js_proxy_t *proxy = jsb_get_js_proxy(obj); - cobj = (cocos2d::ui::ListView *)(proxy ? proxy->ptr : nullptr); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ListView_scrollToItem : Invalid Native Object"); - do { - if (argc == 4) { - ssize_t arg0 = 0; - ok &= jsval_to_ssize(cx, args.get(0), &arg0); - if (!ok) { ok = true; break; } - cocos2d::Vec2 arg1; - ok &= jsval_to_vector2(cx, args.get(1), &arg1); - if (!ok) { ok = true; break; } - cocos2d::Vec2 arg2; - ok &= jsval_to_vector2(cx, args.get(2), &arg2); - if (!ok) { ok = true; break; } - double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); - if (!ok) { ok = true; break; } - cobj->scrollToItem(arg0, arg1, arg2, arg3); - args.rval().setUndefined(); - return true; - } - } while(0); + cocos2d::ui::ListView* cobj = (cocos2d::ui::ListView *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ListView_getTopPadding : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getTopPadding(); + JS::RootedValue jsret(cx); + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } - do { - if (argc == 3) { - ssize_t arg0 = 0; - ok &= jsval_to_ssize(cx, args.get(0), &arg0); - if (!ok) { ok = true; break; } - cocos2d::Vec2 arg1; - ok &= jsval_to_vector2(cx, args.get(1), &arg1); - if (!ok) { ok = true; break; } - cocos2d::Vec2 arg2; - ok &= jsval_to_vector2(cx, args.get(2), &arg2); - if (!ok) { ok = true; break; } - cobj->scrollToItem(arg0, arg1, arg2); - args.rval().setUndefined(); - return true; - } - } while(0); - - JS_ReportError(cx, "js_cocos2dx_ui_ListView_scrollToItem : wrong number of arguments"); + JS_ReportError(cx, "js_cocos2dx_ui_ListView_getTopPadding : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } bool js_cocos2dx_ui_ListView_pushBackDefaultItem(JSContext *cx, uint32_t argc, jsval *vp) @@ -9290,22 +9408,24 @@ bool js_cocos2dx_ui_ListView_pushBackDefaultItem(JSContext *cx, uint32_t argc, j JS_ReportError(cx, "js_cocos2dx_ui_ListView_pushBackDefaultItem : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } -bool js_cocos2dx_ui_ListView_getMagneticAllowedOutOfBoundary(JSContext *cx, uint32_t argc, jsval *vp) +bool js_cocos2dx_ui_ListView_setLeftPadding(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); js_proxy_t *proxy = jsb_get_js_proxy(obj); cocos2d::ui::ListView* cobj = (cocos2d::ui::ListView *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ListView_getMagneticAllowedOutOfBoundary : Invalid Native Object"); - if (argc == 0) { - bool ret = cobj->getMagneticAllowedOutOfBoundary(); - JS::RootedValue jsret(cx); - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ListView_setLeftPadding : Invalid Native Object"); + if (argc == 1) { + double arg0 = 0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ListView_setLeftPadding : Error processing arguments"); + cobj->setLeftPadding(arg0); + args.rval().setUndefined(); return true; } - JS_ReportError(cx, "js_cocos2dx_ui_ListView_getMagneticAllowedOutOfBoundary : wrong number of arguments: %d, was expecting %d", argc, 0); + JS_ReportError(cx, "js_cocos2dx_ui_ListView_setLeftPadding : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } bool js_cocos2dx_ui_ListView_getClosestItemToPosition(JSContext *cx, uint32_t argc, jsval *vp) @@ -9336,26 +9456,24 @@ bool js_cocos2dx_ui_ListView_getClosestItemToPosition(JSContext *cx, uint32_t ar JS_ReportError(cx, "js_cocos2dx_ui_ListView_getClosestItemToPosition : wrong number of arguments: %d, was expecting %d", argc, 2); return false; } -bool js_cocos2dx_ui_ListView_getRightmostItemInCurrentView(JSContext *cx, uint32_t argc, jsval *vp) +bool js_cocos2dx_ui_ListView_setBottomPadding(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); js_proxy_t *proxy = jsb_get_js_proxy(obj); cocos2d::ui::ListView* cobj = (cocos2d::ui::ListView *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ListView_getRightmostItemInCurrentView : Invalid Native Object"); - if (argc == 0) { - cocos2d::ui::Widget* ret = cobj->getRightmostItemInCurrentView(); - JS::RootedValue jsret(cx); - if (ret) { - jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Widget*)ret)); - } else { - jsret = JSVAL_NULL; - }; - args.rval().set(jsret); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ListView_setBottomPadding : Invalid Native Object"); + if (argc == 1) { + double arg0 = 0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ListView_setBottomPadding : Error processing arguments"); + cobj->setBottomPadding(arg0); + args.rval().setUndefined(); return true; } - JS_ReportError(cx, "js_cocos2dx_ui_ListView_getRightmostItemInCurrentView : wrong number of arguments: %d, was expecting %d", argc, 0); + JS_ReportError(cx, "js_cocos2dx_ui_ListView_setBottomPadding : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } bool js_cocos2dx_ui_ListView_setScrollDuration(JSContext *cx, uint32_t argc, jsval *vp) @@ -9406,6 +9524,48 @@ bool js_cocos2dx_ui_ListView_getClosestItemToPositionInCurrentView(JSContext *cx JS_ReportError(cx, "js_cocos2dx_ui_ListView_getClosestItemToPositionInCurrentView : wrong number of arguments: %d, was expecting %d", argc, 2); return false; } +bool js_cocos2dx_ui_ListView_getRightmostItemInCurrentView(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::ui::ListView* cobj = (cocos2d::ui::ListView *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ListView_getRightmostItemInCurrentView : Invalid Native Object"); + if (argc == 0) { + cocos2d::ui::Widget* ret = cobj->getRightmostItemInCurrentView(); + JS::RootedValue jsret(cx); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Widget*)ret)); + } else { + jsret = JSVAL_NULL; + }; + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_ui_ListView_getRightmostItemInCurrentView : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_ui_ListView_setRightPadding(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::ui::ListView* cobj = (cocos2d::ui::ListView *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ListView_setRightPadding : Invalid Native Object"); + if (argc == 1) { + double arg0 = 0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ListView_setRightPadding : Error processing arguments"); + cobj->setRightPadding(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_ui_ListView_setRightPadding : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} bool js_cocos2dx_ui_ListView_setItemModel(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -9434,6 +9594,24 @@ bool js_cocos2dx_ui_ListView_setItemModel(JSContext *cx, uint32_t argc, jsval *v JS_ReportError(cx, "js_cocos2dx_ui_ListView_setItemModel : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_ui_ListView_getBottomPadding(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::ui::ListView* cobj = (cocos2d::ui::ListView *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ListView_getBottomPadding : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getBottomPadding(); + JS::RootedValue jsret(cx); + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_ui_ListView_getBottomPadding : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_ui_ListView_insertCustomItem(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -9531,21 +9709,27 @@ void js_register_cocos2dx_ui_ListView(JSContext *cx, JS::HandleObject global) { static JSFunctionSpec funcs[] = { JS_FN("setGravity", js_cocos2dx_ui_ListView_setGravity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("removeLastItem", js_cocos2dx_ui_ListView_removeLastItem, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getLeftPadding", js_cocos2dx_ui_ListView_getLeftPadding, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getCenterItemInCurrentView", js_cocos2dx_ui_ListView_getCenterItemInCurrentView, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getCurSelectedIndex", js_cocos2dx_ui_ListView_getCurSelectedIndex, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getScrollDuration", js_cocos2dx_ui_ListView_getScrollDuration, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getMagneticAllowedOutOfBoundary", js_cocos2dx_ui_ListView_getMagneticAllowedOutOfBoundary, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getItemsMargin", js_cocos2dx_ui_ListView_getItemsMargin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("scrollToItem", js_cocos2dx_ui_ListView_scrollToItem, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("jumpToItem", js_cocos2dx_ui_ListView_jumpToItem, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("setMagneticType", js_cocos2dx_ui_ListView_setMagneticType, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setTopPadding", js_cocos2dx_ui_ListView_setTopPadding, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getIndex", js_cocos2dx_ui_ListView_getIndex, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("pushBackCustomItem", js_cocos2dx_ui_ListView_pushBackCustomItem, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setCurSelectedIndex", js_cocos2dx_ui_ListView_setCurSelectedIndex, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("insertDefaultItem", js_cocos2dx_ui_ListView_insertDefaultItem, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setMagneticType", js_cocos2dx_ui_ListView_setMagneticType, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setMagneticAllowedOutOfBoundary", js_cocos2dx_ui_ListView_setMagneticAllowedOutOfBoundary, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("addEventListener", js_cocos2dx_ui_ListView_addEventListener, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("doLayout", js_cocos2dx_ui_ListView_doLayout, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getTopmostItemInCurrentView", js_cocos2dx_ui_ListView_getTopmostItemInCurrentView, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setPadding", js_cocos2dx_ui_ListView_setPadding, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("removeAllItems", js_cocos2dx_ui_ListView_removeAllItems, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getRightPadding", js_cocos2dx_ui_ListView_getRightPadding, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getBottommostItemInCurrentView", js_cocos2dx_ui_ListView_getBottommostItemInCurrentView, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getItems", js_cocos2dx_ui_ListView_getItems, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getLeftmostItemInCurrentView", js_cocos2dx_ui_ListView_getLeftmostItemInCurrentView, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -9553,14 +9737,17 @@ void js_register_cocos2dx_ui_ListView(JSContext *cx, JS::HandleObject global) { JS_FN("getMagneticType", js_cocos2dx_ui_ListView_getMagneticType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getItem", js_cocos2dx_ui_ListView_getItem, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("removeItem", js_cocos2dx_ui_ListView_removeItem, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("scrollToItem", js_cocos2dx_ui_ListView_scrollToItem, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getTopPadding", js_cocos2dx_ui_ListView_getTopPadding, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("pushBackDefaultItem", js_cocos2dx_ui_ListView_pushBackDefaultItem, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getMagneticAllowedOutOfBoundary", js_cocos2dx_ui_ListView_getMagneticAllowedOutOfBoundary, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setLeftPadding", js_cocos2dx_ui_ListView_setLeftPadding, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getClosestItemToPosition", js_cocos2dx_ui_ListView_getClosestItemToPosition, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getRightmostItemInCurrentView", js_cocos2dx_ui_ListView_getRightmostItemInCurrentView, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setBottomPadding", js_cocos2dx_ui_ListView_setBottomPadding, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setScrollDuration", js_cocos2dx_ui_ListView_setScrollDuration, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getClosestItemToPositionInCurrentView", js_cocos2dx_ui_ListView_getClosestItemToPositionInCurrentView, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getRightmostItemInCurrentView", js_cocos2dx_ui_ListView_getRightmostItemInCurrentView, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setRightPadding", js_cocos2dx_ui_ListView_setRightPadding, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setItemModel", js_cocos2dx_ui_ListView_setItemModel, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getBottomPadding", js_cocos2dx_ui_ListView_getBottomPadding, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("insertCustomItem", js_cocos2dx_ui_ListView_insertCustomItem, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("ctor", js_cocos2dx_ui_ListView_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.hpp index 94ee1ea109..71904d4eb5 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.hpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.hpp @@ -462,21 +462,27 @@ void js_register_cocos2dx_ui_ListView(JSContext *cx, JS::HandleObject global); void register_all_cocos2dx_ui(JSContext* cx, JS::HandleObject obj); bool js_cocos2dx_ui_ListView_setGravity(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_removeLastItem(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_ListView_getLeftPadding(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_getCenterItemInCurrentView(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_getCurSelectedIndex(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_getScrollDuration(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_ListView_getMagneticAllowedOutOfBoundary(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_getItemsMargin(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_ListView_scrollToItem(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_jumpToItem(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_ui_ListView_setMagneticType(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_ListView_setTopPadding(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_getIndex(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_pushBackCustomItem(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_setCurSelectedIndex(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_insertDefaultItem(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_ListView_setMagneticType(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_setMagneticAllowedOutOfBoundary(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_addEventListener(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_doLayout(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_getTopmostItemInCurrentView(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_ListView_setPadding(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_removeAllItems(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_ListView_getRightPadding(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_getBottommostItemInCurrentView(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_getItems(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_getLeftmostItemInCurrentView(JSContext *cx, uint32_t argc, jsval *vp); @@ -484,14 +490,17 @@ bool js_cocos2dx_ui_ListView_setItemsMargin(JSContext *cx, uint32_t argc, jsval bool js_cocos2dx_ui_ListView_getMagneticType(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_getItem(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_removeItem(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_ui_ListView_scrollToItem(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_ListView_getTopPadding(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_pushBackDefaultItem(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_ui_ListView_getMagneticAllowedOutOfBoundary(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_ListView_setLeftPadding(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_getClosestItemToPosition(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_ui_ListView_getRightmostItemInCurrentView(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_ListView_setBottomPadding(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_setScrollDuration(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_getClosestItemToPositionInCurrentView(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_ListView_getRightmostItemInCurrentView(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_ListView_setRightPadding(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_setItemModel(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_ListView_getBottomPadding(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_insertCustomItem(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_create(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_ListView(JSContext *cx, uint32_t argc, jsval *vp); diff --git a/cocos/scripting/lua-bindings/auto/api/ListView.lua b/cocos/scripting/lua-bindings/auto/api/ListView.lua index 2028d0a91d..f36d39556a 100644 --- a/cocos/scripting/lua-bindings/auto/api/ListView.lua +++ b/cocos/scripting/lua-bindings/auto/api/ListView.lua @@ -18,6 +18,13 @@ -- @param self -- @return ListView#ListView self (return value: ccui.ListView) +-------------------------------- +-- Get the left padding in ListView
+-- return Left padding in float +-- @function [parent=#ListView] getLeftPadding +-- @param self +-- @return float#float ret (return value: float) + -------------------------------- -- brief Query the center item
-- return An item instance. @@ -40,6 +47,12 @@ -- @param self -- @return float#float ret (return value: float) +-------------------------------- +-- Query whether the magnetic out of boundary is allowed. +-- @function [parent=#ListView] getMagneticAllowedOutOfBoundary +-- @param self +-- @return bool#bool ret (return value: bool) + -------------------------------- -- brief Query margin between each item in ListView.
-- return A margin in float. @@ -47,6 +60,17 @@ -- @param self -- @return float#float ret (return value: float) +-------------------------------- +-- @overload self, int, vec2_table, vec2_table, float +-- @overload self, int, vec2_table, vec2_table +-- @function [parent=#ListView] scrollToItem +-- @param self +-- @param #int itemIndex +-- @param #vec2_table positionRatioInView +-- @param #vec2_table itemAnchorPoint +-- @param #float timeInSec +-- @return ListView#ListView self (return value: ccui.ListView) + -------------------------------- -- brief Jump to specific item
-- param itemIndex Specifies the item's index
@@ -60,11 +84,11 @@ -- @return ListView#ListView self (return value: ccui.ListView) -------------------------------- --- Set magnetic type of ListView.
--- see `MagneticType` --- @function [parent=#ListView] setMagneticType +-- Change padding with top padding
+-- param t Top padding in float +-- @function [parent=#ListView] setTopPadding -- @param self --- @param #int magneticType +-- @param #float t -- @return ListView#ListView self (return value: ccui.ListView) -------------------------------- @@ -100,6 +124,14 @@ -- @param #int index -- @return ListView#ListView self (return value: ccui.ListView) +-------------------------------- +-- Set magnetic type of ListView.
+-- see `MagneticType` +-- @function [parent=#ListView] setMagneticType +-- @param self +-- @param #int magneticType +-- @return ListView#ListView self (return value: ccui.ListView) + -------------------------------- -- Set magnetic allowed out of boundary. -- @function [parent=#ListView] setMagneticAllowedOutOfBoundary @@ -128,12 +160,33 @@ -- @param self -- @return Widget#Widget ret (return value: ccui.Widget) +-------------------------------- +-- Change padding with left, top, right, and bottom padding.
+-- param l Left padding in float.
+-- param t Top margin in float.
+-- param r Right margin in float.
+-- param b Bottom margin in float. +-- @function [parent=#ListView] setPadding +-- @param self +-- @param #float l +-- @param #float t +-- @param #float r +-- @param #float b +-- @return ListView#ListView self (return value: ccui.ListView) + -------------------------------- -- brief Remove all items in current ListView. -- @function [parent=#ListView] removeAllItems -- @param self -- @return ListView#ListView self (return value: ccui.ListView) +-------------------------------- +-- Get the right padding in ListView
+-- return Right padding in float +-- @function [parent=#ListView] getRightPadding +-- @param self +-- @return float#float ret (return value: float) + -------------------------------- -- brief Query the bottommost item in horizontal list
-- return An item instance. @@ -187,16 +240,12 @@ -- @return ListView#ListView self (return value: ccui.ListView) -------------------------------- --- @overload self, int, vec2_table, vec2_table, float --- @overload self, int, vec2_table, vec2_table --- @function [parent=#ListView] scrollToItem +-- Get the top padding in ListView
+-- return Top padding in float +-- @function [parent=#ListView] getTopPadding -- @param self --- @param #int itemIndex --- @param #vec2_table positionRatioInView --- @param #vec2_table itemAnchorPoint --- @param #float timeInSec --- @return ListView#ListView self (return value: ccui.ListView) - +-- @return float#float ret (return value: float) + -------------------------------- -- Insert a default item(create by a cloned model) at the end of the listview. -- @function [parent=#ListView] pushBackDefaultItem @@ -204,10 +253,12 @@ -- @return ListView#ListView self (return value: ccui.ListView) -------------------------------- --- Query whether the magnetic out of boundary is allowed. --- @function [parent=#ListView] getMagneticAllowedOutOfBoundary +-- Change padding with left padding
+-- param l Left padding in float. +-- @function [parent=#ListView] setLeftPadding -- @param self --- @return bool#bool ret (return value: bool) +-- @param #float l +-- @return ListView#ListView self (return value: ccui.ListView) -------------------------------- -- brief Query the closest item to a specific position in inner container.
@@ -221,11 +272,12 @@ -- @return Widget#Widget ret (return value: ccui.Widget) -------------------------------- --- brief Query the rightmost item in horizontal list
--- return An item instance. --- @function [parent=#ListView] getRightmostItemInCurrentView +-- Change padding with bottom padding
+-- param b Bottom padding in float +-- @function [parent=#ListView] setBottomPadding -- @param self --- @return Widget#Widget ret (return value: ccui.Widget) +-- @param #float b +-- @return ListView#ListView self (return value: ccui.ListView) -------------------------------- -- Set the time in seconds to scroll between items.
@@ -249,6 +301,21 @@ -- @param #vec2_table itemAnchorPoint -- @return Widget#Widget ret (return value: ccui.Widget) +-------------------------------- +-- brief Query the rightmost item in horizontal list
+-- return An item instance. +-- @function [parent=#ListView] getRightmostItemInCurrentView +-- @param self +-- @return Widget#Widget ret (return value: ccui.Widget) + +-------------------------------- +-- Change padding with right padding
+-- param r Right padding in float +-- @function [parent=#ListView] setRightPadding +-- @param self +-- @param #float r +-- @return ListView#ListView self (return value: ccui.ListView) + -------------------------------- -- Set an item model for listview.
-- When calling `pushBackDefaultItem`, the model will be used as a blueprint and new model copy will be inserted into ListView.
@@ -258,6 +325,13 @@ -- @param #ccui.Widget model -- @return ListView#ListView self (return value: ccui.ListView) +-------------------------------- +-- Get the bottom padding in ListView
+-- return Bottom padding in float +-- @function [parent=#ListView] getBottomPadding +-- @param self +-- @return float#float ret (return value: float) + -------------------------------- -- brief Insert a custom widget into ListView at a given index.
-- param item A widget pointer to be inserted.
diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp index 570e338e92..e3fa456261 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp @@ -17288,6 +17288,53 @@ int lua_cocos2dx_ui_ListView_removeLastItem(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_ListView_getLeftPadding(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::ListView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.ListView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::ListView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_ListView_getLeftPadding'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_ListView_getLeftPadding'", nullptr); + return 0; + } + double ret = cobj->getLeftPadding(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.ListView:getLeftPadding",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_ListView_getLeftPadding'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_ListView_getCenterItemInCurrentView(lua_State* tolua_S) { int argc = 0; @@ -17429,6 +17476,53 @@ int lua_cocos2dx_ui_ListView_getScrollDuration(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_ListView_getMagneticAllowedOutOfBoundary(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::ListView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.ListView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::ListView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_ListView_getMagneticAllowedOutOfBoundary'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_ListView_getMagneticAllowedOutOfBoundary'", nullptr); + return 0; + } + bool ret = cobj->getMagneticAllowedOutOfBoundary(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.ListView:getMagneticAllowedOutOfBoundary",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_ListView_getMagneticAllowedOutOfBoundary'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_ListView_getItemsMargin(lua_State* tolua_S) { int argc = 0; @@ -17476,6 +17570,81 @@ int lua_cocos2dx_ui_ListView_getItemsMargin(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_ListView_scrollToItem(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::ListView* cobj = nullptr; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.ListView",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::ui::ListView*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_ListView_scrollToItem'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 4) { + ssize_t arg0; + ok &= luaval_to_ssize(tolua_S, 2, &arg0, "ccui.ListView:scrollToItem"); + + if (!ok) { break; } + cocos2d::Vec2 arg1; + ok &= luaval_to_vec2(tolua_S, 3, &arg1, "ccui.ListView:scrollToItem"); + + if (!ok) { break; } + cocos2d::Vec2 arg2; + ok &= luaval_to_vec2(tolua_S, 4, &arg2, "ccui.ListView:scrollToItem"); + + if (!ok) { break; } + double arg3; + ok &= luaval_to_number(tolua_S, 5,&arg3, "ccui.ListView:scrollToItem"); + + if (!ok) { break; } + cobj->scrollToItem(arg0, arg1, arg2, arg3); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 3) { + ssize_t arg0; + ok &= luaval_to_ssize(tolua_S, 2, &arg0, "ccui.ListView:scrollToItem"); + + if (!ok) { break; } + cocos2d::Vec2 arg1; + ok &= luaval_to_vec2(tolua_S, 3, &arg1, "ccui.ListView:scrollToItem"); + + if (!ok) { break; } + cocos2d::Vec2 arg2; + ok &= luaval_to_vec2(tolua_S, 4, &arg2, "ccui.ListView:scrollToItem"); + + if (!ok) { break; } + cobj->scrollToItem(arg0, arg1, arg2); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.ListView:scrollToItem",argc, 3); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_ListView_scrollToItem'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_ListView_jumpToItem(lua_State* tolua_S) { int argc = 0; @@ -17532,7 +17701,7 @@ int lua_cocos2dx_ui_ListView_jumpToItem(lua_State* tolua_S) return 0; } -int lua_cocos2dx_ui_ListView_setMagneticType(lua_State* tolua_S) +int lua_cocos2dx_ui_ListView_setTopPadding(lua_State* tolua_S) { int argc = 0; cocos2d::ui::ListView* cobj = nullptr; @@ -17552,7 +17721,7 @@ int lua_cocos2dx_ui_ListView_setMagneticType(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_ListView_setMagneticType'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_ListView_setTopPadding'", nullptr); return 0; } #endif @@ -17560,24 +17729,24 @@ int lua_cocos2dx_ui_ListView_setMagneticType(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::ui::ListView::MagneticType arg0; + double arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "ccui.ListView:setMagneticType"); + ok &= luaval_to_number(tolua_S, 2,&arg0, "ccui.ListView:setTopPadding"); if(!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_ListView_setMagneticType'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_ListView_setTopPadding'", nullptr); return 0; } - cobj->setMagneticType(arg0); + cobj->setTopPadding(arg0); lua_settop(tolua_S, 1); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.ListView:setMagneticType",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.ListView:setTopPadding",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_ListView_setMagneticType'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_ListView_setTopPadding'.",&tolua_err); #endif return 0; @@ -17782,6 +17951,56 @@ int lua_cocos2dx_ui_ListView_insertDefaultItem(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_ListView_setMagneticType(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::ListView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.ListView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::ListView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_ListView_setMagneticType'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::ui::ListView::MagneticType arg0; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "ccui.ListView:setMagneticType"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_ListView_setMagneticType'", nullptr); + return 0; + } + cobj->setMagneticType(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.ListView:setMagneticType",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_ListView_setMagneticType'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_ListView_setMagneticAllowedOutOfBoundary(lua_State* tolua_S) { int argc = 0; @@ -17980,6 +18199,65 @@ int lua_cocos2dx_ui_ListView_getTopmostItemInCurrentView(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_ListView_setPadding(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::ListView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.ListView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::ListView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_ListView_setPadding'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 4) + { + double arg0; + double arg1; + double arg2; + double arg3; + + ok &= luaval_to_number(tolua_S, 2,&arg0, "ccui.ListView:setPadding"); + + ok &= luaval_to_number(tolua_S, 3,&arg1, "ccui.ListView:setPadding"); + + ok &= luaval_to_number(tolua_S, 4,&arg2, "ccui.ListView:setPadding"); + + ok &= luaval_to_number(tolua_S, 5,&arg3, "ccui.ListView:setPadding"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_ListView_setPadding'", nullptr); + return 0; + } + cobj->setPadding(arg0, arg1, arg2, arg3); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.ListView:setPadding",argc, 4); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_ListView_setPadding'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_ListView_removeAllItems(lua_State* tolua_S) { int argc = 0; @@ -18027,6 +18305,53 @@ int lua_cocos2dx_ui_ListView_removeAllItems(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_ListView_getRightPadding(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::ListView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.ListView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::ListView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_ListView_getRightPadding'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_ListView_getRightPadding'", nullptr); + return 0; + } + double ret = cobj->getRightPadding(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.ListView:getRightPadding",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_ListView_getRightPadding'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_ListView_getBottommostItemInCurrentView(lua_State* tolua_S) { int argc = 0; @@ -18365,77 +18690,49 @@ int lua_cocos2dx_ui_ListView_removeItem(lua_State* tolua_S) return 0; } -int lua_cocos2dx_ui_ListView_scrollToItem(lua_State* tolua_S) +int lua_cocos2dx_ui_ListView_getTopPadding(lua_State* tolua_S) { int argc = 0; cocos2d::ui::ListView* cobj = nullptr; bool ok = true; + #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; #endif + #if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccui.ListView",0,&tolua_err)) goto tolua_lerror; #endif + cobj = (cocos2d::ui::ListView*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) + if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_ListView_scrollToItem'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_ListView_getTopPadding'", nullptr); return 0; } #endif + argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 4) { - ssize_t arg0; - ok &= luaval_to_ssize(tolua_S, 2, &arg0, "ccui.ListView:scrollToItem"); - - if (!ok) { break; } - cocos2d::Vec2 arg1; - ok &= luaval_to_vec2(tolua_S, 3, &arg1, "ccui.ListView:scrollToItem"); - - if (!ok) { break; } - cocos2d::Vec2 arg2; - ok &= luaval_to_vec2(tolua_S, 4, &arg2, "ccui.ListView:scrollToItem"); - - if (!ok) { break; } - double arg3; - ok &= luaval_to_number(tolua_S, 5,&arg3, "ccui.ListView:scrollToItem"); - - if (!ok) { break; } - cobj->scrollToItem(arg0, arg1, arg2, arg3); - lua_settop(tolua_S, 1); - return 1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_ListView_getTopPadding'", nullptr); + return 0; } - }while(0); - ok = true; - do{ - if (argc == 3) { - ssize_t arg0; - ok &= luaval_to_ssize(tolua_S, 2, &arg0, "ccui.ListView:scrollToItem"); - - if (!ok) { break; } - cocos2d::Vec2 arg1; - ok &= luaval_to_vec2(tolua_S, 3, &arg1, "ccui.ListView:scrollToItem"); - - if (!ok) { break; } - cocos2d::Vec2 arg2; - ok &= luaval_to_vec2(tolua_S, 4, &arg2, "ccui.ListView:scrollToItem"); - - if (!ok) { break; } - cobj->scrollToItem(arg0, arg1, arg2); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.ListView:scrollToItem",argc, 3); + double ret = cobj->getTopPadding(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.ListView:getTopPadding",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_ListView_scrollToItem'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_ListView_getTopPadding'.",&tolua_err); #endif return 0; @@ -18487,7 +18784,7 @@ int lua_cocos2dx_ui_ListView_pushBackDefaultItem(lua_State* tolua_S) return 0; } -int lua_cocos2dx_ui_ListView_getMagneticAllowedOutOfBoundary(lua_State* tolua_S) +int lua_cocos2dx_ui_ListView_setLeftPadding(lua_State* tolua_S) { int argc = 0; cocos2d::ui::ListView* cobj = nullptr; @@ -18507,29 +18804,32 @@ int lua_cocos2dx_ui_ListView_getMagneticAllowedOutOfBoundary(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_ListView_getMagneticAllowedOutOfBoundary'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_ListView_setLeftPadding'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) + if (argc == 1) { + double arg0; + + ok &= luaval_to_number(tolua_S, 2,&arg0, "ccui.ListView:setLeftPadding"); if(!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_ListView_getMagneticAllowedOutOfBoundary'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_ListView_setLeftPadding'", nullptr); return 0; } - bool ret = cobj->getMagneticAllowedOutOfBoundary(); - tolua_pushboolean(tolua_S,(bool)ret); + cobj->setLeftPadding(arg0); + lua_settop(tolua_S, 1); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.ListView:getMagneticAllowedOutOfBoundary",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.ListView:setLeftPadding",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_ListView_getMagneticAllowedOutOfBoundary'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_ListView_setLeftPadding'.",&tolua_err); #endif return 0; @@ -18587,7 +18887,7 @@ int lua_cocos2dx_ui_ListView_getClosestItemToPosition(lua_State* tolua_S) return 0; } -int lua_cocos2dx_ui_ListView_getRightmostItemInCurrentView(lua_State* tolua_S) +int lua_cocos2dx_ui_ListView_setBottomPadding(lua_State* tolua_S) { int argc = 0; cocos2d::ui::ListView* cobj = nullptr; @@ -18607,29 +18907,32 @@ int lua_cocos2dx_ui_ListView_getRightmostItemInCurrentView(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_ListView_getRightmostItemInCurrentView'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_ListView_setBottomPadding'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) + if (argc == 1) { + double arg0; + + ok &= luaval_to_number(tolua_S, 2,&arg0, "ccui.ListView:setBottomPadding"); if(!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_ListView_getRightmostItemInCurrentView'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_ListView_setBottomPadding'", nullptr); return 0; } - cocos2d::ui::Widget* ret = cobj->getRightmostItemInCurrentView(); - object_to_luaval(tolua_S, "ccui.Widget",(cocos2d::ui::Widget*)ret); + cobj->setBottomPadding(arg0); + lua_settop(tolua_S, 1); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.ListView:getRightmostItemInCurrentView",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.ListView:setBottomPadding",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_ListView_getRightmostItemInCurrentView'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_ListView_setBottomPadding'.",&tolua_err); #endif return 0; @@ -18737,6 +19040,103 @@ int lua_cocos2dx_ui_ListView_getClosestItemToPositionInCurrentView(lua_State* to return 0; } +int lua_cocos2dx_ui_ListView_getRightmostItemInCurrentView(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::ListView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.ListView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::ListView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_ListView_getRightmostItemInCurrentView'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_ListView_getRightmostItemInCurrentView'", nullptr); + return 0; + } + cocos2d::ui::Widget* ret = cobj->getRightmostItemInCurrentView(); + object_to_luaval(tolua_S, "ccui.Widget",(cocos2d::ui::Widget*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.ListView:getRightmostItemInCurrentView",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_ListView_getRightmostItemInCurrentView'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_ui_ListView_setRightPadding(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::ListView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.ListView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::ListView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_ListView_setRightPadding'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + double arg0; + + ok &= luaval_to_number(tolua_S, 2,&arg0, "ccui.ListView:setRightPadding"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_ListView_setRightPadding'", nullptr); + return 0; + } + cobj->setRightPadding(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.ListView:setRightPadding",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_ListView_setRightPadding'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_ListView_setItemModel(lua_State* tolua_S) { int argc = 0; @@ -18787,6 +19187,53 @@ int lua_cocos2dx_ui_ListView_setItemModel(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_ListView_getBottomPadding(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::ListView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.ListView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::ListView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_ListView_getBottomPadding'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_ListView_getBottomPadding'", nullptr); + return 0; + } + double ret = cobj->getBottomPadding(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.ListView:getBottomPadding",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_ListView_getBottomPadding'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_ListView_insertCustomItem(lua_State* tolua_S) { int argc = 0; @@ -18960,21 +19407,27 @@ int lua_register_cocos2dx_ui_ListView(lua_State* tolua_S) tolua_function(tolua_S,"new",lua_cocos2dx_ui_ListView_constructor); tolua_function(tolua_S,"setGravity",lua_cocos2dx_ui_ListView_setGravity); tolua_function(tolua_S,"removeLastItem",lua_cocos2dx_ui_ListView_removeLastItem); + tolua_function(tolua_S,"getLeftPadding",lua_cocos2dx_ui_ListView_getLeftPadding); tolua_function(tolua_S,"getCenterItemInCurrentView",lua_cocos2dx_ui_ListView_getCenterItemInCurrentView); tolua_function(tolua_S,"getCurSelectedIndex",lua_cocos2dx_ui_ListView_getCurSelectedIndex); tolua_function(tolua_S,"getScrollDuration",lua_cocos2dx_ui_ListView_getScrollDuration); + tolua_function(tolua_S,"getMagneticAllowedOutOfBoundary",lua_cocos2dx_ui_ListView_getMagneticAllowedOutOfBoundary); tolua_function(tolua_S,"getItemsMargin",lua_cocos2dx_ui_ListView_getItemsMargin); + tolua_function(tolua_S,"scrollToItem",lua_cocos2dx_ui_ListView_scrollToItem); tolua_function(tolua_S,"jumpToItem",lua_cocos2dx_ui_ListView_jumpToItem); - tolua_function(tolua_S,"setMagneticType",lua_cocos2dx_ui_ListView_setMagneticType); + tolua_function(tolua_S,"setTopPadding",lua_cocos2dx_ui_ListView_setTopPadding); tolua_function(tolua_S,"getIndex",lua_cocos2dx_ui_ListView_getIndex); tolua_function(tolua_S,"pushBackCustomItem",lua_cocos2dx_ui_ListView_pushBackCustomItem); tolua_function(tolua_S,"setCurSelectedIndex",lua_cocos2dx_ui_ListView_setCurSelectedIndex); tolua_function(tolua_S,"insertDefaultItem",lua_cocos2dx_ui_ListView_insertDefaultItem); + tolua_function(tolua_S,"setMagneticType",lua_cocos2dx_ui_ListView_setMagneticType); tolua_function(tolua_S,"setMagneticAllowedOutOfBoundary",lua_cocos2dx_ui_ListView_setMagneticAllowedOutOfBoundary); tolua_function(tolua_S,"addEventListener",lua_cocos2dx_ui_ListView_addEventListener); tolua_function(tolua_S,"doLayout",lua_cocos2dx_ui_ListView_doLayout); tolua_function(tolua_S,"getTopmostItemInCurrentView",lua_cocos2dx_ui_ListView_getTopmostItemInCurrentView); + tolua_function(tolua_S,"setPadding",lua_cocos2dx_ui_ListView_setPadding); tolua_function(tolua_S,"removeAllItems",lua_cocos2dx_ui_ListView_removeAllItems); + tolua_function(tolua_S,"getRightPadding",lua_cocos2dx_ui_ListView_getRightPadding); tolua_function(tolua_S,"getBottommostItemInCurrentView",lua_cocos2dx_ui_ListView_getBottommostItemInCurrentView); tolua_function(tolua_S,"getItems",lua_cocos2dx_ui_ListView_getItems); tolua_function(tolua_S,"getLeftmostItemInCurrentView",lua_cocos2dx_ui_ListView_getLeftmostItemInCurrentView); @@ -18982,14 +19435,17 @@ int lua_register_cocos2dx_ui_ListView(lua_State* tolua_S) tolua_function(tolua_S,"getMagneticType",lua_cocos2dx_ui_ListView_getMagneticType); tolua_function(tolua_S,"getItem",lua_cocos2dx_ui_ListView_getItem); tolua_function(tolua_S,"removeItem",lua_cocos2dx_ui_ListView_removeItem); - tolua_function(tolua_S,"scrollToItem",lua_cocos2dx_ui_ListView_scrollToItem); + tolua_function(tolua_S,"getTopPadding",lua_cocos2dx_ui_ListView_getTopPadding); tolua_function(tolua_S,"pushBackDefaultItem",lua_cocos2dx_ui_ListView_pushBackDefaultItem); - tolua_function(tolua_S,"getMagneticAllowedOutOfBoundary",lua_cocos2dx_ui_ListView_getMagneticAllowedOutOfBoundary); + tolua_function(tolua_S,"setLeftPadding",lua_cocos2dx_ui_ListView_setLeftPadding); tolua_function(tolua_S,"getClosestItemToPosition",lua_cocos2dx_ui_ListView_getClosestItemToPosition); - tolua_function(tolua_S,"getRightmostItemInCurrentView",lua_cocos2dx_ui_ListView_getRightmostItemInCurrentView); + tolua_function(tolua_S,"setBottomPadding",lua_cocos2dx_ui_ListView_setBottomPadding); tolua_function(tolua_S,"setScrollDuration",lua_cocos2dx_ui_ListView_setScrollDuration); tolua_function(tolua_S,"getClosestItemToPositionInCurrentView",lua_cocos2dx_ui_ListView_getClosestItemToPositionInCurrentView); + tolua_function(tolua_S,"getRightmostItemInCurrentView",lua_cocos2dx_ui_ListView_getRightmostItemInCurrentView); + tolua_function(tolua_S,"setRightPadding",lua_cocos2dx_ui_ListView_setRightPadding); tolua_function(tolua_S,"setItemModel",lua_cocos2dx_ui_ListView_setItemModel); + tolua_function(tolua_S,"getBottomPadding",lua_cocos2dx_ui_ListView_getBottomPadding); tolua_function(tolua_S,"insertCustomItem",lua_cocos2dx_ui_ListView_insertCustomItem); tolua_function(tolua_S,"create", lua_cocos2dx_ui_ListView_create); tolua_function(tolua_S,"createInstance", lua_cocos2dx_ui_ListView_createInstance); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp index 1bdb8d489a..aec28613e7 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp @@ -761,6 +761,15 @@ int register_all_cocos2dx_ui(lua_State* tolua_S); + + + + + + + + +