34 downButton ({}, DrawableButton::ImageOnButtonBackground)
36 listBox.setModel (
this);
37 addAndMakeVisible (listBox);
38 listBox.setColour (ListBox::backgroundColourId, Colours::black.withAlpha (0.02f));
39 listBox.setColour (ListBox::outlineColourId, Colours::black.withAlpha (0.1f));
40 listBox.setOutlineThickness (1);
42 addAndMakeVisible (addButton);
43 addButton.onClick = [
this] { addPath(); };
44 addButton.setConnectedEdges (Button::ConnectedOnLeft | Button::ConnectedOnRight | Button::ConnectedOnBottom | Button::ConnectedOnTop);
46 addAndMakeVisible (removeButton);
47 removeButton.onClick = [
this] { deleteSelected(); };
48 removeButton.setConnectedEdges (Button::ConnectedOnLeft | Button::ConnectedOnRight | Button::ConnectedOnBottom | Button::ConnectedOnTop);
50 addAndMakeVisible (changeButton);
51 changeButton.onClick = [
this] { editSelected(); };
53 addAndMakeVisible (upButton);
54 upButton.onClick = [
this] { moveSelection (-1); };
56 auto arrowColour = findColour (ListBox::textColourId);
60 arrowPath.addArrow ({ 50.0f, 100.0f, 50.0f, 0.0f }, 40.0f, 100.0f, 50.0f);
61 DrawablePath arrowImage;
62 arrowImage.setFill (arrowColour);
63 arrowImage.setPath (arrowPath);
65 upButton.setImages (&arrowImage);
68 addAndMakeVisible (downButton);
69 downButton.onClick = [
this] { moveSelection (1); };
73 arrowPath.addArrow ({ 50.0f, 0.0f, 50.0f, 100.0f }, 40.0f, 100.0f, 50.0f);
74 DrawablePath arrowImage;
75 arrowImage.setFill (arrowColour);
76 arrowImage.setPath (arrowPath);
78 downButton.setImages (&arrowImage);
86 const bool anythingSelected =
listBox.getNumSelectedRows() > 0;
90 upButton.setEnabled (anythingSelected);
119 return path.getNumPaths();
129 f.setHorizontalScale (0.9f);
132 g.drawText (
path[rowNumber].getFullPathName(),
179 const int buttonH = 22;
180 const int buttonY =
getHeight() - buttonH - 4;
183 addButton.setBounds (2, buttonY, buttonH, buttonH);
188 upButton.setSize (buttonH * 2, buttonH);
202 for (
int i = filenames.
size(); --
i >= 0;)
204 const File f (filenames[
i]);
252 jassert (delta == -1 || delta == 1);
253 auto currentRow =
listBox.getSelectedRow();
257 auto newRow =
jlimit (0,
path.getNumPaths() - 1, currentRow + delta);
259 if (currentRow != newRow)
261 auto f =
path[currentRow];
262 path.remove (currentRow);
263 path.add (
f, newRow);
static File getCurrentWorkingDirectory()
Definition File.cpp:1395
int getHeight() const noexcept
Definition juce_Component.h:274
Colour findColour(int colourID, bool inheritFromParent=false) const
Definition juce_Component.cpp:2219
int getWidth() const noexcept
Definition juce_Component.h:271
@ canSelectDirectories
Definition juce_FileBrowserComponent.h:60
@ openMode
Definition juce_FileBrowserComponent.h:54
Definition juce_FileChooser.h:56
File getResult() const
Definition juce_FileChooser.cpp:240
Definition juce_File.h:45
Definition juce_FileSearchPath.h:35
String toString() const
Definition juce_FileSearchPath.cpp:69
void deleteKeyPressed(int lastRowSelected) override
Definition juce_FileSearchPathListComponent.cpp:137
DrawableButton upButton
Definition juce_FileSearchPathListComponent.h:104
bool isInterestedInFileDrag(const StringArray &) override
Definition juce_FileSearchPathListComponent.cpp:195
int getNumRows() override
Definition juce_FileSearchPathListComponent.cpp:117
@ backgroundColourId
Definition juce_FileSearchPathListComponent.h:70
void setPath(const FileSearchPath &newPath)
Definition juce_FileSearchPathListComponent.cpp:102
void deleteSelected()
Definition juce_FileSearchPathListComponent.cpp:238
void resized() override
Definition juce_FileSearchPathListComponent.cpp:177
void changed()
Definition juce_FileSearchPathListComponent.cpp:94
TextButton changeButton
Definition juce_FileSearchPathListComponent.h:103
void paintListBoxItem(int rowNumber, Graphics &g, int width, int height, bool rowIsSelected) override
Definition juce_FileSearchPathListComponent.cpp:122
DrawableButton downButton
Definition juce_FileSearchPathListComponent.h:104
std::unique_ptr< FileChooser > chooser
Definition juce_FileSearchPathListComponent.h:100
FileSearchPathListComponent()
Definition juce_FileSearchPathListComponent.cpp:29
void selectedRowsChanged(int lastRowSelected) override
Definition juce_FileSearchPathListComponent.cpp:167
void setDefaultBrowseTarget(const File &newDefaultDirectory)
Definition juce_FileSearchPathListComponent.cpp:111
void listBoxItemDoubleClicked(int row, const MouseEvent &) override
Definition juce_FileSearchPathListComponent.cpp:162
void updateButtons()
Definition juce_FileSearchPathListComponent.cpp:84
TextButton addButton
Definition juce_FileSearchPathListComponent.h:103
void addPath()
Definition juce_FileSearchPathListComponent.cpp:215
void moveSelection(int)
Definition juce_FileSearchPathListComponent.cpp:250
FileSearchPath path
Definition juce_FileSearchPathListComponent.h:98
void returnKeyPressed(int lastRowSelected) override
Definition juce_FileSearchPathListComponent.cpp:146
void paint(Graphics &) override
Definition juce_FileSearchPathListComponent.cpp:172
File defaultBrowseTarget
Definition juce_FileSearchPathListComponent.h:99
void editSelected()
Definition juce_FileSearchPathListComponent.cpp:244
ListBox listBox
Definition juce_FileSearchPathListComponent.h:102
void filesDropped(const StringArray &files, int, int) override
Definition juce_FileSearchPathListComponent.cpp:200
TextButton removeButton
Definition juce_FileSearchPathListComponent.h:103
Definition juce_Font.h:42
Definition juce_GraphicsContext.h:45
@ centredLeft
Definition juce_Justification.h:143
@ textColourId
Definition juce_ListBox.h:498
Definition juce_MouseEvent.h:39
Definition juce_StringArray.h:35
int size() const noexcept
Definition juce_StringArray.h:136
@ highlightColourId
Definition juce_TextEditor.h:217
int g
Definition inflate.c:1573
register unsigned i
Definition inflate.c:1575
unsigned f
Definition inflate.c:1572
static int int height
Definition pugl.h:1594
static int width
Definition pugl.h:1593
virtual ASIOError start()=0
#define TRANS(stringLiteral)
Definition juce_LocalisedStrings.h:208
Definition carla_juce.cpp:31
Type jlimit(Type lowerLimit, Type upperLimit, Type valueToConstrain) noexcept
Definition juce_MathsFunctions.h:262
bool isPositiveAndBelow(Type1 valueToTest, Type2 upperLimit) noexcept
Definition juce_MathsFunctions.h:279
@ row
Definition juce_AccessibilityRole.h:53