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

A component that displays the files in a directory as a listbox. More...

Inherits ListBox, DirectoryContentsDisplayComponent, ListBoxModel, and ChangeListener.

List of all members.

Public Member Functions

 FileListComponent (DirectoryContentsList &listToShow)
 Creates a listbox to show the contents of a specified directory.
 ~FileListComponent ()
 Destructor.
int getNumSelectedFiles () const
 Returns the number of files the user has got selected.
File getSelectedFile (int index=0) const
 Returns one of the files that the user has currently selected.
void deselectAllFiles ()
 Deselects any files that are currently selected.
void scrollToTop ()
 Scrolls to the top of the list.
void setSelectedFile (const File &)
 If the specified file is in the list, it will become the only selected item (and if the file isn't in the list, all other items will be deselected).
void changeListenerCallback (ChangeBroadcaster *)
int getNumRows ()
void paintListBoxItem (int, Graphics &, int, int, bool)
ComponentrefreshComponentForRow (int rowNumber, bool isRowSelected, Component *existingComponentToUpdate)
void selectedRowsChanged (int lastRowSelected)
void deleteKeyPressed (int currentSelectedRow)
void returnKeyPressed (int currentSelectedRow)

Detailed Description

A component that displays the files in a directory as a listbox.

This implements the DirectoryContentsDisplayComponent base class so that it can be used in a FileBrowserComponent.

To attach a listener to it, use its DirectoryContentsDisplayComponent base class and the FileBrowserListener class.

See also:
DirectoryContentsList, FileTreeComponent

Constructor & Destructor Documentation

Creates a listbox to show the contents of a specified directory.

Destructor.


Member Function Documentation

int FileListComponent::getNumSelectedFiles ( ) const [virtual]

Returns the number of files the user has got selected.

See also:
getSelectedFile

Implements DirectoryContentsDisplayComponent.

File FileListComponent::getSelectedFile ( int  index = 0) const [virtual]

Returns one of the files that the user has currently selected.

The index should be in the range 0 to (getNumSelectedFiles() - 1).

See also:
getNumSelectedFiles

Implements DirectoryContentsDisplayComponent.

Deselects any files that are currently selected.

Implements DirectoryContentsDisplayComponent.

void FileListComponent::scrollToTop ( ) [virtual]

Scrolls to the top of the list.

Implements DirectoryContentsDisplayComponent.

void FileListComponent::setSelectedFile ( const File ) [virtual]

If the specified file is in the list, it will become the only selected item (and if the file isn't in the list, all other items will be deselected).

Implements DirectoryContentsDisplayComponent.

Implements ChangeListener.

int FileListComponent::getNumRows ( ) [virtual]

Implements ListBoxModel.

void FileListComponent::paintListBoxItem ( int  ,
Graphics ,
int  ,
int  ,
bool   
) [virtual]

Implements ListBoxModel.

Component* FileListComponent::refreshComponentForRow ( int  rowNumber,
bool  isRowSelected,
Component existingComponentToUpdate 
) [virtual]

Reimplemented from ListBoxModel.

void FileListComponent::selectedRowsChanged ( int  lastRowSelected) [virtual]

Reimplemented from ListBoxModel.

void FileListComponent::deleteKeyPressed ( int  currentSelectedRow) [virtual]

Reimplemented from ListBoxModel.

void FileListComponent::returnKeyPressed ( int  currentSelectedRow) [virtual]

Reimplemented from ListBoxModel.


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