LMMS
Loading...
Searching...
No Matches
juce::FileBrowserComponent Class Reference

#include <juce_FileBrowserComponent.h>

Inheritance diagram for juce::FileBrowserComponent:
juce::Component juce::FileBrowserListener juce::FileFilter juce::Timer juce::MouseListener

Classes

struct  LookAndFeelMethods

Public Types

enum  FileChooserFlags {
  openMode = 1 , saveMode = 2 , canSelectFiles = 4 , canSelectDirectories = 8 ,
  canSelectMultipleItems = 16 , useTreeView = 32 , filenameBoxIsReadOnly = 64 , warnAboutOverwriting = 128 ,
  doNotClearFileNameOnRootChange = 256
}
enum  ColourIds {
  currentPathBoxBackgroundColourId = 0x1000640 , currentPathBoxTextColourId = 0x1000641 , currentPathBoxArrowColourId = 0x1000642 , filenameBoxBackgroundColourId = 0x1000643 ,
  filenameBoxTextColourId = 0x1000644
}
Public Types inherited from juce::Component
enum class  FocusContainerType { none , focusContainer , keyboardFocusContainer }
enum  FocusChangeType { focusChangedByMouseClick , focusChangedByTabKey , focusChangedDirectly }

Public Member Functions

 FileBrowserComponent (int flags, const File &initialFileOrDirectory, const FileFilter *fileFilter, FilePreviewComponent *previewComp)
 ~FileBrowserComponent () override
int getNumSelectedFiles () const noexcept
File getSelectedFile (int index) const noexcept
void deselectAllFiles ()
bool currentFileIsValid () const
File getHighlightedFile () const noexcept
const FilegetRoot () const
void setRoot (const File &newRootDirectory)
void setFileName (const String &newName)
void goUp ()
void refresh ()
void setFileFilter (const FileFilter *newFileFilter)
virtual String getActionVerb () const
bool isSaveMode () const noexcept
void setFilenameBoxLabel (const String &name)
void addListener (FileBrowserListener *listener)
void removeListener (FileBrowserListener *listener)
void resized () override
void lookAndFeelChanged () override
bool keyPressed (const KeyPress &) override
void selectionChanged () override
void fileClicked (const File &, const MouseEvent &) override
void fileDoubleClicked (const File &) override
void browserRootChanged (const File &) override
bool isFileSuitable (const File &) const override
bool isDirectorySuitable (const File &) const override
FilePreviewComponentgetPreviewComponent () const noexcept
DirectoryContentsDisplayComponentgetDisplayComponent () const noexcept
Public Member Functions inherited from juce::Component
 Component () noexcept
 ~Component () override
 Component (const String &componentName) noexcept
