FileChooserDialogBox Class Reference

A file open/save dialog box. More...

Inherits ResizableWindow, ButtonListener, and FileBrowserListener.

List of all members.

Classes

class  ContentComponent

Public Types

enum  ColourIds { titleTextColourId = 0x1000850 }
 

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

More...

Public Member Functions

 FileChooserDialogBox (const String &title, const String &instructions, FileBrowserComponent &browserComponent, bool warnAboutOverwritingExistingFiles, const Colour &backgroundColour)
 Creates a file chooser box.
 ~FileChooserDialogBox ()
 Destructor.
bool show (int width=0, int height=0)
 Displays and runs the dialog box modally.
void buttonClicked (Button *button)
void closeButtonPressed ()
void selectionChanged ()
void fileClicked (const File &file, const MouseEvent &e)
void fileDoubleClicked (const File &file)

Detailed Description

A file open/save dialog box.

This is a Juce-based file dialog box; to use a native file chooser, see the FileChooser class.

To use one of these, create it and call its show() method. e.g.

    {
        WildcardFileFilter wildcardFilter ("*.foo", "Foo files");

        FileBrowserComponent browser (FileBrowserComponent::loadFileMode,
                                      File::nonexistent,
                                      &wildcardFilter,
                                      0);

        FileChooserDialogBox dialogBox ("Open some kind of file",
                                        "Please choose some kind of file that you want to open...",
                                        browser,
                                        getLookAndFeel().alertWindowBackground);

        if (dialogBox.show())
        {
            File selectedFile = browser.getCurrentFile();
            ...
        }
    }
See also:
FileChooser

Member Enumeration Documentation

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

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:
titleTextColourId 

The colour to use to draw the box's title.

Reimplemented from ResizableWindow.


Constructor & Destructor Documentation

FileChooserDialogBox::FileChooserDialogBox ( const String title,
const String instructions,
FileBrowserComponent browserComponent,
bool  warnAboutOverwritingExistingFiles,
const Colour backgroundColour 
)

Creates a file chooser box.

Parameters:
title the main title to show at the top of the box
instructions an optional longer piece of text to show below the title in a smaller font, describing in more detail what's required.
browserComponent a FileBrowserComponent that will be shown inside this dialog box. Make sure you delete this after (but not before!) the dialog box has been deleted.
warnAboutOverwritingExistingFiles if true, then the user will be asked to confirm if they try to select a file that already exists. (This flag is only used when saving files)
backgroundColour the background colour for the top level window
See also:
FileBrowserComponent, FilePreviewComponent
FileChooserDialogBox::~FileChooserDialogBox (  ) 

Destructor.


Member Function Documentation

bool FileChooserDialogBox::show ( int  width = 0,
int  height = 0 
)

Displays and runs the dialog box modally.

This will show the box with the specified size, returning true if the user pressed 'ok', or false if they cancelled.

Leave the width or height as 0 to use the default size

void FileChooserDialogBox::buttonClicked ( Button button  )  [virtual]

For internal use only.

Implements ButtonListener.

void FileChooserDialogBox::closeButtonPressed (  ) 

For internal use only.

void FileChooserDialogBox::selectionChanged (  )  [virtual]

For internal use only.

Implements FileBrowserListener.

void FileChooserDialogBox::fileClicked ( const File file,
const MouseEvent e 
) [virtual]

For internal use only.

Implements FileBrowserListener.

void FileChooserDialogBox::fileDoubleClicked ( const File file  )  [virtual]

For internal use only.

Implements FileBrowserListener.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Mon Apr 26 11:42:11 2010 for JUCE by  doxygen 1.6.3