MCPcopy Create free account
hub / github.com/axmolengine/axmol / reloadData

Method reloadData

extensions/GUI/src/GUI/ScrollView/TableView.cpp:116–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116void TableView::reloadData()
117{
118 _oldDirection = Direction::NONE;
119
120 for (const auto& cell : _cellsUsed)
121 {
122 if (_tableViewDelegate != nullptr)
123 {
124 _tableViewDelegate->tableCellWillRecycle(this, cell);
125 }
126
127 _cellsFreed.pushBack(cell);
128
129 cell->reset();
130 if (cell->getParent() == this->getContainer())
131 {
132 this->getContainer()->removeChild(cell, false);
133 }
134 }
135
136 _indices->clear();
137 _cellsUsed.clear();
138
139 this->_updateCellPositions();
140 this->_updateContentSize();
141 if (_dataSource->numberOfCellsInTableView(this) > 0)
142 {
143 this->scrollViewDidScroll(this);
144 }
145}
146
147TableViewCell* TableView::cellAtIndex(ssize_t idx)
148{

Callers 5

setVerticalFillOrderMethod · 0.95
runThisTestMethod · 0.80
initMethod · 0.80

Calls 11

_updateCellPositionsMethod · 0.95
_updateContentSizeMethod · 0.95
scrollViewDidScrollMethod · 0.95
pushBackMethod · 0.80
getContainerMethod · 0.80
tableCellWillRecycleMethod · 0.45
resetMethod · 0.45
getParentMethod · 0.45
removeChildMethod · 0.45
clearMethod · 0.45

Tested by 2

runThisTestMethod · 0.64
initMethod · 0.64