mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-29 02:40:05 +00:00
Introjucer: ability to drag files from the project tree into external apps. Added more drag-and-drop functionality for linux.
This commit is contained in:
parent
81232e6442
commit
565cb189ea
6 changed files with 440 additions and 57 deletions
|
|
@ -29,6 +29,7 @@
|
|||
#include "jucer_OpenDocumentManager.h"
|
||||
#include "../Code Editor/jucer_SourceCodeEditor.h"
|
||||
#include "../Project/jucer_NewProjectWizard.h"
|
||||
#include "../Utility/jucer_JucerTreeViewBase.h"
|
||||
|
||||
ScopedPointer<ApplicationCommandManager> commandManager;
|
||||
|
||||
|
|
@ -228,6 +229,35 @@ void MainWindow::filesDropped (const StringArray& filenames, int mouseX, int mou
|
|||
}
|
||||
}
|
||||
|
||||
bool MainWindow::shouldDropFilesWhenDraggedExternally (const DragAndDropTarget::SourceDetails& sourceDetails,
|
||||
StringArray& files, bool& canMoveFiles)
|
||||
{
|
||||
if (TreeView* tv = dynamic_cast <TreeView*> (sourceDetails.sourceComponent.get()))
|
||||
{
|
||||
Array<JucerTreeViewBase*> selected;
|
||||
|
||||
for (int i = tv->getNumSelectedItems(); --i >= 0;)
|
||||
if (JucerTreeViewBase* b = dynamic_cast <JucerTreeViewBase*> (tv->getSelectedItem(i)))
|
||||
selected.add (b);
|
||||
|
||||
if (selected.size() > 0)
|
||||
{
|
||||
for (int i = selected.size(); --i >= 0;)
|
||||
{
|
||||
const File f (selected.getUnchecked(i)->getDraggableFile());
|
||||
|
||||
if (f.existsAsFile())
|
||||
files.add (f.getFullPathName());
|
||||
}
|
||||
|
||||
canMoveFiles = false;
|
||||
return files.size() > 0;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void MainWindow::activeWindowStatusChanged()
|
||||
{
|
||||
DocumentWindow::activeWindowStatusChanged();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue