void FileTreeComponent::setSelectedFile (const File& target) { for (int i = getNumSelectedItems(); --i >= 0;) { FileListTreeItem* t = dynamic_cast <FileListTreeItem*> (getSelectedItem (i)); if (t != nullptr && t->file == target) { t->setSelected (true, true); return; } } clearSelectedItems(); }
//========================================================================================================= bool CtrlrValueTreeEditorTree::keyPressed (const KeyPress &key) { if (getNumSelectedItems() == 1) { if (getSelectedItem(0)) { CtrlrValueTreeEditorItem *item = dynamic_cast<CtrlrValueTreeEditorItem*>(getSelectedItem(0)); if (item != nullptr) { item->keyPressed(key); } } } return (TreeView::keyPressed(key)); }