diff --git a/extras/Jucer (experimental)/Source/Application/jucer_Application.h b/extras/Jucer (experimental)/Source/Application/jucer_Application.h index a6158ee6a0..38ab66ebae 100644 --- a/extras/Jucer (experimental)/Source/Application/jucer_Application.h +++ b/extras/Jucer (experimental)/Source/Application/jucer_Application.h @@ -189,7 +189,8 @@ public: menu.addCommandItem (commandManager, CommandIDs::saveProject); menu.addCommandItem (commandManager, CommandIDs::saveProjectAs); menu.addSeparator(); - menu.addCommandItem (commandManager, CommandIDs::openProjectInIDE); + menu.addCommandItem (commandManager, CommandIDs::openInIDE); + menu.addCommandItem (commandManager, CommandIDs::saveAndOpenInIDE); #if ! JUCE_MAC menu.addSeparator(); diff --git a/extras/Jucer (experimental)/Source/Application/jucer_CommandIDs.h b/extras/Jucer (experimental)/Source/Application/jucer_CommandIDs.h index a10af1dc36..47942af57c 100644 --- a/extras/Jucer (experimental)/Source/Application/jucer_CommandIDs.h +++ b/extras/Jucer (experimental)/Source/Application/jucer_CommandIDs.h @@ -37,9 +37,10 @@ namespace CommandIDs static const int closeProject = 0x200051; static const int saveProject = 0x200060; static const int saveProjectAs = 0x200070; - static const int openProjectInIDE = 0x200071; - static const int showProjectSettings = 0x200072; - static const int showJuceVersion = 0x200073; + static const int openInIDE = 0x200072; + static const int saveAndOpenInIDE = 0x200073; + static const int showProjectSettings = 0x200074; + static const int showJuceVersion = 0x200075; static const int saveAll = 0x200080; static const int undo = 0x200090; diff --git a/extras/Jucer (experimental)/Source/Project/jucer_ProjectContentComponent.cpp b/extras/Jucer (experimental)/Source/Project/jucer_ProjectContentComponent.cpp index ed354fe305..afea484c01 100644 --- a/extras/Jucer (experimental)/Source/Project/jucer_ProjectContentComponent.cpp +++ b/extras/Jucer (experimental)/Source/Project/jucer_ProjectContentComponent.cpp @@ -190,7 +190,8 @@ void ProjectContentComponent::getAllCommands (Array & commands) const CommandID ids[] = { CommandIDs::saveProject, CommandIDs::saveProjectAs, CommandIDs::closeProject, - CommandIDs::openProjectInIDE, + CommandIDs::openInIDE, + CommandIDs::saveAndOpenInIDE, CommandIDs::showProjectSettings, StandardApplicationCommandIDs::del}; @@ -225,7 +226,20 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica result.defaultKeypresses.add (KeyPress ('w', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)); break; - case CommandIDs::openProjectInIDE: + case CommandIDs::openInIDE: + #if JUCE_MAC + result.setInfo ("Open in XCode...", + #elif JUCE_WINDOWS + result.setInfo ("Open in Visual Studio...", + #else + result.setInfo ("Open as a Makefile...", + #endif + "Launches the project in an external IDE", + CommandCategories::general, 0); + result.setActive (project != 0); + break; + + case CommandIDs::saveAndOpenInIDE: #if JUCE_MAC result.setInfo ("Save Project and Open in XCode...", #elif JUCE_WINDOWS @@ -290,7 +304,15 @@ bool ProjectContentComponent::perform (const InvocationInfo& info) break; - case CommandIDs::openProjectInIDE: + case CommandIDs::openInIDE: + if (project != 0) + { + ScopedPointer exporter (ProjectExporter::createPlatformDefaultExporter (*project)); + exporter->launchProject(); + } + break; + + case CommandIDs::saveAndOpenInIDE: if (project != 0 && project->save (true, true) == FileBasedDocument::savedOk) { ScopedPointer exporter (ProjectExporter::createPlatformDefaultExporter (*project)); diff --git a/extras/Jucer (experimental)/Source/Project/jucer_ProjectInformationComponent.cpp b/extras/Jucer (experimental)/Source/Project/jucer_ProjectInformationComponent.cpp index 39768e10a7..5d53a9d811 100644 --- a/extras/Jucer (experimental)/Source/Project/jucer_ProjectInformationComponent.cpp +++ b/extras/Jucer (experimental)/Source/Project/jucer_ProjectInformationComponent.cpp @@ -3,25 +3,22 @@ This is an automatically generated file created by the Jucer! - Creation date: 10 May 2010 7:13:27pm - Be careful when adding custom code to these files, as only the code within the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded and re-saved. - Jucer version: 1.12 + Created for JUCE version: JUCE v1.52.92 ------------------------------------------------------------------------------ - The Jucer is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-6 by Raw Material Software ltd. + JUCE and the Jucer are copyright 2004-10 by Raw Material Software ltd. ============================================================================== */ -//[Headers] You can add your own extra header files here... +//[CppHeaders] You can add your own extra header files here... #include "jucer_ProjectExporter.h" -//[/Headers] +//[/CppHeaders] #include "jucer_ProjectInformationComponent.h" @@ -103,54 +100,49 @@ private: Project& project; int tabIndex; }; - //[/MiscUserDefs] //============================================================================== ProjectInformationComponent::ProjectInformationComponent (Project& project_) : project (project_), - configTabBox (0), - editConfigsButton (0), - openProjectButton (0), - editExportersButton (0) + configTabBox (TabbedButtonBar::TabsAtTop) { - addAndMakeVisible (configTabBox = new TabbedComponent (TabbedButtonBar::TabsAtTop)); - configTabBox->setTabBarDepth (30); - configTabBox->setCurrentTabIndex (-1); - - addAndMakeVisible (editConfigsButton = new TextButton (String::empty)); - editConfigsButton->setButtonText (T("Add/Remove Configurations...")); - editConfigsButton->addButtonListener (this); - - addAndMakeVisible (openProjectButton = new TextButton (String::empty)); - openProjectButton->setButtonText (T("Open Project in ")); - openProjectButton->addButtonListener (this); - - addAndMakeVisible (editExportersButton = new TextButton (String::empty)); - editExportersButton->setButtonText (T("Add/Remove Exporters...")); - editExportersButton->addButtonListener (this); - + addAndMakeVisible (&configTabBox); + addAndMakeVisible (&editConfigsButton); + editConfigsButton.setButtonText ("Add/Remove Configurations..."); + editConfigsButton.addButtonListener (this); + addAndMakeVisible (&openProjectButton); + openProjectButton.setButtonText ("Open Project in "); + openProjectButton.addButtonListener (this); + addAndMakeVisible (&editExportersButton); + editExportersButton.setButtonText ("Add/Remove Exporters..."); + editExportersButton.addButtonListener (this); + addAndMakeVisible (&saveAndOpenButton); + saveAndOpenButton.setButtonText ("Save And Open in"); + saveAndOpenButton.addButtonListener (this); //[UserPreSize] rebuildConfigTabs(); #if JUCE_MAC || JUCE_WINDOWS - openProjectButton->setCommandToTrigger (commandManager, CommandIDs::openProjectInIDE, true); - openProjectButton->setButtonText (commandManager->getNameOfCommand (CommandIDs::openProjectInIDE)); + openProjectButton.setCommandToTrigger (commandManager, CommandIDs::openInIDE, true); + openProjectButton.setButtonText (commandManager->getNameOfCommand (CommandIDs::openInIDE)); + + saveAndOpenButton.setCommandToTrigger (commandManager, CommandIDs::saveAndOpenInIDE, true); + saveAndOpenButton.setButtonText (commandManager->getNameOfCommand (CommandIDs::saveAndOpenInIDE)); #else - openProjectButton->setVisible (false); + openProjectButton.setVisible (false); + saveAndOpenButton.setVisible (false); #endif - //[/UserPreSize] - setOpaque (true); - setSize (600, 400); + setSize (859, 479); //[Constructor] You can add your own custom stuff here.. - configTabBox->setOutline (1); - configTabBox->setColour (TabbedComponent::outlineColourId, Colours::black.withAlpha (0.3f)); + configTabBox.setOutline (1); + configTabBox.setColour (TabbedComponent::outlineColourId, Colours::black.withAlpha (0.3f)); - editConfigsButton->setTriggeredOnMouseDown (true); + editConfigsButton.setTriggeredOnMouseDown (true); project.addChangeListener (this); //[/Constructor] @@ -162,37 +154,31 @@ ProjectInformationComponent::~ProjectInformationComponent() project.removeChangeListener (this); //[/Destructor_pre] - deleteAndZero (configTabBox); - deleteAndZero (editConfigsButton); - deleteAndZero (openProjectButton); - deleteAndZero (editExportersButton); + //[Destructor]. You can add your own custom destruction code here.. //[/Destructor] } //============================================================================== -void ProjectInformationComponent::paint (Graphics& g) -{ - //[UserPrePaint] Add your own custom painting code here.. - g.setTiledImageFill (ImageCache::getFromMemory (BinaryData::brushed_aluminium_png, BinaryData::brushed_aluminium_pngSize), - 0, 0, 1.0f); - g.fillAll(); - drawRecessedShadows (g, getWidth(), getHeight(), 14); - //[/UserPrePaint] - - //[UserPaint] Add your own custom painting code here.. - //[/UserPaint] -} - void ProjectInformationComponent::resized() { - configTabBox->setBounds (8, 0, getWidth() - 16, getHeight() - 36); - editConfigsButton->setBounds (8, getHeight() - 30, 192, 22); - openProjectButton->setBounds (384, getHeight() - 30, 208, 22); - editExportersButton->setBounds (208, getHeight() - 30, 160, 22); - //[UserResized] Add your own custom resize handling here.. - //[/UserResized] + //[Userresized_Pre] + //[/Userresized_Pre] + + configTabBox.setBounds (Rectangle::leftTopRightBottom (8, 0, (int) ((8.0 + getWidth()) - 16.0), + (int) ((0.0 + getHeight()) - 36.0))); + editConfigsButton.setBounds (Rectangle::leftTopRightBottom (8, (int) (getHeight() - 30.0), (int) (8.0 + 192.0), + (int) (getHeight() - 30.0 + 22.0))); + openProjectButton.setBounds (Rectangle::leftTopRightBottom (608, (int) (getHeight() - 30.0), (int) (608.0 + 208.0), + (int) (getHeight() - 30.0 + 22.0))); + editExportersButton.setBounds (Rectangle::leftTopRightBottom (208, (int) (getHeight() - 30.0), + (int) (208.0 + 160.0), (int) (getHeight() - 30.0 + 22.0))); + saveAndOpenButton.setBounds (Rectangle::leftTopRightBottom (391, (int) (getHeight() - 30.0), (int) (391.0 + 208.0), + (int) (getHeight() - 30.0 + 22.0))); + + //[Userresized_Post] + //[/Userresized_Post] } void ProjectInformationComponent::buttonClicked (Button* buttonThatWasClicked) @@ -200,48 +186,63 @@ void ProjectInformationComponent::buttonClicked (Button* buttonThatWasClicked) //[UserbuttonClicked_Pre] //[/UserbuttonClicked_Pre] - if (buttonThatWasClicked == editConfigsButton) + if (buttonThatWasClicked == &editConfigsButton) { - //[UserButtonCode_editConfigsButton] -- add your button handler code here.. + //[UserButtonCode_b6625dfcdb1f4755] -- add your button handler code here.. showConfigMenu(); - //[/UserButtonCode_editConfigsButton] + //[/UserButtonCode_b6625dfcdb1f4755] } - else if (buttonThatWasClicked == openProjectButton) + else if (buttonThatWasClicked == &openProjectButton) { - //[UserButtonCode_openProjectButton] -- add your button handler code here.. - //[/UserButtonCode_openProjectButton] + //[UserButtonCode_a550a652e2666ee7] -- add your button handler code here.. + //[/UserButtonCode_a550a652e2666ee7] } - else if (buttonThatWasClicked == editExportersButton) + else if (buttonThatWasClicked == &editExportersButton) { - //[UserButtonCode_editExportersButton] -- add your button handler code here.. + //[UserButtonCode_c1f6e5f9811b307e] -- add your button handler code here.. showExporterMenu(); - //[/UserButtonCode_editExportersButton] + //[/UserButtonCode_c1f6e5f9811b307e] + } + else if (buttonThatWasClicked == &saveAndOpenButton) + { + //[UserButtonCode_dRGMyYx] -- add your button handler code here.. + //[/UserButtonCode_dRGMyYx] } //[UserbuttonClicked_Post] //[/UserbuttonClicked_Post] } +void ProjectInformationComponent::paint (Graphics& g) +{ + //[UserPaint] Add your own custom painting code here.. + g.setTiledImageFill (ImageCache::getFromMemory (BinaryData::brushed_aluminium_png, BinaryData::brushed_aluminium_pngSize), + 0, 0, 1.0f); + g.fillAll(); + drawRecessedShadows (g, getWidth(), getHeight(), 14); + //[/UserPaint] +} + //[MiscUserCode] You can add your own definitions of your custom methods or any other code here... void ProjectInformationComponent::rebuildConfigTabs() { - configTabBox->clearTabs(); + configTabBox.clearTabs(); int index = 0; PropertiesWithHelpComponent* panel = new PropertiesWithHelpComponent (project, index++); - configTabBox->addTab ("Project Settings", Colours::lightslategrey, panel, true, -1); + configTabBox.addTab ("Project Settings", Colours::lightslategrey, panel, true, -1); panel = new PropertiesWithHelpComponent (project, index++); - configTabBox->addTab ("Juce Flags", Colours::lightblue, panel, true, -1); + configTabBox.addTab ("Juce Flags", Colours::lightblue, panel, true, -1); int i; for (i = 0; i < project.getNumConfigurations(); ++i) { panel = new PropertiesWithHelpComponent (project, index++); Project::BuildConfiguration config (project.getConfiguration (i)); - configTabBox->addTab (config.getName().toString(), Colour::greyLevel (0.65f), panel, true, -1); + configTabBox.addTab (config.getName().toString(), Colour::greyLevel (0.65f), panel, true, -1); } for (i = 0; i < project.getNumExporters(); ++i) @@ -251,7 +252,7 @@ void ProjectInformationComponent::rebuildConfigTabs() if (exp != 0) { panel = new PropertiesWithHelpComponent (project, index++); - configTabBox->addTab (exp->getName(), Colours::lightsteelblue, panel, true, -1); + configTabBox.addTab (exp->getName(), Colours::lightsteelblue, panel, true, -1); } } @@ -260,7 +261,7 @@ void ProjectInformationComponent::rebuildConfigTabs() void ProjectInformationComponent::updateConfigTabs() { - if (configTabBox->getNumTabs() != project.getNumConfigurations() + project.getNumExporters() + 2 + if (configTabBox.getNumTabs() != project.getNumConfigurations() + project.getNumExporters() + 2 || lastProjectType != project.getProjectType().getValue()) { rebuildConfigTabs(); @@ -270,7 +271,7 @@ void ProjectInformationComponent::updateConfigTabs() for (int i = 0; i < project.getNumConfigurations(); ++i) { Project::BuildConfiguration config (project.getConfiguration (i)); - configTabBox->setTabName (i + 2, config.getName().toString()); + configTabBox.setTabName (i + 2, config.getName().toString()); } } } @@ -292,7 +293,7 @@ void ProjectInformationComponent::showConfigMenu() m.addSubMenu ("Add a copy of an existing configuration", createCopyMenu); m.addSubMenu ("Remove configuration", removeMenu); - const int r = m.showAt (editConfigsButton); + const int r = m.showAt (&editConfigsButton); if (r >= 20000) { @@ -332,7 +333,7 @@ void ProjectInformationComponent::showExporterMenu() m.addSubMenu ("Create new export target", createMenu); m.addSubMenu ("Remove export target", removeMenu); - const int r = m.showAt (editExportersButton); + const int r = m.showAt (&editExportersButton); if (r >= 20000) project.deleteExporter (r - 20000); @@ -344,38 +345,47 @@ void ProjectInformationComponent::changeListenerCallback (void*) { updateConfigTabs(); } - //[/MiscUserCode] + +//============================================================================== +//======================= Jucer Information Section ========================== //============================================================================== #if 0 -/* -- Jucer information section -- - - This is where the Jucer puts all of its metadata, so don't change anything in here! - -BEGIN_JUCER_METADATA - - - - - - - - - -END_JUCER_METADATA +/* This section stores the Jucer's metadata - edit it at your own risk! + +JUCER_COMPONENT_METADATA_START + + + + + + + + + + + + + + +JUCER_COMPONENT_METADATA_END */ #endif diff --git a/extras/Jucer (experimental)/Source/Project/jucer_ProjectInformationComponent.h b/extras/Jucer (experimental)/Source/Project/jucer_ProjectInformationComponent.h index 870e6be884..ed062c25aa 100644 --- a/extras/Jucer (experimental)/Source/Project/jucer_ProjectInformationComponent.h +++ b/extras/Jucer (experimental)/Source/Project/jucer_ProjectInformationComponent.h @@ -3,28 +3,24 @@ This is an automatically generated file created by the Jucer! - Creation date: 10 May 2010 7:13:27pm - Be careful when adding custom code to these files, as only the code within the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded and re-saved. - Jucer version: 1.12 + Created for JUCE version: JUCE v1.52.92 ------------------------------------------------------------------------------ - The Jucer is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-6 by Raw Material Software ltd. + JUCE and the Jucer are copyright 2004-10 by Raw Material Software ltd. ============================================================================== */ -#ifndef __JUCER_HEADER_PROJECTINFORMATIONCOMPONENT_JUCERPROJECTINFORMATIONCOMPONENT_40825900__ -#define __JUCER_HEADER_PROJECTINFORMATIONCOMPONENT_JUCERPROJECTINFORMATIONCOMPONENT_40825900__ +#ifndef __JUCER_PROJECTINFORMATIONCOMPONENT_H_2F89B0AC__ +#define __JUCER_PROJECTINFORMATIONCOMPONENT_H_2F89B0AC__ //[Headers] -- You can add your own extra header files here -- -#include "../jucer_Headers.h" -#include "../Project/jucer_Project.h" +#include "jucer_ProjectExporter.h" //[/Headers] @@ -32,14 +28,12 @@ //============================================================================== /** //[Comments] - An auto-generated component, created by the Jucer. - - Describe your class and how it works here! + Holds the tabs containing all the project info. //[/Comments] */ class ProjectInformationComponent : public Component, public ChangeListener, - public ButtonListener + public Button::Listener { public: //============================================================================== @@ -52,9 +46,9 @@ public: void rebuildConfigTabs(); //[/UserMethods] - void paint (Graphics& g); void resized(); void buttonClicked (Button* buttonThatWasClicked); + void paint (Graphics& g); //============================================================================== @@ -71,16 +65,17 @@ private: //[/UserVariables] //============================================================================== - TabbedComponent* configTabBox; - TextButton* editConfigsButton; - TextButton* openProjectButton; - TextButton* editExportersButton; + TabbedComponent configTabBox; + TextButton editConfigsButton; + TextButton openProjectButton; + TextButton editExportersButton; + TextButton saveAndOpenButton; //============================================================================== // (prevent copy constructor and operator= being generated..) ProjectInformationComponent (const ProjectInformationComponent&); - const ProjectInformationComponent& operator= (const ProjectInformationComponent&); + ProjectInformationComponent& operator= (const ProjectInformationComponent&); }; -#endif // __JUCER_HEADER_PROJECTINFORMATIONCOMPONENT_JUCERPROJECTINFORMATIONCOMPONENT_40825900__ +#endif // __JUCER_PROJECTINFORMATIONCOMPONENT_H_2F89B0AC__