String getName () const noexcept
virtual void setName (const String &newName)
String getComponentID () const noexcept
void setComponentID (const String &newID)
virtual void setVisible (bool shouldBeVisible)
bool isVisible () const noexcept
virtual void visibilityChanged ()
bool isShowing () const
virtual void addToDesktop (int windowStyleFlags, void *nativeWindowToAttachTo=nullptr)
void removeFromDesktop ()
bool isOnDesktop () const noexcept
ComponentPeergetPeer () const
virtual void userTriedToCloseWindow ()
virtual void minimisationStateChanged (bool isNowMinimised)
virtual float getDesktopScaleFactor () const
void toFront (bool shouldAlsoGainKeyboardFocus)
void toBack ()
void toBehind (Component *other)
void setAlwaysOnTop (bool shouldStayOnTop)
bool isAlwaysOnTop () const noexcept
int getX () const noexcept
int getY () const noexcept
int getWidth () const noexcept
int getHeight () const noexcept
int getRight () const noexcept
Point< intgetPosition () const noexcept
int getBottom () const noexcept
Rectangle< intgetBounds () const noexcept
Rectangle< intgetLocalBounds () const noexcept
Rectangle< intgetBoundsInParent () const noexcept
int getScreenX () const
int getScreenY () const
Point< intgetScreenPosition () const
Rectangle< intgetScreenBounds () const
Point< intgetLocalPoint (const Component *sourceComponent, Point< int > pointRelativeToSourceComponent) const
Point< float > getLocalPoint (const Component *sourceComponent, Point< float > pointRelativeToSourceComponent) const
Rectangle< intgetLocalArea (const Component *sourceComponent, Rectangle< int > areaRelativeToSourceComponent) const
Rectangle< float > getLocalArea (const Component *sourceComponent, Rectangle< float > areaRelativeToSourceComponent) const
Point< intlocalPointToGlobal (Point< int > localPoint) const
Point< float > localPointToGlobal (Point< float > localPoint) const
Rectangle< intlocalAreaToGlobal (Rectangle< int > localArea) const
Rectangle< float > localAreaToGlobal (Rectangle< float > localArea) const
void setTopLeftPosition (int x, int y)
void setTopLeftPosition (Point< int > newTopLeftPosition)
void setTopRightPosition (int x, int y)
void setSize (int newWidth, int newHeight)
void setBounds (int x, int y, int width, int height)
void setBounds (Rectangle< int > newBounds)
void setBoundsRelative (float proportionalX, float proportionalY, float proportionalWidth, float proportionalHeight)
void setBoundsRelative (Rectangle< float > proportionalArea)
void setBoundsInset (BorderSize< int > borders)
void setBoundsToFit (Rectangle< int > targetArea, Justification justification, bool onlyReduceInSize)
void setCentrePosition (int x, int y)
void setCentrePosition (Point< int > newCentrePosition)
void setCentreRelative (float x, float y)
void centreWithSize (int width, int height)
void setTransform (const AffineTransform &transform)
AffineTransform getTransform () const
bool isTransformed () const noexcept
int proportionOfWidth (float proportion) const noexcept
int proportionOfHeight (float proportion) const noexcept
int getParentWidth () const noexcept
int getParentHeight () const noexcept
Rectangle< intgetParentMonitorArea () const
int getNumChildComponents () const noexcept
ComponentgetChildComponent (int index) const noexcept
int getIndexOfChildComponent (const Component *child) const noexcept
const Array< Component * > & getChildren () const noexcept
ComponentfindChildWithID (StringRef componentID) const noexcept
void addChildComponent (Component *child, int zOrder=-1)
void addChildComponent (Component &child, int zOrder=-1)
void addAndMakeVisible (Component *child, int zOrder=-1)
void addAndMakeVisible (Component &child, int zOrder=-1)
void addChildAndSetID (Component *child, const String &componentID)
void removeChildComponent (Component *childToRemove)
ComponentremoveChildComponent (int childIndexToRemove)
void removeAllChildren ()
void deleteAllChildren ()
ComponentgetParentComponent () const noexcept
template<class TargetClass>
TargetClass * findParentComponentOfClass () const
ComponentgetTopLevelComponent () const noexcept
bool isParentOf (const Component *possibleChild) const noexcept
virtual void parentHierarchyChanged ()
virtual void childrenChanged ()
virtual bool hitTest (int x, int y)
void setInterceptsMouseClicks (bool allowClicksOnThisComponent, bool allowClicksOnChildComponents) noexcept
void getInterceptsMouseClicks (bool &allowsClicksOnThisComponent, bool &allowsClicksOnChildComponents) const noexcept
bool contains (Point< int > localPoint)
bool contains (Point< float > localPoint)
bool reallyContains (Point< int > localPoint, bool returnTrueIfWithinAChild)
bool reallyContains (Point< float > localPoint, bool returnTrueIfWithinAChild)
ComponentgetComponentAt (int x, int y)
ComponentgetComponentAt (Point< int > position)
ComponentgetComponentAt (Point< float > position)
void repaint ()
void repaint (int x, int y, int width, int height)
void repaint (Rectangle< int > area)
void setBufferedToImage (bool shouldBeBuffered)
Image createComponentSnapshot (Rectangle< int > areaToGrab, bool clipImageToComponentBounds=true, float scaleFactor=1.0f)
void paintEntireComponent (Graphics &context, bool ignoreAlphaLevel)
void setPaintingIsUnclipped (bool shouldPaintWithoutClipping) noexcept
bool isPaintingUnclipped () const noexcept
void setComponentEffect (ImageEffectFilter *newEffect)
ImageEffectFiltergetComponentEffect () const noexcept
LookAndFeelgetLookAndFeel () const noexcept
void setLookAndFeel (LookAndFeel *newLookAndFeel)
void sendLookAndFeelChange ()
void setOpaque (bool shouldBeOpaque)
bool isOpaque () const noexcept
void setBroughtToFrontOnMouseClick (bool shouldBeBroughtToFront) noexcept
bool isBroughtToFrontOnMouseClick () const noexcept
void setExplicitFocusOrder (int newFocusOrderIndex)
int getExplicitFocusOrder () const
void setFocusContainerType (FocusContainerType containerType) noexcept
bool isFocusContainer () const noexcept
bool isKeyboardFocusContainer () const noexcept
ComponentfindFocusContainer () const
ComponentfindKeyboardFocusContainer () const
void setWantsKeyboardFocus (bool wantsFocus) noexcept
bool getWantsKeyboardFocus () const noexcept
void setMouseClickGrabsKeyboardFocus (bool shouldGrabFocus)
bool getMouseClickGrabsKeyboardFocus () const noexcept
void grabKeyboardFocus ()
void giveAwayKeyboardFocus ()
bool hasKeyboardFocus (bool trueIfChildIsFocused) const
void moveKeyboardFocusToSibling (bool moveToNext)
virtual std::unique_ptr< ComponentTraversercreateFocusTraverser ()
virtual std::unique_ptr< ComponentTraversercreateKeyboardFocusTraverser ()
void setHasFocusOutline (bool hasFocusOutline) noexcept
bool hasFocusOutline () const noexcept
bool isEnabled () const noexcept
void setEnabled (bool shouldBeEnabled)
virtual void enablementChanged ()
float getAlpha () const noexcept
void setAlpha (float newAlpha)
virtual void alphaChanged ()
void setMouseCursor (const MouseCursor &cursorType)
virtual MouseCursor getMouseCursor ()
void updateMouseCursor () const
virtual void paint (Graphics &g)
virtual void paintOverChildren (Graphics &g)
void mouseMove (const MouseEvent &event) override
void mouseEnter (const MouseEvent &event) override
void mouseExit (const MouseEvent &event) override
void mouseDown (const MouseEvent &event) override
void mouseDrag (const MouseEvent &event) override
void mouseUp (const MouseEvent &event) override
void mouseDoubleClick (const MouseEvent &event) override
void mouseWheelMove (const MouseEvent &event, const MouseWheelDetails &wheel) override
void mouseMagnify (const MouseEvent &event, float scaleFactor) override
void setRepaintsOnMouseActivity (bool shouldRepaint) noexcept
void addMouseListener (MouseListener *newListener, bool wantsEventsForAllNestedChildComponents)
void removeMouseListener (MouseListener *listenerToRemove)
void addKeyListener (KeyListener *newListener)
void removeKeyListener (KeyListener *listenerToRemove)
virtual bool keyStateChanged (bool isKeyDown)
virtual void modifierKeysChanged (const ModifierKeys &modifiers)
virtual void focusGained (FocusChangeType cause)
virtual void focusLost (FocusChangeType cause)
virtual void focusOfChildComponentChanged (FocusChangeType cause)
bool isMouseOver (bool includeChildren=false) const
bool isMouseButtonDown (bool includeChildren=false) const
bool isMouseOverOrDragging (bool includeChildren=false) const
Point< intgetMouseXYRelative () const
virtual void moved ()
virtual void childBoundsChanged (Component *child)
virtual void parentSizeChanged ()
virtual void broughtToFront ()
void addComponentListener (ComponentListener *newListener)
void removeComponentListener (ComponentListener *listenerToRemove)
void postCommandMessage (int commandId)
virtual void handleCommandMessage (int commandId)
void enterModalState (bool takeKeyboardFocus=true, ModalComponentManager::Callback *callback=nullptr, bool deleteWhenDismissed=false)
void exitModalState (int returnValue)
bool isCurrentlyModal (bool onlyConsiderForemostModalComponent=true) const noexcept
bool isCurrentlyBlockedByAnotherModalComponent () const
virtual bool canModalEventBeSentToComponent (const Component *targetComponent)
virtual void inputAttemptWhenModal ()
NamedValueSetgetProperties () noexcept
const NamedValueSetgetProperties () const noexcept
Colour findColour (int colourID, bool inheritFromParent=false) const
void setColour (int colourID, Colour newColour)
void removeColour (int colourID)
bool isColourSpecified (int colourID) const
void copyAllExplicitColoursTo (Component &target) const
virtual void colourChanged ()
voidgetWindowHandle () const
PositionergetPositioner () const noexcept
void setPositioner (Positioner *newPositioner)
void setCachedComponentImage (CachedComponentImage *newCachedImage)
CachedComponentImagegetCachedComponentImage () const noexcept
void setViewportIgnoreDragFlag (bool ignoreDrag) noexcept
bool getViewportIgnoreDragFlag () const noexcept
String getTitle () const noexcept
void setTitle (const String &newTitle)
String getDescription () const noexcept
void setDescription (const String &newDescription)
String getHelpText () const noexcept
void setHelpText (const String &newHelpText)
void setAccessible (bool shouldBeAccessible)
bool isAccessible () const noexcept
AccessibilityHandlergetAccessibilityHandler ()
void invalidateAccessibilityHandler ()
void setFocusContainer (bool shouldBeFocusContainer) noexcept
void contains (int, int)=delete
Public Member Functions inherited from juce::MouseListener
virtual ~MouseListener ()=default

