/* ============================================================================== This file was auto-generated! ============================================================================== */ #ifndef MAINCOMPONENT_H_INCLUDED #define MAINCOMPONENT_H_INCLUDED #include "../JuceLibraryCode/JuceHeader.h" //============================================================================== /* This component lives inside our window, and this is where you should put all your controls and content. */ class MainContentComponent : public Component, private Button::Listener { public: //============================================================================== MainContentComponent() { openFileBrowserButton.setButtonText ("Open file browser"); openFileBrowserButton.addListener (this); addAndMakeVisible (openFileBrowserButton); lookAndFeel.setColour (DirectoryContentsDisplayComponent::textColourId, Colours::white); lookAndFeel.setColour (ListBox::backgroundColourId, Colours::black); LookAndFeel::setDefaultLookAndFeel (&lookAndFeel); setSize (500, 500); } ~MainContentComponent() {} void paint (Graphics& g) override { } void resized() override { openFileBrowserButton.centreWithSize (200, 40); } private: TextButton openFileBrowserButton; void buttonClicked (Button* b) override { if (b == &openFileBrowserButton) { WildcardFileFilter wildcardFilter (".jpg;.png", String(), "Foo files"); FileBrowserComponent browser (FileBrowserComponent::openMode | FileBrowserComponent::canSelectFiles, File(), nullptr, nullptr); FileChooserDialogBox dialogBox ("Open some kind of file", "Please choose some kind of file that you want to open...", browser, false, browser.findColour (AlertWindow::backgroundColourId)); dialogBox.show(); } } LookAndFeel_V1 lookAndFeel; //============================================================================== JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainContentComponent) }; #endif // MAINCOMPONENT_H_INCLUDED