A window that displays a pop-up tooltip when the mouse hovers over another component. More...
Inherits Component, and Timer.
Public Types | |
| enum | ColourIds { backgroundColourId = 0x1001b00, textColourId = 0x1001c00, outlineColourId = 0x1001c10 } |
| A set of colour IDs to use to change the colour of various aspects of the tooltip. More... | |
Public Member Functions | |
| TooltipWindow (Component *parentComponent=nullptr, int millisecondsBeforeTipAppears=700) | |
| Creates a tooltip window. | |
| ~TooltipWindow () | |
| Destructor. | |
| void | setMillisecondsBeforeTipAppears (int newTimeMs=700) noexcept |
| Changes the time before the tip appears. | |
A window that displays a pop-up tooltip when the mouse hovers over another component.
To enable tooltips in your app, just create a single instance of a TooltipWindow object.
The TooltipWindow object will then stay invisible, waiting until the mouse hovers for the specified length of time - it will then see if it's currently over a component which implements the TooltipClient interface, and if so, it will make itself visible to show the tooltip in the appropriate place.
A set of colour IDs to use to change the colour of various aspects of the tooltip.
These constants can be used either via the Component::setColour(), or LookAndFeel::setColour() methods.
| TooltipWindow::TooltipWindow | ( | Component * | parentComponent = nullptr, |
| int | millisecondsBeforeTipAppears = 700 |
||
| ) | [explicit] |
Creates a tooltip window.
Make sure your app only creates one instance of this class, otherwise you'll get multiple overlaid tooltips appearing. The window will initially be invisible and will make itself visible when it needs to display a tip.
To change the style of tooltips, see the LookAndFeel class for its tooltip methods.
| parentComponent | if set to 0, the TooltipWindow will appear on the desktop, otherwise the tooltip will be added to the given parent component. |
| millisecondsBeforeTipAppears | the time for which the mouse has to stay still before a tooltip will be shown |
Destructor.
| void TooltipWindow::setMillisecondsBeforeTipAppears | ( | int | newTimeMs = 700 | ) |
Changes the time before the tip appears.
This lets you change the value that was set in the constructor.