JUCE
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
Public Member Functions
SplashScreen Class Reference

A component for showing a splash screen while your app starts up. More...

Inherits Component, Timer, and DeletedAtShutdown.

List of all members.

Public Member Functions

 SplashScreen ()
 Creates a SplashScreen object.
 ~SplashScreen ()
 Destructor.
void show (const String &title, const Image &backgroundImage, int minimumTimeToDisplayFor, bool useDropShadow, bool removeOnMouseClick=true)
 Creates a SplashScreen object that will display an image.
void show (const String &title, int width, int height, int minimumTimeToDisplayFor, bool useDropShadow, bool removeOnMouseClick=true)
 Creates a SplashScreen object with a specified size.
void paint (Graphics &g)
void timerCallback ()

Detailed Description

A component for showing a splash screen while your app starts up.

This will automatically position itself, and delete itself when the app has finished initialising (it uses the JUCEApplication::isInitialising() to detect this).

To use it, just create one of these in your JUCEApplication::initialise() method, call its show() method and let the object delete itself later.

E.g.

    void MyApp::initialise (const String& commandLine)
    {
        SplashScreen* splash = new SplashScreen();

        splash->show ("welcome to my app",
                      ImageCache::getFromFile (File ("/foobar/splash.jpg")),
                      4000, false);

        .. no need to delete the splash screen - it'll do that itself.
    }

Constructor & Destructor Documentation

Creates a SplashScreen object.

After creating one of these (or your subclass of it), call one of the show() methods to display it.

Destructor.


Member Function Documentation

void SplashScreen::show ( const String title,
const Image backgroundImage,
int  minimumTimeToDisplayFor,
bool  useDropShadow,
bool  removeOnMouseClick = true 
)

Creates a SplashScreen object that will display an image.

As soon as this is called, the SplashScreen will be displayed in the centre of the screen. This method will also dispatch any pending messages to make sure that when it returns, the splash screen has been completely drawn, and your initialisation code can carry on.

Parameters:
titlethe name to give the component
backgroundImagean image to draw on the component. The component's size will be set to the size of this image, and if the image is semi-transparent, the component will be made semi-transparent too. This image will be deleted (or released from the ImageCache if that's how it was created) by the splash screen object when it is itself deleted.
minimumTimeToDisplayForhow long (in milliseconds) the splash screen should stay visible for. If the initialisation takes longer than this time, the splash screen will wait for it to finish before disappearing, but if initialisation is very quick, this lets you make sure that people get a good look at your splash.
useDropShadowif true, the window will have a drop shadow
removeOnMouseClickif true, the window will go away as soon as the user clicks the mouse (anywhere)
void SplashScreen::show ( const String title,
int  width,
int  height,
int  minimumTimeToDisplayFor,
bool  useDropShadow,
bool  removeOnMouseClick = true 
)

Creates a SplashScreen object with a specified size.

For a custom splash screen, you can use this method to display it at a certain size and then override the paint() method yourself to do whatever's necessary.

As soon as this is called, the SplashScreen will be displayed in the centre of the screen. This method will also dispatch any pending messages to make sure that when it returns, the splash screen has been completely drawn, and your initialisation code can carry on.

Parameters:
titlethe name to give the component
widththe width to use
heightthe height to use
minimumTimeToDisplayForhow long (in milliseconds) the splash screen should stay visible for. If the initialisation takes longer than this time, the splash screen will wait for it to finish before disappearing, but if initialisation is very quick, this lets you make sure that people get a good look at your splash.
useDropShadowif true, the window will have a drop shadow
removeOnMouseClickif true, the window will go away as soon as the user clicks the mouse (anywhere)
void SplashScreen::paint ( Graphics g) [virtual]

Reimplemented from Component.

void SplashScreen::timerCallback ( ) [virtual]

Implements Timer.


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