Static Public Member Functions

static void getDefaultRoots (StringArray &rootNames, StringArray &rootPaths)
Static Public Member Functions inherited from juce::Component
static float JUCE_CALLTYPE getApproximateScaleFactorForComponent (const Component *targetComponent)
static Component *JUCE_CALLTYPE getCurrentlyFocusedComponent () noexcept
static void JUCE_CALLTYPE unfocusAllComponents ()
static void JUCE_CALLTYPE beginDragAutoRepeat (int millisecondsBetweenCallbacks)
static bool JUCE_CALLTYPE isMouseButtonDownAnywhere () noexcept
static int JUCE_CALLTYPE getNumCurrentlyModalComponents () noexcept
static Component *JUCE_CALLTYPE getCurrentlyModalComponent (int index=0) noexcept

Protected Member Functions

virtual void getRoots (StringArray &rootNames, StringArray &rootPaths)
void resetRecentPaths ()
Protected Member Functions inherited from juce::Component
virtual ComponentPeercreateNewPeer (int styleFlags, void *nativeWindowToAttachTo)

Private Member Functions

std::unique_ptr< AccessibilityHandlercreateAccessibilityHandler () override
void timerCallback () override
void sendListenerChangeMessage ()
bool isFileOrDirSuitable (const File &) const
void updateSelectedPath ()
void changeFilename ()
Private Member Functions inherited from juce::FileBrowserListener
virtual ~FileBrowserListener ()
Private Member Functions inherited from juce::FileFilter
 FileFilter (const String &filterDescription)
