Introjucer: Group Compile Tick


#1

Hi Jules,

A small request; the ability to right-click a group, and recursively tick the c/cpp files to compile/not compile.

This would be invaluable for creating modules!


#2

Somewhere in jucer_TreeViewTypes.h’s GroupTreeViewItem:

void tickFilesToCompileOrNot (bool shouldCompile);

Somewhere in jucer_TreeViewTypes.cpp:

void GroupTreeViewItem::showPopupMenu()
{
//[...]

    m.addSeparator();
    m.addItem (6, "Tick files to compile");
    m.addItem (7, "Tick files to not compile");

//[...]
}
void GroupTreeViewItem::handlePopupMenuResult (int resultCode)
{
//[...]
        case 6:     tickFilesToCompileOrNot (true); break;
        case 7:     tickFilesToCompileOrNot (false); break;
//[...]
}
void GroupTreeViewItem::tickFilesToCompileOrNot (const bool shouldCompile)
{
    for (int i = 0; i < item.getNumChildren(); ++i)
    {
        Value value;
        value.referTo (item.getChild (i).getShouldCompileValue());
        value.setValue (shouldCompile);
    }

    for (int i = getNumSubItems(); --i >= 0;)
        if (GroupTreeViewItem* sub = dynamic_cast<GroupTreeViewItem*> (getSubItem (i)))
            sub->tickFilesToCompileOrNot (shouldCompile);

    refreshSubItems();
}

#3

Thanks, have added (my interpretation of) this!


#4

A much more elegant approach you mean :smiley: