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.

67 lines
2.2KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 6 technical preview.
  4. Copyright (c) 2020 - Raw Material Software Limited
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For this technical preview, this file is not subject to commercial licensing.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. #pragma once
  14. #include "../jucer_JucerDocument.h"
  15. //==============================================================================
  16. class TestComponent : public Component
  17. {
  18. public:
  19. //==============================================================================
  20. TestComponent (JucerDocument* const ownerDocument,
  21. JucerDocument* const loadedDocument,
  22. const bool alwaysFillBackground);
  23. ~TestComponent() override;
  24. //==============================================================================
  25. void setFilename (const String& fn);
  26. const String& getFilename() const noexcept { return filename; }
  27. void setConstructorParams (const String& newParams);
  28. const String& getConstructorParams() const noexcept { return constructorParams; }
  29. File findFile() const;
  30. JucerDocument* getDocument() const noexcept { return loadedDocument.get(); }
  31. JucerDocument* getOwnerDocument() const noexcept { return ownerDocument; }
  32. void setToInitialSize();
  33. //==============================================================================
  34. void paint (Graphics&) override;
  35. void resized() override;
  36. static void showInDialogBox (JucerDocument&);
  37. // reloads any test comps that need to do so
  38. static void reloadAll();
  39. private:
  40. JucerDocument* ownerDocument;
  41. std::unique_ptr<JucerDocument> loadedDocument;
  42. String filename, constructorParams;
  43. Time lastModificationTime;
  44. const bool alwaysFillBackground;
  45. void updateContents();
  46. void reload();
  47. };