virtual ~FileFilter ()
const StringgetDescription () const noexcept
Private Member Functions inherited from juce::Timer
virtual ~Timer ()
void startTimer (int intervalInMilliseconds) noexcept
void startTimerHz (int timerFrequencyHz) noexcept
void stopTimer () noexcept
bool isTimerRunning () const noexcept
int getTimerInterval () const noexcept
 Timer () noexcept
 Timer (const Timer &) noexcept

Private Attributes

std::unique_ptr< DirectoryContentsListfileList
const FileFilterfileFilter
int flags
File currentRoot
Array< FilechosenFiles
ListenerList< FileBrowserListenerlisteners
std::unique_ptr< DirectoryContentsDisplayComponentfileListComponent
FilePreviewComponentpreviewComp
ComboBox currentPathBox
TextEditor filenameBox
Label fileLabel
std::unique_ptr< ButtongoUpButton
TimeSliceThread thread
bool wasProcessActive
Private Attributes inherited from juce::FileFilter
String description

Additional Inherited Members

Static Protected Member Functions inherited from juce::Component
static std::unique_ptr< AccessibilityHandlercreateIgnoredAccessibilityHandler (Component &)
Static Private Member Functions inherited from juce::Timer
static void JUCE_CALLTYPE callAfterDelay (int milliseconds, std::function< void()> functionToCall)
static void JUCE_CALLTYPE callPendingTimersSynchronously ()

Detailed Description

A component for browsing and selecting a file or directory to open or save.

This contains a FileListComponent and adds various boxes and controls for navigating and selecting a file. It can work in different modes so that it can be used for loading or saving a file, or for choosing a directory.

