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.

75 lines
2.4KB

  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_PaintElement.h"
  15. #include "../jucer_ObjectTypes.h"
  16. //==============================================================================
  17. class PaintElementGroup : public PaintElement
  18. {
  19. public:
  20. PaintElementGroup (PaintRoutine*);
  21. ~PaintElementGroup() override;
  22. void ungroup (const bool);
  23. static void groupSelected (PaintRoutine* const);
  24. int getNumElements() const noexcept;
  25. PaintElement* getElement (const int index) const noexcept;
  26. int indexOfElement (const PaintElement* element) const noexcept;
  27. bool containsElement (const PaintElement* element) const;
  28. //==============================================================================
  29. void setInitialBounds (int, int) override;
  30. Rectangle<int> getCurrentBounds (const Rectangle<int>&) const override;
  31. void setCurrentBounds (const Rectangle<int>&, const Rectangle<int>&, const bool) override;
  32. //==============================================================================
  33. void draw (Graphics&, const ComponentLayout*, const Rectangle<int>&) override;
  34. void getEditableProperties (Array<PropertyComponent*>&, bool) override;
  35. void fillInGeneratedCode (GeneratedCode&, String&) override;
  36. static const char* getTagName() noexcept;
  37. XmlElement* createXml() const override;
  38. bool loadFromXml (const XmlElement&) override;
  39. void applyCustomPaintSnippets (StringArray&) override;
  40. private:
  41. OwnedArray<PaintElement> subElements;
  42. struct UngroupProperty : public ButtonPropertyComponent
  43. {
  44. UngroupProperty (PaintElementGroup* const);
  45. void buttonClicked();
  46. String getButtonText() const;
  47. PaintElementGroup* element;
  48. };
  49. };