36 directoryContentsList.addChangeListener (
this);
72 fileWaitingToBeSelected =
File();
82 fileWaitingToBeSelected = f;
92 fileWaitingToBeSelected =
File();
97 if (fileWaitingToBeSelected != File())
109 : owner (
fc), thread (t)
123 &icon, fileSize, modTime,
124 isDirectory, highlighted,
131 owner.sendMouseClickMessage (file, e);
136 owner.sendDoubleClickMessage (file);
174 if (file != File() && icon.
isNull() && ! isDirectory)
196 return owner.getTooltipForRow (index);
207 bool highlighted =
false, isDirectory =
false;
218 auto hashCode = (file.
getFullPathName() +
"_iconCacheSalt").hashCode();
223 im = detail::WindowingHelpers::createIconForFile (file);
241int FileListComponent::getNumRows()
246String FileListComponent::getNameForRow (
int rowNumber)
251void FileListComponent::paintListBoxItem (
int, Graphics&,
int,
int,
bool)
264 DirectoryContentsList::FileInfo
fileInfo;
272void FileListComponent::selectedRowsChanged (
int )
274 sendSelectionChangeMessage();
277void FileListComponent::deleteKeyPressed (
int )
Has a callback method that is triggered asynchronously.
void triggerAsyncUpdate()
Causes the callback to be triggered at a later time.
Holds a list of ChangeListeners, and sends messages to them when instructed.
void removeChangeListener(ChangeListener *listener)
Unregisters a listener from the list.
The base class for all JUCE user-interface objects.
int getHeight() const noexcept
Returns the component's height in pixels.
void repaint()
Marks the whole component as needing to be redrawn.
int getWidth() const noexcept
Returns the component's width in pixels.
LookAndFeel & getLookAndFeel() const noexcept
Finds the appropriate look-and-feel to use for this component.
A base class for components that display a list of the files in a directory.
DirectoryContentsList & directoryContentsList
The list that this component is displaying.
A class to asynchronously scan for details about the files in a directory.
const File & getDirectory() const noexcept
Returns the directory that's currently being used.
bool getFileInfo(int index, FileInfo &resultInfo) const
Returns the cached information about one of the files in the list.
bool isStillLoading() const
True if the background thread hasn't yet finished scanning for files.
int getNumFiles() const noexcept
Returns the number of files currently available in the list.
File getFile(int index) const
Returns one of the files in the list.
Contains cached information about one of the files in a DirectoryContentsList.
int useTimeSlice() override
Called back by a TimeSliceThread.
void mouseDoubleClick(const MouseEvent &) override
Called when a mouse button has been double-clicked on a component.
String getTooltip() override
Returns the string that this object wants to show as its tooltip.
void handleAsyncUpdate() override
Called back to do whatever your class needs to do.
void mouseDown(const MouseEvent &e) override
Called when a mouse button is pressed.
void paint(Graphics &g) override
Components can override this method to draw their content.
A component that displays the files in a directory as a listbox.
FileListComponent(DirectoryContentsList &listToShow)
Creates a listbox to show the contents of a specified directory.
void deselectAllFiles() override
Deselects any files that are currently selected.
void setSelectedFile(const File &) override
If the specified file is in the list, it will become the only selected item (and if the file isn't in...
~FileListComponent() override
Destructor.
void scrollToTop() override
Scrolls to the top of the list.
File getSelectedFile(int index=0) const override
Returns one of the files that the user has currently selected.
int getNumSelectedFiles() const override
Returns the number of files the user has got selected.
Represents a local file or directory.
const String & getFullPathName() const noexcept
Returns the complete, absolute path of this file.
String getFileName() const
Returns the last section of the pathname.
File getChildFile(StringRef relativeOrAbsolutePath) const
Returns a file that represents a relative (or absolute) sub-path of the current one.
static String descriptionOfSizeInBytes(int64 bytes)
Utility function to convert a file size in bytes to a neat string description.
A graphics context, used for drawing a component or image.
static void addImageToCache(const Image &image, int64 hashCode)
Adds an image to the cache with a user-defined hash-code.
static Image getFromHashCode(int64 hashCode)
Checks the cache for an image with a particular hashcode.
Holds a fixed-size bitmap.
bool isNull() const noexcept
Returns true if this image is not valid.
bool isValid() const noexcept
Returns true if this image isn't null.
A list of items that can be scrolled vertically.
void deselectAllRows()
Deselects any currently selected rows.
int getSelectedRow(int index=0) const
Returns the row number of a selected row.
ScrollBar & getVerticalScrollBar() const noexcept
Returns a reference to the vertical scrollbar.
void updateContent()
Causes the list to refresh its content.
int getNumSelectedRows() const
Returns the number of rows that are currently selected.
void selectRow(int rowNumber, bool dontScrollToShowThisRow=false, bool deselectOthersFirst=true)
Selects a row.
void selectRowsBasedOnModifierKeys(int rowThatWasClickedOn, ModifierKeys modifiers, bool isMouseUpEvent)
Multiply-selects rows based on the modifier keys.
Contains position and status information about a mouse event.
const ModifierKeys mods
The key modifiers associated with the event.
Used by the TimeSliceThread class.
A thread that keeps a list of clients, and calls each one in turn, giving them all a chance to run so...
void removeTimeSliceClient(TimeSliceClient *clientToRemove)
Removes a client from the list.
void addTimeSliceClient(TimeSliceClient *clientToAdd, int millisecondsBeforeStarting=0)
Adds a client to the list.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...