See also
FileChooserDialogBox, FileChooser, FileListComponent

@tags{GUI}

Member Enumeration Documentation

◆ ColourIds

enum juce::FileBrowserComponent::ColourIds

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

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
currentPathBoxBackgroundColourId 

The colour to use to fill the background of the current path ComboBox.

currentPathBoxTextColourId 

The colour to use for the text of the current path ComboBox.

currentPathBoxArrowColourId 

The colour to use to draw the arrow of the current path ComboBox.

filenameBoxBackgroundColourId 

The colour to use to fill the background of the filename TextEditor.

filenameBoxTextColourId 

The colour to use for the text of the filename TextEditor.

◆ FileChooserFlags

enum juce::FileBrowserComponent::FileChooserFlags

Various options for the browser.

A combination of these is passed into the FileBrowserComponent constructor.

Enumerator
openMode 

specifies that the component should allow the user to choose an existing file with the intention of opening it.

saveMode 

specifies that the component should allow the user to specify the name of a file that will be used to save something.

canSelectFiles 

specifies that the user can select files (can be used in conjunction with canSelectDirectories).

canSelectDirectories 

specifies that the user can select directories (can be used in conjunction with canSelectFiles).

canSelectMultipleItems 

specifies that the user can select multiple items.

useTreeView 

specifies that a tree-view should be shown instead of a file list.

filenameBoxIsReadOnly 

specifies that the user can't type directly into the filename box.

warnAboutOverwriting 

specifies that the dialog should warn about overwriting existing files (if possible).

doNotClearFileNameOnRootChange 

specifies that the file name should not be cleared upon root change.

Constructor & Destructor Documentation

◆ FileBrowserComponent()

juce::FileBrowserComponent::FileBrowserComponent ( int flags,
const File & initialFileOrDirectory,
const FileFilter * fileFilter,
FilePreviewComponent * previewComp )

Creates a FileBrowserComponent.

Parameters
flagsA combination of flags from the FileChooserFlags enumeration, used to specify the component's behaviour. The flags must contain either openMode or saveMode, and canSelectFiles and/or canSelectDirectories.
initialFileOrDirectoryThe file or directory that should be selected when the component begins. If this is File(), a default directory will be chosen.
fileFilteran optional filter to use to determine which files are shown. If this is nullptr then all files are displayed. Note that a pointer is kept internally to this object, so make sure that it is not deleted before the FileBrowserComponent object is deleted.
previewCompan optional preview component that will be used to show previews of files that the user selects

◆ ~FileBrowserComponent()

juce::FileBrowserComponent::~FileBrowserComponent ( )
override

Destructor.

Member Function Documentation

◆ addListener()

void juce::FileBrowserComponent::addListener ( FileBrowserListener * listener)

Adds a listener to be told when the user selects and clicks on files.

See also
removeListener

◆ browserRootChanged()

void juce::FileBrowserComponent::browserRootChanged ( const File & newRoot)
overridevirtual

Callback when the browser's root folder changes.

Implements juce::FileBrowserListener.

◆ changeFilename()

void juce::FileBrowserComponent::changeFilename ( )
private

◆ createAccessibilityHandler()

std::unique_ptr< AccessibilityHandler > juce::FileBrowserComponent::createAccessibilityHandler ( )
overrideprivatevirtual

Override this method to return a custom AccessibilityHandler for this component.

The default implementation creates and returns a AccessibilityHandler object with an unspecified role, meaning that it will be visible to accessibility clients but without a specific role, action callbacks or interfaces. To control how accessibility clients see and interact with your component subclass AccessibilityHandler, implement the desired behaviours, and return an instance of it from this method in your component subclass.

The accessibility handler you return here is guaranteed to be destroyed before its Component, so it's safe to store and use a reference back to the Component inside the AccessibilityHandler if necessary.

See also
getAccessibilityHandler

Reimplemented from juce::Component.

◆ currentFileIsValid()

bool juce::FileBrowserComponent::currentFileIsValid ( ) const

Returns true if the currently selected file(s) are usable.

This can be used to decide whether the user can press "ok" for the current file. What it does depends on the mode, so for example in an "open" mode, this only returns true if a file has been selected and if it exists. In a "save" mode, a non-existent file would also be valid.

◆ deselectAllFiles()

