openshot-audio  0.1.7
Classes | Public Types | Public Member Functions | List of all members
TooltipWindow Class Reference

#include <juce_TooltipWindow.h>

Inheritance diagram for TooltipWindow:
Timer

Classes

struct  LookAndFeelMethods
 

Public Types

enum  ColourIds { backgroundColourId = 0x1001b00, textColourId = 0x1001c00, outlineColourId = 0x1001c10 }
 

Public Member Functions

 TooltipWindow (Component *parentComponent=nullptr, int millisecondsBeforeTipAppears=700)
 
 ~TooltipWindow ()
 
void setMillisecondsBeforeTipAppears (int newTimeMs=700) noexcept
 
void displayTip (Point< int > screenPosition, const String &text)
 
void hideTip ()
 

Detailed Description

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. Note that if you instantiate more than one instance of this class, you'll end up with multiple tooltips being shown! This is a common problem when compiling audio plug-ins with JUCE: depending on the way you instantiate TooltipWindow, you may end up with a TooltipWindow for each plug-in instance. To avoid this use a SharedResourcePointer to instantiate the TooltipWindow only once.

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.

See Also
TooltipClient, SettableTooltipClient, SharedResourcePointer

Member Enumeration Documentation

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.

See Also
Component::setColour, Component::findColour, LookAndFeel::setColour, LookAndFeel::findColour
Enumerator
backgroundColourId 

The colour to fill the background with.

textColourId 

The colour to use for the text.

outlineColourId 

The colour to use to draw an outline around the tooltip.

Constructor & Destructor Documentation

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.

Parameters
parentComponentif set to 0, the TooltipWindow will appear on the desktop, otherwise the tooltip will be added to the given parent component.
millisecondsBeforeTipAppearsthe time for which the mouse has to stay still before a tooltip will be shown
See Also
TooltipClient, LookAndFeel::drawTooltip, LookAndFeel::getTooltipBounds
TooltipWindow::~TooltipWindow ( )

Destructor.

Member Function Documentation

void TooltipWindow::displayTip ( Point< int screenPosition,
const String text 
)

Can be called to manually force a tip to be shown at a particular location.

void TooltipWindow::hideTip ( )

Can be called to manually hide the tip if it's showing.

void TooltipWindow::setMillisecondsBeforeTipAppears ( int  newTimeMs = 700)
noexcept

Changes the time before the tip appears. This lets you change the value that was set in the constructor.


The documentation for this class was generated from the following files: