From b7560dbf63c900261f0692d37635f12732597c0b Mon Sep 17 00:00:00 2001 From: Josh Siegle <jsiegle@mit.edu> Date: Thu, 3 Oct 2013 16:21:18 -0400 Subject: [PATCH] Add 'Reset window bounds' option to 'View' menu --- Source/Processors/Editors/RecordControlEditor.cpp | 2 -- Source/UI/UIComponent.cpp | 13 ++++++++++++- Source/UI/UIComponent.h | 3 ++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Source/Processors/Editors/RecordControlEditor.cpp b/Source/Processors/Editors/RecordControlEditor.cpp index 05941b249..45d053497 100644 --- a/Source/Processors/Editors/RecordControlEditor.cpp +++ b/Source/Processors/Editors/RecordControlEditor.cpp @@ -120,10 +120,8 @@ void RecordControlEditor::loadEditorParameters(XmlElement* xml) if (xmlNode->hasTagName("PARAMETERS")) { - newFileToggleButton->setToggleState(xmlNode->getBoolAttribute("FileSaveOption"), true); availableChans->setSelectedId(xmlNode->getIntAttribute("Channel"), NotificationType::sendNotification); - } } diff --git a/Source/UI/UIComponent.cpp b/Source/UI/UIComponent.cpp index 7abdaf685..60b253f60 100755 --- a/Source/UI/UIComponent.cpp +++ b/Source/UI/UIComponent.cpp @@ -259,6 +259,8 @@ PopupMenu UIComponent::getMenuForIndex(int menuIndex, const String& menuName) menu.addCommandItem(commandManager, toggleProcessorList); menu.addCommandItem(commandManager, toggleSignalChain); menu.addCommandItem(commandManager, toggleFileInfo); + menu.addSeparator(); + menu.addCommandItem(commandManager, resizeWindow); } else if (menuIndex == 3) @@ -297,7 +299,8 @@ void UIComponent::getAllCommands(Array <CommandID>& commands) toggleProcessorList, toggleSignalChain, toggleFileInfo, - showHelp + showHelp, + resizeWindow }; commands.addArray(ids, numElementsInArray(ids)); @@ -375,6 +378,10 @@ void UIComponent::getCommandInfo(CommandID commandID, ApplicationCommandInfo& re result.setInfo("Show help...", "Show some freakin' help.", "General", 0); result.setActive(false); break; + + case resizeWindow: + result.setInfo("Reset window bounds", "Reset window bounds", "General", 0); + break; default: break; @@ -446,6 +453,10 @@ bool UIComponent::perform(const InvocationInfo& info) case toggleSignalChain: editorViewportButton->toggleState(); break; + + case resizeWindow: + mainWindow->centreWithSize(800, 600); + break; default: break; diff --git a/Source/UI/UIComponent.h b/Source/UI/UIComponent.h index 4e2dc1244..25661d106 100755 --- a/Source/UI/UIComponent.h +++ b/Source/UI/UIComponent.h @@ -195,7 +195,8 @@ private: toggleProcessorList = 0x2008, toggleSignalChain = 0x2009, toggleFileInfo = 0x2010, - showHelp = 0x2011 + showHelp = 0x2011, + resizeWindow = 0x2012 }; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(UIComponent); -- GitLab