Browse Source

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'.

tags/2021-05-28
jules 13 years ago
parent
commit
4e754a838b
10 changed files with 22 additions and 23 deletions
  1. +2
    -2
      extras/Introjucer/Source/Application/jucer_Application.h
  2. +2
    -2
      extras/JuceDemo/Source/MainDemoWindow.cpp
  3. +2
    -2
      extras/audio plugin host/Source/MainHostWindow.cpp
  4. +2
    -2
      extras/audio plugin host/Source/MainHostWindow.h
  5. +1
    -1
      extras/the jucer/src/model/components/jucer_JucerComponentHandler.h
  6. +1
    -1
      extras/the jucer/src/model/components/jucer_TabbedComponentHandler.h
  7. +2
    -3
      extras/the jucer/src/model/components/jucer_ViewportHandler.h
  8. +4
    -4
      extras/the jucer/src/properties/jucer_FilePropertyComponent.h
  9. +3
    -3
      extras/the jucer/src/ui/jucer_MainWindow.cpp
  10. +3
    -3
      modules/juce_gui_basics/menus/juce_MenuBarModel.h

+ 2
- 2
extras/Introjucer/Source/Application/jucer_Application.h View File

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


+ 2
- 2
extras/JuceDemo/Source/MainDemoWindow.cpp View File

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


+ 2
- 2
extras/audio plugin host/Source/MainHostWindow.cpp 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 }; const char* const names[] = { "File", "Plugins", "Options", nullptr };
return StringArray (names); return StringArray (names);
} }
const PopupMenu MainHostWindow::getMenuForIndex (int topLevelMenuIndex, const String& /*menuName*/)
PopupMenu MainHostWindow::getMenuForIndex (int topLevelMenuIndex, const String& /*menuName*/)
{ {
PopupMenu menu; PopupMenu menu;


+ 2
- 2
extras/audio plugin host/Source/MainHostWindow.h View File

@@ -68,8 +68,8 @@ public:
void fileDragExit (const StringArray& files); void fileDragExit (const StringArray& files);
void filesDropped (const StringArray& files, int, int); 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); void menuItemSelected (int menuItemID, int topLevelMenuIndex);
ApplicationCommandTarget* getNextCommandTarget(); ApplicationCommandTarget* getNextCommandTarget();
void getAllCommands (Array <CommandID>& commands); void getAllCommands (Array <CommandID>& commands);


+ 1
- 1
extras/the jucer/src/model/components/jucer_JucerComponentHandler.h View File

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


+ 1
- 1
extras/the jucer/src/model/components/jucer_TabbedComponentHandler.h View File

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


+ 2
- 3
extras/the jucer/src/model/components/jucer_ViewportHandler.h View File

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


+ 4
- 4
extras/the jucer/src/properties/jucer_FilePropertyComponent.h View File

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


+ 3
- 3
extras/the jucer/src/ui/jucer_MainWindow.cpp View File

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


+ 3
- 3
modules/juce_gui_basics/menus/juce_MenuBarModel.h View File

@@ -111,15 +111,15 @@ public:
//============================================================================== //==============================================================================
/** This method must return a list of the names of the menus. */ /** 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. /** 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 topLevelMenuIndex the index of the top-level menu to show
@param menuName the name of the top-level menu item 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. /** This is called when a menu item has been clicked on.


Loading…
Cancel
Save