MCPcopy Create free account
hub / github.com/MyGUI/mygui / notifyExpandCollapse

Method notifyExpandCollapse

UnitTests/UnitTest_TreeControl/TreeControl.cpp:482–498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

480 }
481
482 void TreeControl::notifyExpandCollapse(Widget* pSender)
483 {
484 TreeControlItem* pItem = pSender->getParent()->castType<TreeControlItem>(false);
485 if (!pItem)
486 return;
487
488 Node* pNode = pItem->getNode();
489 pNode->setExpanded(!pNode->isExpanded());
490
491 if (!pNode->isExpanded() && mpSelection && mpSelection->hasAncestor(pNode))
492 {
493 mpSelection = pNode;
494 eventTreeNodeSelected(this, mpSelection);
495 }
496
497 invalidate();
498 }
499}

Callers

nothing calls this directly

Calls 5

getNodeMethod · 0.80
setExpandedMethod · 0.80
isExpandedMethod · 0.80
hasAncestorMethod · 0.80
getParentMethod · 0.45

Tested by

no test coverage detected