From dad610b948672eeafeed76f132aeebb06f55139b Mon Sep 17 00:00:00 2001 From: Julian Storer Date: Mon, 9 Nov 2009 11:21:18 +0000 Subject: [PATCH] Added a getHighlightedFile method to the FileBrowserComponent --- .../filebrowser/juce_FileBrowserComponent.cpp | 5 +++++ .../components/filebrowser/juce_FileBrowserComponent.h | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/gui/components/filebrowser/juce_FileBrowserComponent.cpp b/src/gui/components/filebrowser/juce_FileBrowserComponent.cpp index e44045ae40..51a32cd11c 100644 --- a/src/gui/components/filebrowser/juce_FileBrowserComponent.cpp +++ b/src/gui/components/filebrowser/juce_FileBrowserComponent.cpp @@ -185,6 +185,11 @@ bool FileBrowserComponent::currentFileIsValid() const return false; } +const File FileBrowserComponent::getHighlightedFile() const throw() +{ + return fileListComponent->getSelectedFile(); +} + //============================================================================== const File FileBrowserComponent::getRoot() const { diff --git a/src/gui/components/filebrowser/juce_FileBrowserComponent.h b/src/gui/components/filebrowser/juce_FileBrowserComponent.h index afda6587b0..771f7024a8 100644 --- a/src/gui/components/filebrowser/juce_FileBrowserComponent.h +++ b/src/gui/components/filebrowser/juce_FileBrowserComponent.h @@ -99,7 +99,8 @@ public: ~FileBrowserComponent(); //============================================================================== - /** + /** Returns the file that the user has currently chosen. + @see getHighlightedFile */ const File getCurrentFile() const throw(); @@ -112,6 +113,13 @@ public: */ bool currentFileIsValid() const; + /** This returns the item in the view that is currently highlighted. + This may be different from getCurrentFile(), which returns the value + that is shown in the filename box. + @see getCurrentFile + */ + const File getHighlightedFile() const throw(); + //============================================================================== /** Returns the directory whose contents are currently being shown in the listbox. */ const File getRoot() const;