Browse Source

tags/2021-05-28
jules 18 years ago
parent
commit
579cf060b0
2 changed files with 22 additions and 3 deletions
  1. +9
    -3
      src/juce_appframework/gui/components/filebrowser/juce_FileTreeComponent.cpp
  2. +13
    -0
      src/juce_appframework/gui/components/filebrowser/juce_FileTreeComponent.h

+ 9
- 3
src/juce_appframework/gui/components/filebrowser/juce_FileTreeComponent.cpp View File

@@ -90,9 +90,11 @@ public:
} }
//============================================================================== //==============================================================================
bool mightContainSubItems() { return isDirectory; }
const String getUniqueName() const { return file.getFullPathName(); }
int getItemHeight() const { return 22; }
bool mightContainSubItems() { return isDirectory; }
const String getUniqueName() const { return file.getFullPathName(); }
int getItemHeight() const { return 22; }
const String getDragSourceDescription() { return owner.getDragAndDropDescription(); }
void itemOpennessChanged (bool isNowOpen) void itemOpennessChanged (bool isNowOpen)
{ {
@@ -271,5 +273,9 @@ void FileTreeComponent::scrollToTop()
getViewport()->getVerticalScrollBar()->setCurrentRangeStart (0); getViewport()->getVerticalScrollBar()->setCurrentRangeStart (0);
} }
void FileTreeComponent::setDragAndDropDescription (const String& description) throw()
{
dragAndDropDescription = description;
}
END_JUCE_NAMESPACE END_JUCE_NAMESPACE

+ 13
- 0
src/juce_appframework/gui/components/filebrowser/juce_FileTreeComponent.h View File

@@ -80,10 +80,23 @@ public:
/** Scrolls the list to the top. */ /** Scrolls the list to the top. */
void scrollToTop(); void scrollToTop();
/** Setting a name for this allows tree items to be dragged.
The string that you pass in here will be returned by the getDragSourceDescription()
of the items in the tree. For more info, see TreeViewItem::getDragSourceDescription().
*/
void setDragAndDropDescription (const String& description) throw();
/** Returns the last value that was set by setDragAndDropDescription().
*/
const String& getDragAndDropDescription() const throw() { return dragAndDropDescription; }
//============================================================================== //==============================================================================
juce_UseDebuggingNewOperator juce_UseDebuggingNewOperator
private: private:
String dragAndDropDescription;
FileTreeComponent (const FileTreeComponent&); FileTreeComponent (const FileTreeComponent&);
const FileTreeComponent& operator= (const FileTreeComponent&); const FileTreeComponent& operator= (const FileTreeComponent&);
}; };


Loading…
Cancel
Save