How to find an example for a JUCE class

When i look for a quick example for a class i want to use, i grep its name in a terminal (e.g. ListBox):

grep -r “ListBox” ./

In the JUCE folder you get too many (bad) results. :anguished:
If you put all the examples in a separate folder results are more interesting. :grin:

JUCED.zip (665.3 KB)

.//Plugins/MidiLoggerPluginDemo.h:                   private TableListBoxModel
.//Plugins/MidiLoggerPluginDemo.h:    TableListBox table;
.//Utilities/OSCDemo.h:class OSCLogListBox    : public ListBox,
.//Utilities/OSCDemo.h:                         private ListBoxModel,
.//Utilities/OSCDemo.h:    OSCLogListBox()
.//Utilities/OSCDemo.h:    ~OSCLogListBox() override = default;
.//Utilities/OSCDemo.h:    void paintListBoxItem (int row, Graphics& g, int width, int height, bool rowIsSelected) override
.//Utilities/OSCDemo.h:    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OSCLogListBox)
.//Utilities/OSCDemo.h:        oscLogListBox.setBounds (0, 60, 700, 340);
.//Utilities/OSCDemo.h:        addAndMakeVisible (oscLogListBox);
.//Utilities/OSCDemo.h:                                                    oscLogListBox.addInvalidOSCPacket (data, dataSize);
.//Utilities/OSCDemo.h:    OSCLogListBox oscLogListBox;
.//Utilities/OSCDemo.h:        oscLogListBox.clear();
.//Utilities/OSCDemo.h:        oscLogListBox.addOSCMessage (message);
.//Utilities/OSCDemo.h:        oscLogListBox.addOSCBundle (bundle);
.//Utilities/InAppPurchasesDemo.h:class PhraseModel : public ListBoxModel
.//Utilities/InAppPurchasesDemo.h:    void paintListBoxItem (int row, Graphics& g, int w, int h, bool isSelected) override
.//Utilities/InAppPurchasesDemo.h:        g.setColour (lf.findColour (isSelected ? (int) TextEditor::highlightColourId : (int) ListBox::backgroundColourId));
.//Utilities/InAppPurchasesDemo.h:        g.setColour (lf.findColour (ListBox::textColourId));
.//Utilities/InAppPurchasesDemo.h:class VoiceModel  : public ListBoxModel
.//Utilities/InAppPurchasesDemo.h:    void paintListBoxItem (int, Graphics& g, int w, int h, bool isSelected) override
.//Utilities/InAppPurchasesDemo.h:        g.setColour (lf.findColour (isSelected ? (int) TextEditor::highlightColourId : (int) ListBox::backgroundColourId));
.//Utilities/InAppPurchasesDemo.h:        phraseListBox.setModel (phraseModel.get());
.//Utilities/InAppPurchasesDemo.h:        voiceListBox .setModel (voiceModel.get());
.//Utilities/InAppPurchasesDemo.h:        phraseListBox.setRowHeight (33);
.//Utilities/InAppPurchasesDemo.h:        phraseListBox.selectRow (0);
.//Utilities/InAppPurchasesDemo.h:        phraseListBox.updateContent();
.//Utilities/InAppPurchasesDemo.h:        voiceListBox.setRowHeight (66);
.//Utilities/InAppPurchasesDemo.h:        voiceListBox.selectRow (0);
.//Utilities/InAppPurchasesDemo.h:        voiceListBox.updateContent();
.//Utilities/InAppPurchasesDemo.h:        voiceListBox.getViewport()->setScrollOnDragEnabled (true);
.//Utilities/InAppPurchasesDemo.h:        addAndMakeVisible (phraseListBox);
.//Utilities/InAppPurchasesDemo.h:        addAndMakeVisible (voiceListBox);
.//Utilities/InAppPurchasesDemo.h:        voiceListBox.updateContent();
.//Utilities/InAppPurchasesDemo.h:        voiceListBox.setEnabled (! purchases.isPurchaseInProgress());
.//Utilities/InAppPurchasesDemo.h:        voiceListBox.repaint();
.//Utilities/InAppPurchasesDemo.h:            phraseListBox .setBounds (phraseArea);
.//Utilities/InAppPurchasesDemo.h:            voiceListBox.setBounds (voiceArea);
.//Utilities/InAppPurchasesDemo.h:        auto idx = voiceListBox.getSelectedRow();
.//Utilities/InAppPurchasesDemo.h:            auto assetName = "Purchases/" + soundNames[idx] + String (phraseListBox.getSelectedRow()) + ".ogg";
.//Utilities/InAppPurchasesDemo.h:    ListBox phraseListBox                      { "phraseListBox" };
.//Utilities/InAppPurchasesDemo.h:    std::unique_ptr<ListBoxModel> phraseModel  { new PhraseModel() };
.//Utilities/InAppPurchasesDemo.h:    ListBox voiceListBox                       { "voiceListBox" };
.//Utilities/Box2DDemo.h:class Box2DTestList : public ListBoxModel,
.//Utilities/Box2DDemo.h:    void paintListBoxItem (int row, Graphics& g, int w, int h, bool rowIsSelected) override
.//Utilities/Box2DDemo.h:            g.fillAll (Colour::contrasting (lf.findColour (ListBox::textColourId),
.//Utilities/Box2DDemo.h:                                            lf.findColour (ListBox::backgroundColourId)));
.//Utilities/Box2DDemo.h:        g.setColour (lf.findColour (ListBox::textColourId));
.//Utilities/Box2DDemo.h:        addAndMakeVisible (testsListBox);
.//Utilities/Box2DDemo.h:        testsListBox.setModel (&testsListModel);
.//Utilities/Box2DDemo.h:        testsListBox.selectRow (dominoes);
.//Utilities/Box2DDemo.h:        testsListBox.setBounds (area.removeFromLeft (150));
.//Utilities/Box2DDemo.h:    ListBox testsListBox;
.//Utilities/Box2DDemo.h:            auto index = testsListBox.getSelectedRow();
.//Audio/MidiDemo.h:          midiInputSelector  (new MidiDeviceListBox ("Midi Input Selector",  *this, true)),
.//Audio/MidiDemo.h:          midiOutputSelector (new MidiDeviceListBox ("Midi Output Selector", *this, false))
.//Audio/MidiDemo.h:    struct MidiDeviceListBox : public ListBox,
.//Audio/MidiDemo.h:                               private ListBoxModel
.//Audio/MidiDemo.h:        MidiDeviceListBox (const String& name,
.//Audio/MidiDemo.h:            : ListBox (name, this),
.//Audio/MidiDemo.h:        void paintListBoxItem (int rowNumber, Graphics& g,
.//Audio/MidiDemo.h:            auto textColour = getLookAndFeel().findColour (ListBox::textColourId);
.//Audio/MidiDemo.h:                g.fillAll (textColour.interpolatedWith (getLookAndFeel().findColour (ListBox::backgroundColourId), 0.5));
.//Audio/MidiDemo.h:    std::unique_ptr<MidiDeviceListBox> midiInputSelector, midiOutputSelector;
.//GUI/FontsDemo.h:                   private ListBoxModel,
.//GUI/FontsDemo.h:        listBox.setColour (ListBox::textColourId, Colours::black);
.//GUI/FontsDemo.h:        listBox.setColour (ListBox::backgroundColourId, Colours::white);
.//GUI/FontsDemo.h:    // The following methods implement the ListBoxModel virtual methods:
.//GUI/FontsDemo.h:    void paintListBoxItem (int rowNumber, Graphics& g,
.//GUI/FontsDemo.h:    ListBox listBox;
.//GUI/WidgetsDemo.h:    This class shows how to implement a TableListBoxModel to show in a TableListBox.
.//GUI/WidgetsDemo.h:                              public TableListBoxModel
.//GUI/WidgetsDemo.h:        table.setColour (ListBox::outlineColourId, Colours::grey);
.//GUI/WidgetsDemo.h:    // This is overloaded from TableListBoxModel, and must return the total number of rows in our table
.//GUI/WidgetsDemo.h:    // This is overloaded from TableListBoxModel, and should fill in the background of the whole row
.//GUI/WidgetsDemo.h:        auto alternateColour = getLookAndFeel().findColour (ListBox::backgroundColourId)
.//GUI/WidgetsDemo.h:                                               .interpolatedWith (getLookAndFeel().findColour (ListBox::textColourId), 0.03f);
.//GUI/WidgetsDemo.h:    // This is overloaded from TableListBoxModel, and must paint any cells that aren't using custom
.//GUI/WidgetsDemo.h:        g.setColour (getLookAndFeel().findColour (ListBox::textColourId));
.//GUI/WidgetsDemo.h:        g.setColour (getLookAndFeel().findColour (ListBox::backgroundColourId));
.//GUI/WidgetsDemo.h:    // This is overloaded from TableListBoxModel, and tells us that the user has clicked a table header
.//GUI/WidgetsDemo.h:    // This is overloaded from TableListBoxModel, and must update any custom components that we're using
.//GUI/WidgetsDemo.h:    // This is overloaded from TableListBoxModel, and should choose the best width for the specified
.//GUI/WidgetsDemo.h:    TableListBox table;     // the table component itself
.//GUI/WidgetsDemo.h:        sourceListBox.setModel (&sourceModel);
.//GUI/WidgetsDemo.h:        sourceListBox.setMultipleSelectionEnabled (true);
.//GUI/WidgetsDemo.h:        addAndMakeVisible (sourceListBox);
.//GUI/WidgetsDemo.h:        sourceListBox.setBounds (r.withSize (250, 180));
.//GUI/WidgetsDemo.h:    struct SourceItemListboxContents  : public ListBoxModel
.//GUI/WidgetsDemo.h:        // The following methods implement the necessary virtual functions from ListBoxModel,
.//GUI/WidgetsDemo.h:        void paintListBoxItem (int rowNumber, Graphics& g,
.//GUI/WidgetsDemo.h:    ListBox sourceListBox  { "D+D source", nullptr };
.//GUI/GraphicsDemo.h:                            private ListBoxModel
.//GUI/GraphicsDemo.h:    void paintListBoxItem (int rowNumber, Graphics& g, int width, int height, bool rowIsSelected)
.//GUI/GraphicsDemo.h:                g.fillAll (Colour::contrasting (findColour (ListBox::textColourId),
.//GUI/GraphicsDemo.h:                                                findColour (ListBox::backgroundColourId)));
.//GUI/GraphicsDemo.h:            g.setColour (findColour (ListBox::textColourId));
.//GUI/GraphicsDemo.h:    ListBox listBox;
.//DemoRunner/Source/UI/MainComponent.cpp:                    public ListBoxModel
.//DemoRunner/Source/UI/MainComponent.cpp:    void paintListBoxItem (int rowNumber, Graphics& g, int width, int height, bool rowIsSelected) override
.//DemoRunner/Source/UI/MainComponent.cpp:    ListBox demos;
.//Tutorials/OSCMonitorTutorial_01.h:class OSCLogListBox    : public juce::ListBox,
.//Tutorials/OSCMonitorTutorial_01.h:                         private juce::ListBoxModel,
.//Tutorials/OSCMonitorTutorial_01.h:    OSCLogListBox()
.//Tutorials/OSCMonitorTutorial_01.h:    void paintListBoxItem (int row, juce::Graphics& g, int width, int height, bool rowIsSelected) override
.//Tutorials/OSCMonitorTutorial_01.h:    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OSCLogListBox)
.//Tutorials/OSCMonitorTutorial_02.h:class OSCLogListBox    : public juce::ListBox,
.//Tutorials/OSCMonitorTutorial_02.h:                         private juce::ListBoxModel,
.//Tutorials/OSCMonitorTutorial_02.h:    OSCLogListBox()
.//Tutorials/OSCMonitorTutorial_02.h:    void paintListBoxItem (int row, juce::Graphics& g, int width, int height, bool rowIsSelected) override
.//Tutorials/OSCMonitorTutorial_02.h:    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OSCLogListBox)
.//Tutorials/OSCMonitorTutorial_02.h:        oscLogListBox.setBounds (0, 60, 700, 340);  // [4]
.//Tutorials/OSCMonitorTutorial_02.h:        addAndMakeVisible (oscLogListBox);
.//Tutorials/OSCMonitorTutorial_02.h:                                                    oscLogListBox.addInvalidOSCPacket (data, dataSize);
.//Tutorials/OSCMonitorTutorial_02.h:    OSCLogListBox oscLogListBox;        // [2]
.//Tutorials/OSCMonitorTutorial_02.h:        oscLogListBox.clear();
.//Tutorials/OSCMonitorTutorial_02.h:        oscLogListBox.addOSCMessage (message);
.//Tutorials/OSCMonitorTutorial_02.h:        oscLogListBox.addOSCBundle (bundle);
.//Tutorials/TableListBoxTutorial.h: name:             TableListBoxTutorial
.//Tutorials/TableListBoxTutorial.h:                                  public juce::TableListBoxModel
.//Tutorials/TableListBoxTutorial.h:        table.setColour (juce::ListBox::outlineColourId, juce::Colours::grey);      // [2]
.//Tutorials/TableListBoxTutorial.h:        auto alternateColour = getLookAndFeel().findColour (juce::ListBox::backgroundColourId)
.//Tutorials/TableListBoxTutorial.h:                                               .interpolatedWith (getLookAndFeel().findColour (juce::ListBox::textColourId), 0.03f);
.//Tutorials/TableListBoxTutorial.h:        g.setColour (rowIsSelected ? juce::Colours::darkblue : getLookAndFeel().findColour (juce::ListBox::textColourId));  // [5]
.//Tutorials/TableListBoxTutorial.h:        g.setColour (getLookAndFeel().findColour (juce::ListBox::backgroundColourId));
.//Tutorials/TableListBoxTutorial.h:    juce::TableListBox table  { {}, this };

And you can put also interesting third party stuff to improve the help with time.