From 874814eaa005fde080f8bb84f5f7beffa5b7354b Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 20 Jan 2014 19:01:17 +0000 Subject: [PATCH] Added multi-select to the PluginListComponent. --- .../scanning/juce_PluginListComponent.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp b/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp index 81122776f3..65cb60d188 100644 --- a/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp +++ b/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp @@ -83,9 +83,9 @@ public: } } - void deleteKeyPressed (int lastRowSelected) override + void deleteKeyPressed (int) override { - removePluginItem (list, lastRowSelected); + owner.removeSelected(); } void sortOrderChanged (int newSortColumnId, bool isForwards) override @@ -152,6 +152,7 @@ PluginListComponent::PluginListComponent (AudioPluginFormatManager& manager, Kno table.setHeaderHeight (22); table.setRowHeight (20); table.setModel (tableModel); + table.setMultipleSelectionEnabled (true); addAndMakeVisible (table); addAndMakeVisible (optionsButton); @@ -208,7 +209,7 @@ void PluginListComponent::removeSelected() { const SparseSet selected (table.getSelectedRows()); - for (int i = list.getNumTypes(); --i >= 0;) + for (int i = table.getNumRows(); --i >= 0;) if (selected.contains (i)) TableModel::removePluginItem (list, i); }