The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.6KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #pragma once
  18. #include "../jucer_JucerDocument.h"
  19. //==============================================================================
  20. /**
  21. */
  22. class TestComponent : public Component
  23. {
  24. public:
  25. //==============================================================================
  26. TestComponent (JucerDocument* const ownerDocument,
  27. JucerDocument* const loadedDocument,
  28. const bool alwaysFillBackground);
  29. ~TestComponent();
  30. //==============================================================================
  31. void setFilename (const String& fn);
  32. const String& getFilename() const noexcept { return filename; }
  33. void setConstructorParams (const String& newParams);
  34. const String& getConstructorParams() const noexcept { return constructorParams; }
  35. File findFile() const;
  36. JucerDocument* getDocument() const noexcept { return loadedDocument; }
  37. JucerDocument* getOwnerDocument() const noexcept { return ownerDocument; }
  38. void setToInitialSize();
  39. //==============================================================================
  40. void paint (Graphics&) override;
  41. void resized() override;
  42. static void showInDialogBox (JucerDocument&);
  43. // reloads any test comps that need to do so
  44. static void reloadAll();
  45. private:
  46. JucerDocument* ownerDocument;
  47. ScopedPointer<JucerDocument> loadedDocument;
  48. String filename, constructorParams;
  49. Time lastModificationTime;
  50. LookAndFeel_V2 lookAndFeel;
  51. const bool alwaysFillBackground;
  52. void updateContents();
  53. void reload();
  54. };