1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-18 00:54:19 +00:00

Couple of minor additions to file browser comps.

This commit is contained in:
jules 2011-10-01 18:26:53 +01:00
parent fee33f45fd
commit 79bf147d89
11 changed files with 210 additions and 136 deletions

View file

@ -247,4 +247,20 @@ void FileTreeComponent::setDragAndDropDescription (const String& description)
dragAndDropDescription = description;
}
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();
}
END_JUCE_NAMESPACE