MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / Expand

Method Expand

engine/Poseidon/UI/Controls/UIControlsTree.cpp:231–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229}
230
231void CTree::Expand(CTreeItem* item, bool expand)
232{
233 item->expanded = expand;
234
235 if (expand && item == _selected && (_style & TR_AUTOCOLLAPSE))
236 {
237 CTreeItem* except = _selected;
238 CTreeItem* parent = _selected->parent;
239 while (parent)
240 {
241 int n = parent->children.Size();
242 for (int i = 0; i < n; i++)
243 {
244 if (parent->children[i] != except)
245 {
246 parent->children[i]->ExpandTree(false);
247 }
248 }
249
250 except = parent;
251 parent = except->parent;
252 }
253 EnsureVisible(_selected);
254 }
255}
256
257void CTree::EnsureVisible(CTreeItem* item)
258{

Callers 1

InsertGamesMethod · 0.80

Calls 2

ExpandTreeMethod · 0.80
SizeMethod · 0.45

Tested by

no test coverage detected