void juce::FileBrowserComponent::deselectAllFiles ( )

Deselects any files that are currently selected.

◆ fileClicked()

void juce::FileBrowserComponent::fileClicked ( const File & file,
const MouseEvent & e )
overridevirtual

Callback when the user clicks on a file in the browser.

Implements juce::FileBrowserListener.

◆ fileDoubleClicked()

void juce::FileBrowserComponent::fileDoubleClicked ( const File & file)
overridevirtual

Callback when the user double-clicks on a file in the browser.

Implements juce::FileBrowserListener.

◆ getActionVerb()

String juce::FileBrowserComponent::getActionVerb ( ) const
virtual

Returns a verb to describe what should happen when the file is accepted.

E.g. if browsing in "load file" mode, this will be "Open", if in "save file" mode, it'll be "Save", etc.

◆ getDefaultRoots()

void juce::FileBrowserComponent::getDefaultRoots ( StringArray & rootNames,
StringArray & rootPaths )
static

Returns a platform-specific list of names and paths for some suggested places the user might want to use as root folders. The list returned contains empty strings to indicate section breaks.

See also
getRoots()

◆ getDisplayComponent()

DirectoryContentsDisplayComponent * juce::FileBrowserComponent::getDisplayComponent ( ) const
noexcept

◆ getHighlightedFile()

File juce::FileBrowserComponent::getHighlightedFile ( ) const
noexcept

This returns the last item in the view that the user has highlighted. This may be different from getCurrentFile(), which returns the value that is shown in the filename box, and if there are multiple selections, this will only return one of them.

See also
getSelectedFile

◆ getNumSelectedFiles()

int juce::FileBrowserComponent::getNumSelectedFiles ( ) const
noexcept

Returns the number of files that the user has got selected. If multiple select isn't active, this will only be 0 or 1. To get the complete list of files they've chosen, pass an index to getCurrentFile().

◆ getPreviewComponent()

FilePreviewComponent * juce::FileBrowserComponent::getPreviewComponent ( ) const
noexcept

◆ getRoot()

const File & juce::FileBrowserComponent::getRoot ( ) const

Returns the directory whose contents are currently being shown in the listbox.

◆ getRoots()

void juce::FileBrowserComponent::getRoots ( StringArray & rootNames,
StringArray & rootPaths )
protectedvirtual

Returns a list of names and paths for the default places the user might want to look.

By default this just calls getDefaultRoots(), but you may want to override it to return a custom list.

◆ getSelectedFile()

File juce::FileBrowserComponent::getSelectedFile ( int index) const
noexcept

Returns one of the files that the user has chosen. If the box has multi-select enabled, the index lets you specify which of the files to get - see getNumSelectedFiles() to find out how many files were chosen.

See also
getHighlightedFile

◆ goUp()

void juce::FileBrowserComponent::goUp ( )

Equivalent to pressing the "up" button to browse the parent directory.

◆ isDirectorySuitable()

bool juce::FileBrowserComponent::isDirectorySuitable ( const File & file) const
overridevirtual

Should return true if this directory is suitable for inclusion in whatever context the object is being used.

Implements juce::FileFilter.

◆ isFileOrDirSuitable()

bool juce::FileBrowserComponent::isFileOrDirSuitable ( const File & f) const
private

◆ isFileSuitable()

bool juce::FileBrowserComponent::isFileSuitable ( const File & file) const
overridevirtual

Should return true if this file is suitable for inclusion in whatever context the object is being used.

Implements juce::FileFilter.

◆ isSaveMode()

bool juce::FileBrowserComponent::isSaveMode ( ) const
noexcept

Returns true if the saveMode flag was set when this component was created.

◆ keyPressed()

bool juce::FileBrowserComponent::keyPressed ( const KeyPress & key)
overridevirtual

Called when a key is pressed.

When a key is pressed, the component that has the keyboard focus will have this method called. Remember that a component will only be given the focus if its setWantsKeyboardFocus() method has been used to enable this.

If your implementation returns true, the event will be consumed and not passed on to any other listeners. If it returns false, the key will be passed to any KeyListeners that have been registered with this component. As soon as one of these returns true, the process will stop, but if they all return false, the event will be passed upwards to this component's parent, and so on.

The default implementation of this method does nothing and returns false.

