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

Method removeChild

core/ui/UIListView.cpp:306–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304}
305
306void ListView::removeChild(ax::Node* child, bool cleanup)
307{
308 Widget* widget = dynamic_cast<Widget*>(child);
309 if (nullptr != widget)
310 {
311 if (-1 != _curSelectedIndex)
312 {
313 auto removedIndex = getIndex(widget);
314 if (_curSelectedIndex > removedIndex)
315 {
316 _curSelectedIndex -= 1;
317 }
318 else if (_curSelectedIndex == removedIndex)
319 {
320 _curSelectedIndex = -1;
321 }
322 }
323 _items.eraseObject(widget);
324 onItemListChanged();
325 }
326
327 ScrollView::removeChild(child, cleanup);
328 requestDoLayout();
329}
330
331void ListView::removeAllChildren()
332{

Callers

nothing calls this directly

Calls 1

eraseObjectMethod · 0.80

Tested by

no test coverage detected