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.

54 lines
1.3KB

  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. namespace juce
  14. {
  15. ToggleButton::ToggleButton()
  16. : Button (String())
  17. {
  18. setClickingTogglesState (true);
  19. }
  20. ToggleButton::ToggleButton (const String& buttonText)
  21. : Button (buttonText)
  22. {
  23. setClickingTogglesState (true);
  24. }
  25. ToggleButton::~ToggleButton()
  26. {
  27. }
  28. void ToggleButton::paintButton (Graphics& g, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown)
  29. {
  30. getLookAndFeel().drawToggleButton (g, *this, shouldDrawButtonAsHighlighted, shouldDrawButtonAsDown);
  31. }
  32. void ToggleButton::changeWidthToFitText()
  33. {
  34. getLookAndFeel().changeToggleButtonWidthToFitText (*this);
  35. }
  36. void ToggleButton::colourChanged()
  37. {
  38. repaint();
  39. }
  40. } // namespace juce