diff --git a/extras/Introjucer/Builds/CodeBlocks/The Introjucer.cbp b/extras/Introjucer/Builds/CodeBlocks/The Introjucer.cbp
index 70c1fa0e28..356d9c7d63 100644
--- a/extras/Introjucer/Builds/CodeBlocks/The Introjucer.cbp
+++ b/extras/Introjucer/Builds/CodeBlocks/The Introjucer.cbp
@@ -594,6 +594,10 @@
+
+
+
+
diff --git a/extras/Introjucer/Builds/MacOSX/The Introjucer.xcodeproj/project.pbxproj b/extras/Introjucer/Builds/MacOSX/The Introjucer.xcodeproj/project.pbxproj
index 3d7d131d3a..98b9746a30 100644
--- a/extras/Introjucer/Builds/MacOSX/The Introjucer.xcodeproj/project.pbxproj
+++ b/extras/Introjucer/Builds/MacOSX/The Introjucer.xcodeproj/project.pbxproj
@@ -111,6 +111,7 @@
0D1C432D74433308E05942AD = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_TextDiff.cpp"; path = "../../../../modules/juce_core/text/juce_TextDiff.cpp"; sourceTree = "SOURCE_ROOT"; };
0DB0A9E30EEDDEA720BC5A03 = {isa = PBXFileReference; lastKnownFileType = file.svg; name = "wizard_StaticLibrary.svg"; path = "../../Source/BinaryData/wizard_StaticLibrary.svg"; sourceTree = "SOURCE_ROOT"; };
0E80EFDB550393DB1C94F291 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Font.h"; path = "../../../../modules/juce_graphics/fonts/juce_Font.h"; sourceTree = "SOURCE_ROOT"; };
+ 0F01067432AC314EAC213C1C = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "jucer_ProjectWizard_Blank.h"; path = "../../Source/Wizards/jucer_ProjectWizard_Blank.h"; sourceTree = "SOURCE_ROOT"; };
0F249640243FBD5717F6ADD9 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "jucer_MiscUtilities.cpp"; path = "../../Source/Utility/jucer_MiscUtilities.cpp"; sourceTree = "SOURCE_ROOT"; };
0F2505BCD0232EB95D5199F2 = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Process.h"; path = "../../../../modules/juce_core/threads/juce_Process.h"; sourceTree = "SOURCE_ROOT"; };
0F382FC6B16658EF02D2C4F0 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_MessageListener.cpp"; path = "../../../../modules/juce_events/messages/juce_MessageListener.cpp"; sourceTree = "SOURCE_ROOT"; };
@@ -1134,6 +1135,7 @@
3C95FA2AA91EBA19ADDD5C29,
8A825FDDC00DD253F44D2C3A,
4A4EBDAD8D098F72CE053235,
+ 0F01067432AC314EAC213C1C,
A44A774EFC020D3D046A9249,
9992E6950C64322A11E39ADF,
05D67B5A8D64947C067C0945,
diff --git a/extras/Introjucer/Builds/VisualStudio2005/The Introjucer.vcproj b/extras/Introjucer/Builds/VisualStudio2005/The Introjucer.vcproj
index 56a1748b6f..4aeeccf397 100644
--- a/extras/Introjucer/Builds/VisualStudio2005/The Introjucer.vcproj
+++ b/extras/Introjucer/Builds/VisualStudio2005/The Introjucer.vcproj
@@ -307,6 +307,7 @@
+
diff --git a/extras/Introjucer/Builds/VisualStudio2008/The Introjucer.vcproj b/extras/Introjucer/Builds/VisualStudio2008/The Introjucer.vcproj
index 577691c7c6..1f0692fb33 100644
--- a/extras/Introjucer/Builds/VisualStudio2008/The Introjucer.vcproj
+++ b/extras/Introjucer/Builds/VisualStudio2008/The Introjucer.vcproj
@@ -307,6 +307,7 @@
+
diff --git a/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj b/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj
index 5ddc32df5c..0c91f89922 100644
--- a/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj
+++ b/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj
@@ -1159,6 +1159,7 @@
+
diff --git a/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj.filters b/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj.filters
index b0f2d7df81..bbed382711 100644
--- a/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj.filters
+++ b/extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj.filters
@@ -1674,6 +1674,9 @@
The Introjucer\Wizards
+
+ The Introjucer\Wizards
+
The Introjucer\Wizards
diff --git a/extras/Introjucer/Builds/VisualStudio2012/The Introjucer.vcxproj b/extras/Introjucer/Builds/VisualStudio2012/The Introjucer.vcxproj
index 4fe92b9763..132b4f5f1c 100644
--- a/extras/Introjucer/Builds/VisualStudio2012/The Introjucer.vcxproj
+++ b/extras/Introjucer/Builds/VisualStudio2012/The Introjucer.vcxproj
@@ -1165,6 +1165,7 @@
+
diff --git a/extras/Introjucer/Builds/VisualStudio2012/The Introjucer.vcxproj.filters b/extras/Introjucer/Builds/VisualStudio2012/The Introjucer.vcxproj.filters
index b0f2d7df81..bbed382711 100644
--- a/extras/Introjucer/Builds/VisualStudio2012/The Introjucer.vcxproj.filters
+++ b/extras/Introjucer/Builds/VisualStudio2012/The Introjucer.vcxproj.filters
@@ -1674,6 +1674,9 @@
The Introjucer\Wizards
+
+ The Introjucer\Wizards
+
The Introjucer\Wizards
diff --git a/extras/Introjucer/Builds/VisualStudio2013/The Introjucer.vcxproj b/extras/Introjucer/Builds/VisualStudio2013/The Introjucer.vcxproj
index 084c153f59..1c653f9c74 100644
--- a/extras/Introjucer/Builds/VisualStudio2013/The Introjucer.vcxproj
+++ b/extras/Introjucer/Builds/VisualStudio2013/The Introjucer.vcxproj
@@ -1165,6 +1165,7 @@
+
diff --git a/extras/Introjucer/Builds/VisualStudio2013/The Introjucer.vcxproj.filters b/extras/Introjucer/Builds/VisualStudio2013/The Introjucer.vcxproj.filters
index f6d4b90a60..67bfdf0429 100644
--- a/extras/Introjucer/Builds/VisualStudio2013/The Introjucer.vcxproj.filters
+++ b/extras/Introjucer/Builds/VisualStudio2013/The Introjucer.vcxproj.filters
@@ -1674,6 +1674,9 @@
The Introjucer\Wizards
+
+ The Introjucer\Wizards
+
The Introjucer\Wizards
diff --git a/extras/Introjucer/Introjucer.jucer b/extras/Introjucer/Introjucer.jucer
index e21728b9be..3817ebe6a1 100644
--- a/extras/Introjucer/Introjucer.jucer
+++ b/extras/Introjucer/Introjucer.jucer
@@ -488,6 +488,8 @@
resource="0" file="Source/Wizards/jucer_ProjectWizard_AudioApp.h"/>
+
wizard (createWizardType (i));
@@ -154,49 +156,45 @@ public:
// Handle Open Project button functionality
ApplicationCommandManager& commandManager = IntrojucerApp::getCommandManager();
- blankProjectButton = new TemplateOptionButton ("Create Blank Project", TemplateOptionButton::ButtonStyle::ImageOnButtonBackground, BinaryData::wizard_Openfile_svg);
- openProjectButton = new TemplateOptionButton ("Open Existing Project", TemplateOptionButton::ButtonStyle::ImageOnButtonBackground, BinaryData::wizard_Openfile_svg);
+ addAndMakeVisible (blankProjectButton = new TemplateOptionButton ("Create Blank Project", TemplateOptionButton::ButtonStyle::ImageOnButtonBackground, BinaryData::wizard_Openfile_svg));
+ addAndMakeVisible (exampleProjectButton = new TemplateOptionButton ("Open Example Project", TemplateOptionButton::ButtonStyle::ImageOnButtonBackground, BinaryData::wizard_Openfile_svg));
+ addAndMakeVisible (openProjectButton = new TemplateOptionButton ("Open Existing Project", TemplateOptionButton::ButtonStyle::ImageOnButtonBackground, BinaryData::wizard_Openfile_svg));
+
+ blankProjectButton->addListener (this);
+ exampleProjectButton->addListener (this);
openProjectButton->setCommandToTrigger (&commandManager, CommandIDs::open, true);
- exampleProjectButton = new TemplateOptionButton ("Open Example Project", TemplateOptionButton::ButtonStyle::ImageOnButtonBackground, BinaryData::wizard_Openfile_svg);
- exampleProjectButton->setCommandToTrigger (&commandManager, CommandIDs::open, true);
-
- addAndMakeVisible (blankProjectButton);
- addAndMakeVisible (openProjectButton);
- addAndMakeVisible (exampleProjectButton);
-
newProjectWizard = projectWizard;
}
void paint (Graphics& g) override
{
g.setColour (Colours::black.withAlpha (0.2f));
- g.fillRect (0, 0, getWidth(), 60);
+ g.fillRect (getLocalBounds().removeFromTop (60));
g.setColour (Colours::white);
- g.setFont (20);
+ g.setFont (20.0f);
g.drawText ("Create New Project", 0, 0, getWidth(), 60, Justification::centred, true);
// draw the descriptions of each template if hovered;
// (repaint is called by the button listener on change state)
- Rectangle descriptionBox = getBounds().reduced (30, 30);
- descriptionBox = descriptionBox.removeFromBottom (50);
+ Rectangle descriptionBox (getLocalBounds().reduced (30).removeFromBottom (50));
g.setColour (Colours::white.withAlpha (0.4f));
- g.setFont (15);
+ g.setFont (15.0f);
- for (int i = 0; i < 8; ++i)
- if (optionButtons.getUnchecked(i)->getState() == TemplateOptionButton::ButtonState::buttonOver)
+ for (int i = 0; i < optionButtons.size(); ++i)
+ if (optionButtons.getUnchecked(i)->isOver())
g.drawFittedText (optionButtons.getUnchecked(i)->getDescription(), descriptionBox, Justification::centred, 5, 1.0f);
}
void resized() override
{
- Rectangle allOpts = getBounds().reduced (40, 60);
+ Rectangle allOpts = getLocalBounds().reduced (40, 60);
allOpts.removeFromBottom (allOpts.getHeight() * 0.25);
const int numHorizIcons = 4;
- const int optStep = allOpts.getWidth()/numHorizIcons;
+ const int optStep = allOpts.getWidth() / numHorizIcons;
for (int i = 0; i < optionButtons.size(); ++i)
{
@@ -208,7 +206,7 @@ public:
.reduced (10, 10));
}
- Rectangle openButtonBounds = getBounds();
+ Rectangle openButtonBounds = getLocalBounds();
openButtonBounds.removeFromBottom (proportionOfHeight (0.12f));
openButtonBounds = openButtonBounds.removeFromBottom (120);
openButtonBounds.reduce (50, 40);
@@ -218,24 +216,45 @@ public:
openProjectButton->setBounds (openButtonBounds.reduced (18, 0));
}
- void buttonClicked (Button* b) override
+ void showWizard (const String& name)
{
- newProjectWizard->projectType.setText (b->getButtonText());
+ newProjectWizard->projectType.setText (name);
if (SlidingPanelComponent* parent = findParentComponentOfClass())
- {
- if (parent->getNumTabs() > 0 && b->getButtonText() != "Open Existing Project")
- parent->goToTab (parent->getCurrentTabIndex() + 1);
- }
+ parent->goToTab (1);
else
- {
jassertfalse;
- }
}
- void buttonStateChanged (Button*) override
+ void createBlankProject()
{
- repaint();
+ showWizard (BlankAppWizard().getName());
+ }
+
+ void openExampleProject()
+ {
+ FileChooser fc ("Open File", findExamplesFolder());
+
+ if (fc.browseForFileToOpen())
+ IntrojucerApp::getApp().openFile (fc.getResult());
+ }
+
+ static File findExamplesFolder()
+ {
+ File appFolder (File::getSpecialLocation (File::currentApplicationFile));
+
+ while (appFolder.exists()
+ && appFolder.getParentDirectory() != appFolder)
+ {
+ File examples (appFolder.getSiblingFile ("examples"));
+
+ if (examples.exists())
+ return examples;
+
+ appFolder = appFolder.getParentDirectory();
+ }
+
+ return File::nonexistent;
}
private:
@@ -243,6 +262,21 @@ private:
NewProjectWizardClasses::WizardComp* newProjectWizard;
ScopedPointer blankProjectButton, openProjectButton, exampleProjectButton;
+ void buttonClicked (Button* b) override
+ {
+ if (b == blankProjectButton)
+ createBlankProject();
+ else if (b == exampleProjectButton)
+ openExampleProject();
+ else if (dynamic_cast (b) != nullptr)
+ showWizard (b->getButtonText());
+ }
+
+ void buttonStateChanged (Button*) override
+ {
+ repaint();
+ }
+
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TemplateTileBrowser)
};