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:
parent
fee33f45fd
commit
79bf147d89
11 changed files with 210 additions and 136 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue