Audio plugin host https://kx.studio/carla
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.

51 lines
1.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. PropertyComponent::PropertyComponent (const String& name, const int preferredHeight_)
  18. : Component (name), preferredHeight (preferredHeight_)
  19. {
  20. jassert (name.isNotEmpty());
  21. }
  22. PropertyComponent::~PropertyComponent() {}
  23. void PropertyComponent::paint (Graphics& g)
  24. {
  25. LookAndFeel& lf = getLookAndFeel();
  26. lf.drawPropertyComponentBackground (g, getWidth(), getHeight(), *this);
  27. lf.drawPropertyComponentLabel (g, getWidth(), getHeight(), *this);
  28. }
  29. void PropertyComponent::resized()
  30. {
  31. if (Component* const c = getChildComponent(0))
  32. c->setBounds (getLookAndFeel().getPropertyComponentContentPosition (*this));
  33. }
  34. void PropertyComponent::enablementChanged()
  35. {
  36. repaint();
  37. }