Loading...
Searching...
No Matches
juce::DirectoryContentsDisplayComponent Class Referenceabstract

## Detailed Description

A base class for components that display a list of the files in a directory.

See also
  DirectoryContentsList

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

- juce_gui_basics/filebrowser/juce_DirectoryContentsDisplayComponent.h

Inheritance diagram for juce::DirectoryContentsDisplayComponent:

## Public Types

enum | ColourIds { highlightColourId = 0x1000540 , textColourId = 0x1000541 , highlightedTextColourId = 0x1000542 }
| A set of colour IDs to use to change the colour of various aspects of the list. More...

## Public Member Functions

| DirectoryContentsDisplayComponent (DirectoryContentsList &listToShow)
| Creates a DirectoryContentsDisplayComponent for a given list of files.
virtual | ~DirectoryContentsDisplayComponent ()
| Destructor.
virtual int | getNumSelectedFiles () const =0
| Returns the number of files the user has got selected.
virtual File | getSelectedFile (int index) const =0
| Returns one of the files that the user has currently selected.
virtual void | deselectAllFiles ()=0
| Deselects any selected files.
virtual void | scrollToTop ()=0
| Scrolls this view to the top.
virtual void | setSelectedFile (const File &)=0
| 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 | addListener (FileBrowserListener *listener)
| Adds a listener to be told when files are selected or clicked.
void | removeListener (FileBrowserListener *listener)
| Removes a listener.
void | sendSelectionChangeMessage ()
void | sendDoubleClickMessage (const File &)
void | sendMouseClickMessage (const File &, const MouseEvent &)

## Public Attributes

DirectoryContentsList & | directoryContentsList
| The list that this component is displaying.

## Protected Attributes

ListenerList< FileBrowserListener > | listeners

## Member Enums

## ColourIds

enum juce::DirectoryContentsDisplayComponent::ColourIds

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

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
highlightColourId | The colour to use to fill a highlighted row of the list.
textColourId | The colour for the text.
highlightedTextColourId | The colour with which to draw the text in highlighted sections.

## Constructors and Destructors

## DirectoryContentsDisplayComponent()

juce::DirectoryContentsDisplayComponent::DirectoryContentsDisplayComponent | ( | DirectoryContentsList & | listToShow | ) |

Creates a DirectoryContentsDisplayComponent for a given list of files.

## ~DirectoryContentsDisplayComponent()

virtual juce::DirectoryContentsDisplayComponent::~DirectoryContentsDisplayComponent | ( |  | ) |

virtual

Destructor.

## Member Functions

## getNumSelectedFiles()

virtual int juce::DirectoryContentsDisplayComponent::getNumSelectedFiles | ( |  | ) | const

pure virtual

Returns the number of files the user has got selected.

See also
  getSelectedFile

Implemented in juce::FileListComponent, and juce::FileTreeComponent.

## getSelectedFile()

virtual File juce::DirectoryContentsDisplayComponent::getSelectedFile | ( | int | index | ) | const

pure 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

Implemented in juce::FileListComponent, and juce::FileTreeComponent.

## deselectAllFiles()

virtual void juce::DirectoryContentsDisplayComponent::deselectAllFiles | ( |  | ) |

pure virtual

Deselects any selected files.

Implemented in juce::FileListComponent, and juce::FileTreeComponent.

## scrollToTop()

virtual void juce::DirectoryContentsDisplayComponent::scrollToTop | ( |  | ) |

pure virtual

Scrolls this view to the top.

Implemented in juce::FileListComponent, and juce::FileTreeComponent.

## setSelectedFile()

virtual void juce::DirectoryContentsDisplayComponent::setSelectedFile | ( | const File & |  | ) |

pure 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).

Implemented in juce::FileListComponent, and juce::FileTreeComponent.

## addListener()

void juce::DirectoryContentsDisplayComponent::addListener | ( | FileBrowserListener * | listener | ) |

Adds a listener to be told when files are selected or clicked.

See also
  removeListener

## removeListener()

void juce::DirectoryContentsDisplayComponent::removeListener | ( | FileBrowserListener * | listener | ) |

Removes a listener.

See also
  addListener

## sendSelectionChangeMessage()

void juce::DirectoryContentsDisplayComponent::sendSelectionChangeMessage | ( |  | ) |

## sendDoubleClickMessage()

void juce::DirectoryContentsDisplayComponent::sendDoubleClickMessage | ( | const File & |  | ) |

## sendMouseClickMessage()

void juce::DirectoryContentsDisplayComponent::sendMouseClickMessage | ( | const File & | ,
|  | const MouseEvent & | )

## Member Data Documentation

## directoryContentsList

DirectoryContentsList& juce::DirectoryContentsDisplayComponent::directoryContentsList

The list that this component is displaying.

## listeners

ListenerList<FileBrowserListener> juce::DirectoryContentsDisplayComponent::listeners

protected

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited