2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
-- @module ListView
|
2014-03-20 10:21:28 +08:00
|
|
|
-- @extend ScrollView
|
2014-06-25 17:36:50 +08:00
|
|
|
-- @parent_module ccui
|
2014-03-18 15:55:30 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Return the index of specified widget.<br>
|
|
|
|
-- param item A widget pointer.<br>
|
|
|
|
-- return The index of a given widget in ListView.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#ListView] getIndex
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #ccui.Widget item
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @return long#long ret (return value: long)
|
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- brief Remove all items in current ListView.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#ListView] removeAllItems
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Set the gravity of ListView.<br>
|
|
|
|
-- see `ListViewGravity`
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#ListView] setGravity
|
|
|
|
-- @param self
|
2014-07-17 22:20:04 +08:00
|
|
|
-- @param #int gravity
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Insert a custom item into the end of ListView.<br>
|
|
|
|
-- param item A item in `Widget*`.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#ListView] pushBackCustomItem
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #ccui.Widget item
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Return all items in a ListView.<br>
|
|
|
|
-- returns A vector of widget pointers.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#ListView] getItems
|
|
|
|
-- @param self
|
|
|
|
-- @return array_table#array_table ret (return value: array_table)
|
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Remove a item at given index.<br>
|
|
|
|
-- param index A given index in ssize_t.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#ListView] removeItem
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #long index
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- brief Query current selected widget's idnex.<br>
|
|
|
|
-- return A index of a selected item.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#ListView] getCurSelectedIndex
|
|
|
|
-- @param self
|
|
|
|
-- @return long#long ret (return value: long)
|
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Insert a default item(create by cloning model) into listview at a give index.<br>
|
|
|
|
-- param index A index in ssize_t.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#ListView] insertDefaultItem
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #long index
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
2014-06-04 13:58:29 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- brief Refresh view and layout of ListView manually.<br>
|
|
|
|
-- This method will mark ListView content as dirty and the content view will be refershed in the next frame.
|
2014-06-04 13:58:29 +08:00
|
|
|
-- @function [parent=#ListView] requestRefreshView
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
2014-06-04 13:58:29 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Set the margin between each item in ListView.<br>
|
2014-09-02 13:45:07 +08:00
|
|
|
-- param margin
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#ListView] setItemsMargin
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #float margin
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- brief Refresh content view of ListView.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#ListView] refreshView
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Removes the last item of ListView.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#ListView] removeLastItem
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- brief Query margin between each item in ListView.<br>
|
|
|
|
-- return A margin in float.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#ListView] getItemsMargin
|
|
|
|
-- @param self
|
|
|
|
-- @return float#float ret (return value: float)
|
|
|
|
|
2014-05-12 16:14:14 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Add a event click callback to ListView, then one item of Listview is clicked, the callback will be called.<br>
|
|
|
|
-- param callback A callback function with type of `ccListViewCallback`.
|
2014-05-12 16:14:14 +08:00
|
|
|
-- @function [parent=#ListView] addEventListener
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #function callback
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
2014-05-12 16:14:14 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Return a item at a given index.<br>
|
|
|
|
-- param index A given index in ssize_t.<br>
|
|
|
|
-- return A widget instance.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#ListView] getItem
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #long index
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @return Widget#Widget ret (return value: ccui.Widget)
|
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Set a item model for listview.<br>
|
2015-03-27 00:17:35 +08:00
|
|
|
-- When calling `pushBackDefaultItem`, the model will be used as a blueprint and new model copy will be inserted into ListView.<br>
|
2015-03-26 10:44:28 +08:00
|
|
|
-- param model Model in `Widget*`.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#ListView] setItemModel
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #ccui.Widget model
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
--
|
2014-06-04 13:58:29 +08:00
|
|
|
-- @function [parent=#ListView] doLayout
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Insert a a default item(create by a cloned model) at the end of the listview.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#ListView] pushBackDefaultItem
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- brief Insert a custom widget into ListView at a given index.<br>
|
|
|
|
-- param item A widget pointer to be inserted.<br>
|
|
|
|
-- param index A given index in ssize_t.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#ListView] insertCustomItem
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #ccui.Widget item
|
|
|
|
-- @param #long index
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Create an empty ListView.<br>
|
|
|
|
-- return A ListView instance.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#ListView] create
|
|
|
|
-- @param self
|
|
|
|
-- @return ListView#ListView ret (return value: ccui.ListView)
|
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
--
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#ListView] createInstance
|
|
|
|
-- @param self
|
|
|
|
-- @return Ref#Ref ret (return value: cc.Ref)
|
|
|
|
|
2014-05-27 10:21:22 +08:00
|
|
|
--------------------------------
|
2014-07-17 10:28:34 +08:00
|
|
|
-- @overload self, cc.Node, int
|
|
|
|
-- @overload self, cc.Node
|
|
|
|
-- @overload self, cc.Node, int, int
|
|
|
|
-- @overload self, cc.Node, int, string
|
2014-05-27 10:21:22 +08:00
|
|
|
-- @function [parent=#ListView] addChild
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #cc.Node child
|
|
|
|
-- @param #int zOrder
|
|
|
|
-- @param #string name
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
2014-05-27 10:21:22 +08:00
|
|
|
|
2014-03-18 15:55:30 +08:00
|
|
|
--------------------------------
|
2014-12-23 14:49:30 +08:00
|
|
|
--
|
|
|
|
-- @function [parent=#ListView] forceDoLayout
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
2014-12-23 14:49:30 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Changes scroll direction of scrollview.<br>
|
2015-03-31 12:01:57 +08:00
|
|
|
-- Direction Direction::VERTICAL means vertical scroll, Direction::HORIZONTAL means horizontal scroll.<br>
|
|
|
|
-- param dir Set the list view's scroll direction.
|
2014-03-18 15:55:30 +08:00
|
|
|
-- @function [parent=#ListView] setDirection
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #int dir
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
2014-03-18 15:55:30 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
--
|
2014-03-18 15:55:30 +08:00
|
|
|
-- @function [parent=#ListView] getDescription
|
|
|
|
-- @param self
|
|
|
|
-- @return string#string ret (return value: string)
|
|
|
|
|
2014-05-27 10:21:22 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
--
|
2014-05-27 10:21:22 +08:00
|
|
|
-- @function [parent=#ListView] removeAllChildrenWithCleanup
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #bool cleanup
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
2014-05-27 10:21:22 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
--
|
2014-05-27 10:21:22 +08:00
|
|
|
-- @function [parent=#ListView] removeAllChildren
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
2014-05-27 10:21:22 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
--
|
2014-05-27 10:21:22 +08:00
|
|
|
-- @function [parent=#ListView] removeChild
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #cc.Node child
|
|
|
|
-- @param #bool cleaup
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
2014-05-27 10:21:22 +08:00
|
|
|
|
2015-05-05 11:31:53 +08:00
|
|
|
--------------------------------
|
|
|
|
--
|
|
|
|
-- @function [parent=#ListView] init
|
|
|
|
-- @param self
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
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=#ListView] ListView
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
return nil
|