| 229 | } |
| 230 | |
| 231 | void 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 | |
| 257 | void CTree::EnsureVisible(CTreeItem* item) |
| 258 | { |
no test coverage detected