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.

86 lines
2.8KB

  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. #ifndef JUCE_TOOLTIPCLIENT_H_INCLUDED
  18. #define JUCE_TOOLTIPCLIENT_H_INCLUDED
  19. //==============================================================================
  20. /**
  21. Components that want to use pop-up tooltips should implement this interface.
  22. A TooltipWindow will wait for the mouse to hover over a component that
  23. implements the TooltipClient interface, and when it finds one, it will display
  24. the tooltip returned by its getTooltip() method.
  25. @see TooltipWindow, SettableTooltipClient
  26. */
  27. class JUCE_API TooltipClient
  28. {
  29. public:
  30. /** Destructor. */
  31. virtual ~TooltipClient() {}
  32. /** Returns the string that this object wants to show as its tooltip. */
  33. virtual String getTooltip() = 0;
  34. };
  35. //==============================================================================
  36. /**
  37. An implementation of TooltipClient that stores the tooltip string and a method
  38. for changing it.
  39. This makes it easy to add a tooltip to a custom component, by simply adding this
  40. as a base class and calling setTooltip().
  41. Many of the Juce widgets already use this as a base class to implement their
  42. tooltips.
  43. @see TooltipClient, TooltipWindow
  44. */
  45. class JUCE_API SettableTooltipClient : public TooltipClient
  46. {
  47. public:
  48. //==============================================================================
  49. /** Destructor. */
  50. ~SettableTooltipClient() {}
  51. //==============================================================================
  52. /** Assigns a new tooltip to this object. */
  53. virtual void setTooltip (const String& newTooltip) { tooltipString = newTooltip; }
  54. /** Returns the tooltip assigned to this object. */
  55. String getTooltip() override { return tooltipString; }
  56. protected:
  57. SettableTooltipClient() {}
  58. private:
  59. String tooltipString;
  60. };
  61. #endif // JUCE_TOOLTIPCLIENT_H_INCLUDED