1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-03 03:30:06 +00:00

Changed the constness of the return type of MenuBarModel::getMenuBarNames() and MenuBarModel::getMenuForIndex(). Easy to update your code to handle this, just remove the 'const'.

This commit is contained in:
jules 2012-05-23 21:31:44 +01:00
parent 53b1e351cf
commit 4e754a838b
10 changed files with 22 additions and 23 deletions

View file

@ -174,13 +174,13 @@ public:
setApplicationCommandManagerToWatch (commandManager);
}
const StringArray getMenuBarNames()
StringArray getMenuBarNames()
{
const char* const names[] = { "File", "Edit", "View", "Window", "Tools", 0 };
return StringArray ((const char**) names);
}
const PopupMenu getMenuForIndex (int topLevelMenuIndex, const String& /*menuName*/)
PopupMenu getMenuForIndex (int topLevelMenuIndex, const String& /*menuName*/)
{
PopupMenu menu;

View file

@ -64,14 +64,14 @@ public:
}
//==============================================================================
const StringArray getMenuBarNames()
StringArray getMenuBarNames()
{
const char* const names[] = { "Demo", "Look-and-feel", nullptr };
return StringArray (names);
}
const PopupMenu getMenuForIndex (int menuIndex, const String& /*menuName*/)
PopupMenu getMenuForIndex (int menuIndex, const String& /*menuName*/)
{
ApplicationCommandManager* commandManager = &(mainWindow.commandManager);

View file

@ -164,14 +164,14 @@ void MainHostWindow::changeListenerCallback (ChangeBroadcaster*)
}
}
const StringArray MainHostWindow::getMenuBarNames()
StringArray MainHostWindow::getMenuBarNames()
{
const char* const names[] = { "File", "Plugins", "Options", nullptr };
return StringArray (names);
}
const PopupMenu MainHostWindow::getMenuForIndex (int topLevelMenuIndex, const String& /*menuName*/)
PopupMenu MainHostWindow::getMenuForIndex (int topLevelMenuIndex, const String& /*menuName*/)
{
PopupMenu menu;

View file

@ -68,8 +68,8 @@ public:
void fileDragExit (const StringArray& files);
void filesDropped (const StringArray& files, int, int);
const StringArray getMenuBarNames();
const PopupMenu getMenuForIndex (int topLevelMenuIndex, const String& menuName);
StringArray getMenuBarNames();
PopupMenu getMenuForIndex (int topLevelMenuIndex, const String& menuName);
void menuItemSelected (int menuItemID, int topLevelMenuIndex);
ApplicationCommandTarget* getNextCommandTarget();
void getAllCommands (Array <CommandID>& commands);

View file

@ -183,7 +183,7 @@ private:
.replaceCharacter ('\\', '/'));
}
const File getFile() const
File getFile() const
{
return component->findFile();
}

View file

@ -987,7 +987,7 @@ private:
"Change tab component file");
}
const File getFile() const
File getFile() const
{
return document.getFile().getSiblingFile (getTabJucerFile (component, tabIndex));
}

View file

@ -507,12 +507,11 @@ private:
{
document.perform (new JucerCompFileChangeAction (component, *document.getComponentLayout(),
newFile.getRelativePathFrom (document.getFile().getParentDirectory())
.replaceCharacter ('\\', '/')
),
.replaceCharacter ('\\', '/')),
"Change Jucer component file");
}
const File getFile() const
File getFile() const
{
const String filename (getViewportJucerComponentFile (component));

View file

@ -36,16 +36,16 @@ class FilePropertyComponent : public PropertyComponent,
public:
//==============================================================================
FilePropertyComponent (const String& name,
const bool isDirectory,
const bool allowEditingOfFilename,
const String& fileBrowserWildcard = "*");
const bool isDirectory,
const bool allowEditingOfFilename,
const String& fileBrowserWildcard = "*");
~FilePropertyComponent();
//==============================================================================
virtual void setFile (const File& newFile) = 0;
virtual const File getFile() const = 0;
virtual File getFile() const = 0;
//==============================================================================
void refresh();

View file

@ -223,15 +223,15 @@ void MainWindow::activeWindowStatusChanged()
}
//==============================================================================
const StringArray MainWindow::getMenuBarNames()
StringArray MainWindow::getMenuBarNames()
{
const char* const names[] = { "File", "Edit", "View", 0 };
return StringArray (names);
}
const PopupMenu MainWindow::getMenuForIndex (int topLevelMenuIndex,
const String& menuName)
PopupMenu MainWindow::getMenuForIndex (int topLevelMenuIndex,
const String& menuName)
{
PopupMenu menu;

View file

@ -111,15 +111,15 @@ public:
//==============================================================================
/** This method must return a list of the names of the menus. */
virtual const StringArray getMenuBarNames() = 0;
virtual StringArray getMenuBarNames() = 0;
/** This should return the popup menu to display for a given top-level menu.
@param topLevelMenuIndex the index of the top-level menu to show
@param menuName the name of the top-level menu item to show
*/
virtual const PopupMenu getMenuForIndex (int topLevelMenuIndex,
const String& menuName) = 0;
virtual PopupMenu getMenuForIndex (int topLevelMenuIndex,
const String& menuName) = 0;
/** This is called when a menu item has been clicked on.