openshot-audio  0.1.6
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
ProgressBar Class Reference

#include <juce_ProgressBar.h>

Inheritance diagram for ProgressBar:
Timer

Classes

struct  LookAndFeelMethods
 

Public Types

enum  ColourIds { backgroundColourId = 0x1001900, foregroundColourId = 0x1001a00 }
 

Public Member Functions

 ProgressBar (double &progress)
 
 ~ProgressBar ()
 
void setPercentageDisplay (bool shouldDisplayPercentage)
 
void setTextToDisplay (const String &text)
 

Protected Member Functions

void paint (Graphics &) override
 
void lookAndFeelChanged () override
 
void visibilityChanged () override
 
void colourChanged () override
 

Detailed Description

A progress bar component.

To use this, just create one and make it visible. It'll run its own timer to keep an eye on a variable that you give it, and will automatically redraw itself when the variable changes.

For an easy way of running a background task with a dialog box showing its progress, see the ThreadWithProgressWindow class.

See also
ThreadWithProgressWindow

Member Enumeration Documentation

A set of colour IDs to use to change the colour of various aspects of the bar.

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 background colour, behind the bar.

foregroundColourId 

The colour to use to draw the bar itself. LookAndFeel classes will probably use variations on this colour.

Constructor & Destructor Documentation

ProgressBar::ProgressBar ( double &  progress)
explicit

Creates a ProgressBar.

Parameters
progresspass in a reference to a double that you're going to update with your task's progress. The ProgressBar will monitor the value of this variable and will redraw itself when the value changes. The range is from 0 to 1.0. Obviously you'd better be careful not to delete this variable while the ProgressBar still exists!
ProgressBar::~ProgressBar ( )

Destructor.

Member Function Documentation

void ProgressBar::colourChanged ( )
overrideprotected
void ProgressBar::lookAndFeelChanged ( )
overrideprotected
void ProgressBar::paint ( Graphics g)
overrideprotected
void ProgressBar::setPercentageDisplay ( bool  shouldDisplayPercentage)

Turns the percentage display on or off.

By default this is on, and the progress bar will display a text string showing its current percentage.

void ProgressBar::setTextToDisplay ( const String text)

Gives the progress bar a string to display inside it.

If you call this, it will turn off the percentage display.

See also
setPercentageDisplay
void ProgressBar::visibilityChanged ( )
overrideprotected

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