Adds empty constructor for TableView and TableViewCell.

This commit is contained in:
James Chen 2014-01-07 22:15:20 +08:00
parent 01745f5ba6
commit 4bb091067f
3 changed files with 11 additions and 0 deletions

View File

@ -29,6 +29,10 @@
NS_CC_EXT_BEGIN
TableView* TableView::create()
{
return TableView::create(nullptr, Size::ZERO);
}
TableView* TableView::create(TableViewDataSource* dataSource, Size size)
{
@ -51,6 +55,7 @@ bool TableView::initWithViewSize(Size size, Node* container/* = NULL*/)
{
if (ScrollView::initWithViewSize(size,container))
{
CC_SAFE_DELETE(_indices);
_indices = new std::set<ssize_t>();
_vordering = VerticalFillOrder::BOTTOM_UP;
this->setDirection(Direction::VERTICAL);

View File

@ -148,6 +148,10 @@ public:
TOP_DOWN,
BOTTOM_UP
};
/** Empty contructor of TableView */
static TableView* create();
/**
* An intialized table view object
*

View File

@ -37,6 +37,8 @@ NS_CC_EXT_BEGIN
class TableViewCell: public Node
{
public:
CREATE_FUNC(TableViewCell);
TableViewCell() {}
/**
* The index used internally by SWTableView and its subclasses