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

Introjucer: redesigned the project settings to be shown as a treeview containing the exporters and configs.

This commit is contained in:
jules 2012-06-24 21:20:59 +01:00
parent 04401e7f3e
commit 463d2b3289
26 changed files with 1170 additions and 1007 deletions

View file

@ -24,6 +24,7 @@
*/
#include "jucer_JucerTreeViewBase.h"
#include "../Project/jucer_ProjectContentComponent.h"
//==============================================================================
@ -33,6 +34,13 @@ JucerTreeViewBase::JucerTreeViewBase()
setLinesDrawnForSubItems (false);
}
void JucerTreeViewBase::refreshSubItems()
{
WholeTreeOpennessRestorer openness (*this);
clearSubItems();
addSubItems();
}
Font JucerTreeViewBase::getFont() const
{
return Font (getItemHeight() * 0.6f);
@ -175,10 +183,82 @@ void JucerTreeViewBase::itemClicked (const MouseEvent& e)
}
}
void JucerTreeViewBase::showPopupMenu()
void JucerTreeViewBase::deleteItem() {}
void JucerTreeViewBase::deleteAllSelectedItems() {}
void JucerTreeViewBase::showDocument() {}
void JucerTreeViewBase::showPopupMenu() {}
void JucerTreeViewBase::showMultiSelectionPopupMenu() {}
static void treeViewMenuItemChosen (int resultCode, JucerTreeViewBase* item)
{
item->handlePopupMenuResult (resultCode);
}
void JucerTreeViewBase::launchPopupMenu (PopupMenu& m)
{
m.showMenuAsync (PopupMenu::Options(),
ModalCallbackFunction::create (treeViewMenuItemChosen, this));
}
void JucerTreeViewBase::handlePopupMenuResult (int)
{
}
void JucerTreeViewBase::showMultiSelectionPopupMenu()
ProjectContentComponent* JucerTreeViewBase::getProjectContentComponent() const
{
Component* c = getOwnerView();
while (c != nullptr)
{
ProjectContentComponent* pcc = dynamic_cast <ProjectContentComponent*> (c);
if (pcc != nullptr)
return pcc;
c = c->getParentComponent();
}
return 0;
}
//==============================================================================
class JucerTreeViewBase::ItemSelectionTimer : public Timer
{
public:
ItemSelectionTimer (JucerTreeViewBase& owner_) : owner (owner_) {}
void timerCallback() { owner.invokeShowDocument(); }
private:
JucerTreeViewBase& owner;
JUCE_DECLARE_NON_COPYABLE (ItemSelectionTimer);
};
void JucerTreeViewBase::itemSelectionChanged (bool isNowSelected)
{
if (isNowSelected)
{
delayedSelectionTimer = new ItemSelectionTimer (*this);
delayedSelectionTimer->startTimer (getMillisecsAllowedForDragGesture());
}
else
{
cancelDelayedSelectionTimer();
}
}
void JucerTreeViewBase::invokeShowDocument()
{
cancelDelayedSelectionTimer();
showDocument();
}
void JucerTreeViewBase::itemDoubleClicked (const MouseEvent& e)
{
invokeShowDocument();
}
void JucerTreeViewBase::cancelDelayedSelectionTimer()
{
delayedSelectionTimer = nullptr;
}