bool selectFile (const File& target)
    {
        if (file == target)
        {
            setSelected (true, true);
            return true;
        }

        if (target.isAChildOf (file))
        {
            setOpen (true);

            for (int maxRetries = 500; --maxRetries > 0;)
            {
                for (int i = 0; i < getNumSubItems(); ++i)
                    if (FileListTreeItem* f = dynamic_cast <FileListTreeItem*> (getSubItem (i)))
                        if (f->selectFile (target))
                            return true;

                // if we've just opened and the contents are still loading, wait for it..
                if (subContentsList != nullptr && subContentsList->isStillLoading())
                {
                    Thread::sleep (10);
                    rebuildItemsFromContentList();
                }
                else
                {
                    break;
                }
            }
        }

        return false;
    }
void GroupTreeViewItem::checkFileStatus()
{
    for (int i = 0; i < getNumSubItems(); ++i)
    {
        ProjectTreeViewBase* p = dynamic_cast <ProjectTreeViewBase*> (getSubItem(i));

        if (p != nullptr)
            p->checkFileStatus();
    }
}
    void itemOpennessChanged (bool isNowOpen)
    {
        if (isNowOpen)
        {
            if (getNumSubItems() == 0)
            {
                const Array <CommandID> commands (owner.getCommandManager().getCommandsInCategory (categoryName));

                for (int i = 0; i < commands.size(); ++i)
                    if (owner.shouldCommandBeIncluded (commands[i]))
                        addSubItem (new MappingItem (owner, commands[i]));
            }
        }
        else
        {
            clearSubItems();
        }
    }
//==============================================================================
ProjectTreeViewBase* ProjectTreeViewBase::findTreeViewItem (const Project::Item& itemToFind)
{
    if (item == itemToFind)
        return this;

    const bool wasOpen = isOpen();
    setOpen (true);

    for (int i = getNumSubItems(); --i >= 0;)
    {
        if (ProjectTreeViewBase* pg = dynamic_cast <ProjectTreeViewBase*> (getSubItem(i)))
            if (ProjectTreeViewBase* found = pg->findTreeViewItem (itemToFind))
                return found;
    }

    setOpen (wasOpen);
    return nullptr;
}
void CtrlrValueTreeEditorItem::itemOpennessChanged (bool isNowOpen)
{
	if (isNowOpen)
	{
		if (getNumSubItems() == 0)
		{
			for (int i=0; i<treeToEdit.getNumChildren(); i++)
			{
				addSubItem (new CtrlrValueTreeEditorItem (provider, treeToEdit.getChild(i), nameIdentifier));
			}
		}
	}
	else
	{
		clearSubItems();
	}

	provider.itemOpennessChanged(isNowOpen);
}
Beispiel #6
0
	~RootItem()
	{
		while (getNumSubItems() > 0)
			removeSubItem(0);
	}
Beispiel #7
0
	~QueueItem()
	{
		while (getNumSubItems() > 0)
			removeSubItem(0);
	}