See also
keyStateChanged, getCurrentlyFocusedComponent, addKeyListener

Reimplemented from juce::Component.

◆ lookAndFeelChanged()

void juce::FileBrowserComponent::lookAndFeelChanged ( )
overridevirtual

Called to let the component react to a change in the look-and-feel setting.

When the look-and-feel is changed for a component, this will be called in all its child components, recursively.

It can also be triggered manually by the sendLookAndFeelChange() method, in case an application uses a LookAndFeel class that might have changed internally.

See also
sendLookAndFeelChange, getLookAndFeel

Reimplemented from juce::Component.

◆ refresh()

void juce::FileBrowserComponent::refresh ( )

Refreshes the directory that's currently being listed.

◆ removeListener()

void juce::FileBrowserComponent::removeListener ( FileBrowserListener * listener)

Removes a listener.

See also
addListener

◆ resetRecentPaths()

void juce::FileBrowserComponent::resetRecentPaths ( )
protected

Updates the items in the dropdown list of recent paths with the values from getRoots().

◆ resized()

void juce::FileBrowserComponent::resized ( )
overridevirtual

Called when this component's size has been changed.

A component can implement this method to do things such as laying out its child components when its width or height changes.

The method is called synchronously as a result of the setBounds or setSize methods, so repeatedly changing a components size will repeatedly call its resized method (unlike things like repainting, where multiple calls to repaint are coalesced together).

If the component is a top-level window on the desktop, its size could also be changed by operating-system factors beyond the application's control.

See also
moved, setSize

Reimplemented from juce::Component.

◆ selectionChanged()

void juce::FileBrowserComponent::selectionChanged ( )
overridevirtual

Callback when the user selects a different file in the browser.

Implements juce::FileBrowserListener.

◆ sendListenerChangeMessage()

void juce::FileBrowserComponent::sendListenerChangeMessage ( )
private

◆ setFileFilter()

void juce::FileBrowserComponent::setFileFilter ( const FileFilter * newFileFilter)

Changes the filter that's being used to sift the files.

◆ setFileName()

void juce::FileBrowserComponent::setFileName ( const String & newName)

Changes the name that is currently shown in the filename box.

◆ setFilenameBoxLabel()

void juce::FileBrowserComponent::setFilenameBoxLabel ( const String & name)

Sets the label that will be displayed next to the filename entry box. By default this is just "file", but you might want to change it to something more appropriate for your app.

◆ setRoot()

void juce::FileBrowserComponent::setRoot ( const File & newRootDirectory)

Changes the directory that's being shown in the listbox.

◆ timerCallback()

void juce::FileBrowserComponent::timerCallback ( )
overrideprivatevirtual

The user-defined callback routine that actually gets called periodically.

It's perfectly ok to call startTimer() or stopTimer() from within this callback to change the subsequent intervals.

Implements juce::Timer.

◆ updateSelectedPath()

void juce::FileBrowserComponent::updateSelectedPath ( )
private

Member Data Documentation

◆ chosenFiles

Array<File> juce::FileBrowserComponent::chosenFiles
private

◆ currentPathBox

ComboBox juce::FileBrowserComponent::currentPathBox
private

◆ currentRoot

File juce::FileBrowserComponent::currentRoot
private

◆ fileFilter

const FileFilter* juce::FileBrowserComponent::fileFilter
private

◆ fileLabel

Label juce::FileBrowserComponent::fileLabel
private

◆ fileList

std::unique_ptr<DirectoryContentsList> juce::FileBrowserComponent::fileList
private

◆ fileListComponent

std::unique_ptr<DirectoryContentsDisplayComponent> juce::FileBrowserComponent::fileListComponent
private

◆ filenameBox

TextEditor juce::FileBrowserComponent::filenameBox
private

◆ flags

int juce::FileBrowserComponent::flags
private

◆ goUpButton

std::unique_ptr<Button> juce::FileBrowserComponent::goUpButton
private

◆ listeners

ListenerList<FileBrowserListener> juce::FileBrowserComponent::listeners
private

◆ previewComp

FilePreviewComponent* juce::FileBrowserComponent::previewComp
private

◆ thread

TimeSliceThread juce::FileBrowserComponent::thread
private

◆ wasProcessActive

bool juce::FileBrowserComponent::wasProcessActive
private

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