Jucer 1.12 deletes the code enclosed by
//[MiscUserCode] You can add your own definitions of your custom methods or any other code here…
//[/MiscUserCode]
[code]//[MiscUserCode] You can add your own definitions of your custom methods or any other code here…
//================================================================================================
// MenuBarModel methods
//================================================================================================
const StringArray ContentComponent::getMenuBarNames()
{
if (LocalisedStrings::getCurrentMappings() != 0)
{
const tchar* const names[] = {TRANS(“File”), TRANS(“Help”), 0};
return StringArray ((const tchar**) names);
}
else
{
const tchar* const names[] = {T(“File”), T(“Help”), 0};
return StringArray ((const tchar**) names);
}
//StringArray stringArray;
}
const PopupMenu ContentComponent::getMenuForIndex (int menuIndex, const String& menuName)
{
ApplicationCommandManager* const commandManager = commandManager_;
PopupMenu menu;
if (menuIndex == 0)
{
menu.addCommandItem (commandManager, StandardApplicationCommandIDs::quit);
}
else if (menuIndex == 1)
{
menu.addCommandItem (commandManager, showAbout);
}
return menu;
}
void ContentComponent::menuItemSelected (int menuItemID, int topLevelMenuIndex)
{
// All our menu items are invoked automatically as commands, so no need to do
// anything in this callback.
}
//================================================================================================
// CommandManager methods
//================================================================================================
ApplicationCommandTarget* ContentComponent::getNextCommandTarget()
{
// This will return the next parent component that is an ApplicationCommandTarget (in this
// case, there probably isn’t one, but it’s best to use this method in your own apps).
return findFirstTargetParentComponent();
}
void ContentComponent::getAllCommands (Array & commands)
{
const CommandID ids[] =
{
showAbout
#if JUCE_MAC
, useNativeMenus
#endif
};
commands.addArray (ids, numElementsInArray (ids));
}
void ContentComponent::getCommandInfo (const CommandID commandId, ApplicationCommandInfo& result)
{
const String generalCategory (TRANS(“General”));
switch (commandId)
{
#if JUCE_MAC
case useNativeMenus:
result.setInfo (T(“Use the native OSX menu bar”), String::empty, generalCategory, 0);
result.setTicked (MenuBarModel::getMacMainMenu() != 0);
break;
#endif
case showAbout:
result.setInfo (TRANS("About") + T(" Virtual Filharmonia"), String::empty, generalCategory, 0);
break;
default:
break;
};
}
bool ContentComponent::perform (const InvocationInfo& info)
{
switch (info.commandID)
{
#if JUCE_MAC
case useNativeMenus:
if (MenuBarModel::getMacMainMenu() != 0)
{
MenuBarModel::setMacMainMenu (0);
mainWindow_->setMenuBar ((ContentComponent*) mainWindow_->getContentComponent());
}
else
MenuBarModel::setMacMainMenu ((ContentComponent*) mainWindow_->getContentComponent());
mainWindow_->setMenuBar (0);
break;
#endif
case showAbout:
{
AlertWindow aboutWindow (TRANS("Virtual Filharmonia"),
TRANS("Version %VERS\n\n").replace ("%VERS", JUCEApplication::getInstance()->getApplicationVersion()) +
TRANS("Written by") + T(" Nickie Fønshauge\n") +
T("Copyright ©2010. ") + TRANS("All rights reserved"),
AlertWindow::NoIcon);
aboutWindow.addButton (TRANS("ok"), 1, KeyPress (KeyPress::returnKey), KeyPress (KeyPress::escapeKey));
DBG (T("About"));
}
break;
default:
return false;
};
return true;
}
//=============================================================================================
int ContentComponent::getMinWidth()
{
int minWidth;
minWidth = getThisMinWidth();
minWidth = (minWidth < foyerComponent_->getMinWidth()) ? foyerComponent_->getMinWidth() : minWidth;
/minWidth = (minWidth < instrumentMakerComponent_->getMinWidth()) ? instrumentMakerComponent_->getMinWidth() : minWidth;
minWidth = (minWidth < janitorComponent_->getMinWidth()) ? janitorComponent_->getMinWidth() : minWidth;
minWidth = (minWidth < quickJumpComponent_->getMinWidth() +
mainCpuMeter_->getMinWidth()) ? quickJumpComponent_->getMinWidth() +
mainCpuMeter_->getMinWidth() : minWidth;/
//DBG (T("Content Component: minWidth = ") + String(minWidth));
return minWidth;
}
int ContentComponent::getMinHeight()
{
int minHeight = 0;
minHeight = (minHeight < foyerComponent_->getMinHeight()) ? foyerComponent_->getMinHeight() : minHeight;
/minHeight = (minHeight < instrumentMakerComponent_->getMinHeight()) ? instrumentMakerComponent_->getMinHeight() : minHeight;
minHeight = (minHeight < janitorComponent_->getMinHeight()) ? janitorComponent_->getMinHeight() : minHeight;
minHeight = (minHeight < mainCpuMeter_->getMinHeight()) ? mainCpuMeter_->getMinHeight() : minHeight;/
minHeight = (minHeight < getThisMinHeight()) ? getThisMinHeight() : minHeight;
//minHeight = getThisMinHeight();
//minHeight += quickJumpComponent_->getMinHeight();
return minHeight;
}
//[/MiscUserCode]
[/code]
Any idea why?