2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
-- @module PageView
|
2014-05-27 10:21:22 +08:00
|
|
|
-- @extend Layout
|
2014-06-25 17:36:50 +08:00
|
|
|
-- @parent_module ccui
|
2014-03-18 15:55:30 +08:00
|
|
|
|
2014-08-15 15:23:17 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- brief Query the custom scroll threshold of the PageView.<br>
|
|
|
|
-- return Custom scroll threshold in float.
|
2014-08-15 15:23:17 +08:00
|
|
|
-- @function [parent=#PageView] getCustomScrollThreshold
|
|
|
|
-- @param self
|
|
|
|
-- @return float#float ret (return value: float)
|
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Gets current displayed page index.<br>
|
2014-09-02 13:45:07 +08:00
|
|
|
-- return current page index.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#PageView] getCurPageIndex
|
|
|
|
-- @param self
|
|
|
|
-- @return long#long ret (return value: long)
|
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Add a widget as a page of PageView in a given index.<br>
|
|
|
|
-- param widget Widget to be added to pageview.<br>
|
|
|
|
-- param pageIdx A given index.<br>
|
|
|
|
-- param forceCreate If `forceCreate` is true and `widget` isn't exists, pageview would create a default page and add it.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#PageView] addWidgetToPage
|
|
|
|
-- @param self
|
|
|
|
-- @param #ccui.Widget widget
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #long pageIdx
|
|
|
|
-- @param #bool forceCreate
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return PageView#PageView self (return value: ccui.PageView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
2014-08-15 15:23:17 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- brief Query whether use user defined scroll page threshold or not.<br>
|
|
|
|
-- return True if using custom scroll threshold, false otherwise.
|
2014-08-15 15:23:17 +08:00
|
|
|
-- @function [parent=#PageView] isUsingCustomScrollThreshold
|
|
|
|
-- @param self
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-07-16 14:04:17 +08:00
|
|
|
-- Jump to a page with a given index without scrolling.<br>
|
|
|
|
-- This is the different between scrollToPage.<br>
|
|
|
|
-- param index A given index in PageView. Index start from 0 to pageCount -1.
|
|
|
|
-- @function [parent=#PageView] setCurPageIndex
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #long index
|
2015-07-16 14:04:17 +08:00
|
|
|
-- @return PageView#PageView self (return value: ccui.PageView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Remove a page of PageView.<br>
|
|
|
|
-- param page Page to be removed.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#PageView] removePage
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #ccui.Layout page
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return PageView#PageView self (return value: ccui.PageView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
2014-05-12 16:14:14 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- brief Add a page turn callback to PageView, then when one page is turning, the callback will be called.<br>
|
|
|
|
-- param callback A page turning callback.
|
2014-05-12 16:14:14 +08:00
|
|
|
-- @function [parent=#PageView] addEventListener
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #function callback
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return PageView#PageView self (return value: ccui.PageView)
|
2014-05-12 16:14:14 +08:00
|
|
|
|
2014-08-15 15:23:17 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- brief Set using user defined scroll page threshold or not.<br>
|
|
|
|
-- If you set it to false, then the default scroll threshold is pageView.width / 2<br>
|
|
|
|
-- param flag True if using custom scroll threshold, false otherwise.
|
2014-08-15 15:23:17 +08:00
|
|
|
-- @function [parent=#PageView] setUsingCustomScrollThreshold
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #bool flag
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return PageView#PageView self (return value: ccui.PageView)
|
2014-08-15 15:23:17 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- brief If you don't specify the value, the pageView will turn page when scrolling at the half width of a page.<br>
|
|
|
|
-- param threshold A threshold in float.
|
2014-08-15 15:23:17 +08:00
|
|
|
-- @function [parent=#PageView] setCustomScrollThreshold
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #float threshold
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return PageView#PageView self (return value: ccui.PageView)
|
2014-08-15 15:23:17 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Insert a page into PageView at a given index.<br>
|
|
|
|
-- param page Page to be inserted.<br>
|
|
|
|
-- param idx A given index.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#PageView] insertPage
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #ccui.Layout page
|
|
|
|
-- @param #int idx
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return PageView#PageView self (return value: ccui.PageView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Scroll to a page with a given index.<br>
|
2015-07-16 14:04:17 +08:00
|
|
|
-- param idx A given index in the PageView. Index start from 0 to pageCount -1.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#PageView] scrollToPage
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #long idx
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return PageView#PageView self (return value: ccui.PageView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
2015-07-16 14:04:17 +08:00
|
|
|
--------------------------------
|
|
|
|
-- brief Get a page at a given index<br>
|
|
|
|
-- param index A given index.<br>
|
|
|
|
-- return A layout pointer in PageView container.
|
|
|
|
-- @function [parent=#PageView] getPage
|
|
|
|
-- @param self
|
|
|
|
-- @param #long index
|
|
|
|
-- @return Layout#Layout ret (return value: ccui.Layout)
|
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Remove a page at a given index of PageView.<br>
|
|
|
|
-- param index A given index.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#PageView] removePageAtIndex
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #long index
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return PageView#PageView self (return value: ccui.PageView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- brief Get all the pages in the PageView.<br>
|
|
|
|
-- return A vector of Layout pionters.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#PageView] getPages
|
|
|
|
-- @param self
|
|
|
|
-- @return array_table#array_table ret (return value: array_table)
|
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- brief Remove all pages of the PageView.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#PageView] removeAllPages
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return PageView#PageView self (return value: ccui.PageView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Insert a page into the end of PageView.<br>
|
|
|
|
-- param page Page to be inserted.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#PageView] addPage
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #ccui.Layout page
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return PageView#PageView self (return value: ccui.PageView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Create an empty PageView.<br>
|
|
|
|
-- return A PageView instance.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#PageView] create
|
|
|
|
-- @param self
|
|
|
|
-- @return PageView#PageView ret (return value: ccui.PageView)
|
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
--
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#PageView] createInstance
|
|
|
|
-- @param self
|
|
|
|
-- @return Ref#Ref ret (return value: cc.Ref)
|
|
|
|
|
2014-03-18 15:55:30 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
--
|
2014-03-18 15:55:30 +08:00
|
|
|
-- @function [parent=#PageView] getLayoutType
|
|
|
|
-- @param self
|
2014-07-17 22:20:04 +08:00
|
|
|
-- @return int#int ret (return value: int)
|
2014-03-18 15:55:30 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
--
|
2014-03-18 15:55:30 +08:00
|
|
|
-- @function [parent=#PageView] getDescription
|
|
|
|
-- @param self
|
|
|
|
-- @return string#string ret (return value: string)
|
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
--
|
2014-03-18 15:55:30 +08:00
|
|
|
-- @function [parent=#PageView] update
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #float dt
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return PageView#PageView self (return value: ccui.PageView)
|
2014-03-18 15:55:30 +08:00
|
|
|
|
2015-05-05 11:31:53 +08:00
|
|
|
--------------------------------
|
|
|
|
--
|
|
|
|
-- @function [parent=#PageView] init
|
|
|
|
-- @param self
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
2014-03-18 15:55:30 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
--
|
2014-03-18 15:55:30 +08:00
|
|
|
-- @function [parent=#PageView] setLayoutType
|
|
|
|
-- @param self
|
2014-07-17 22:20:04 +08:00
|
|
|
-- @param #int type
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return PageView#PageView self (return value: ccui.PageView)
|
2014-03-18 15:55:30 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-31 12:01:57 +08:00
|
|
|
-- Default constructor<br>
|
|
|
|
-- js ctor<br>
|
|
|
|
-- lua new
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#PageView] PageView
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return PageView#PageView self (return value: ccui.PageView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
return nil
|