Browse Source

Standardised some lambda syntax

tags/2021-05-28
jules 7 years ago
parent
commit
4fcedf7be5
53 changed files with 138 additions and 138 deletions
  1. +1
    -1
      examples/Demo/Source/Demos/AudioLatencyDemo.cpp
  2. +2
    -2
      examples/Demo/Source/Demos/AudioPlaybackDemo.cpp
  3. +1
    -1
      examples/Demo/Source/Demos/AudioRecordingDemo.cpp
  4. +2
    -2
      examples/Demo/Source/Demos/AudioSynthesiserDemo.cpp
  5. +2
    -2
      examples/Demo/Source/Demos/CameraDemo.cpp
  6. +3
    -3
      examples/Demo/Source/Demos/ChildProcessDemo.cpp
  7. +2
    -2
      examples/Demo/Source/Demos/CryptographyDemo.cpp
  8. +2
    -2
      examples/Demo/Source/Demos/DialogsDemo.cpp
  9. +27
    -27
      examples/Demo/Source/Demos/FlexBoxDemo.cpp
  10. +3
    -3
      examples/Demo/Source/Demos/FontsDemo.cpp
  11. +1
    -1
      examples/Demo/Source/Demos/LiveConstantDemo.cpp
  12. +2
    -2
      examples/Demo/Source/Demos/LookAndFeelDemo.cpp
  13. +3
    -3
      examples/Demo/Source/Demos/MDIDemo.cpp
  14. +2
    -2
      examples/Demo/Source/Demos/MidiDemo.cpp
  15. +1
    -1
      examples/Demo/Source/Demos/MultithreadingDemo.cpp
  16. +2
    -2
      examples/Demo/Source/Demos/NetworkingDemo.cpp
  17. +3
    -3
      examples/Demo/Source/Demos/OpenGLDemo.cpp
  18. +1
    -1
      examples/Demo/Source/Demos/OpenGLDemo2D.cpp
  19. +2
    -2
      examples/Demo/Source/Demos/TimersAndEventsDemo.cpp
  20. +1
    -1
      examples/Demo/Source/Demos/UnitTestsDemo.cpp
  21. +2
    -2
      examples/Demo/Source/Demos/ValueTreesDemo.cpp
  22. +2
    -2
      examples/Demo/Source/Demos/VideoDemo.cpp
  23. +4
    -4
      examples/Demo/Source/Demos/WebBrowserDemo.cpp
  24. +6
    -6
      examples/Demo/Source/Demos/WidgetsDemo.cpp
  25. +2
    -2
      examples/Demo/Source/Demos/WindowsDemo.cpp
  26. +1
    -1
      examples/Demo/Source/Demos/XMLandJSONDemo.cpp
  27. +1
    -1
      extras/Projucer/Source/Licenses/jucer_LicenseThread.h
  28. +1
    -1
      modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp
  29. +1
    -1
      modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
  30. +1
    -1
      modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp
  31. +11
    -11
      modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp
  32. +4
    -4
      modules/juce_core/misc/juce_StdFunctionCompat.cpp
  33. +2
    -2
      modules/juce_gui_basics/components/juce_Component.cpp
  34. +2
    -2
      modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp
  35. +3
    -3
      modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.cpp
  36. +5
    -5
      modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.cpp
  37. +2
    -2
      modules/juce_gui_basics/filebrowser/juce_FilenameComponent.cpp
  38. +1
    -1
      modules/juce_gui_basics/layout/juce_SidePanel.cpp
  39. +1
    -1
      modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp
  40. +2
    -2
      modules/juce_gui_basics/mouse/juce_DragAndDropContainer.cpp
  41. +1
    -1
      modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm
  42. +1
    -1
      modules/juce_gui_basics/native/juce_ios_Windowing.mm
  43. +1
    -1
      modules/juce_gui_basics/native/juce_mac_MainMenu.mm
  44. +1
    -1
      modules/juce_gui_basics/native/juce_win32_FileChooser.cpp
  45. +1
    -1
      modules/juce_gui_basics/properties/juce_BooleanPropertyComponent.cpp
  46. +1
    -1
      modules/juce_gui_basics/properties/juce_ButtonPropertyComponent.cpp
  47. +2
    -2
      modules/juce_gui_basics/widgets/juce_Slider.cpp
  48. +3
    -3
      modules/juce_gui_basics/widgets/juce_Toolbar.cpp
  49. +1
    -1
      modules/juce_gui_basics/windows/juce_ComponentPeer.cpp
  50. +1
    -1
      modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.cpp
  51. +5
    -5
      modules/juce_gui_extra/native/juce_android_PushNotifications.cpp
  52. +1
    -1
      modules/juce_gui_extra/native/juce_linux_XEmbedComponent.cpp
  53. +2
    -2
      modules/juce_product_unlocking/native/juce_ios_InAppPurchases.cpp

+ 1
- 1
examples/Demo/Source/Demos/AudioLatencyDemo.cpp View File

@@ -318,7 +318,7 @@ public:
addAndMakeVisible (startTestButton);
startTestButton.setButtonText ("Test Latency");
startTestButton.onClick = [this]() { startTest(); };
startTestButton.onClick = [this] { startTest(); };
MainAppWindow::getSharedAudioDeviceManager().addAudioCallback (liveAudioScroller);
}


+ 2
- 2
examples/Demo/Source/Demos/AudioPlaybackDemo.cpp View File

@@ -253,7 +253,7 @@ public:
addAndMakeVisible (followTransportButton);
followTransportButton.setButtonText ("Follow Transport");
followTransportButton.onClick = [this]() { updateFollowTransportState(); };
followTransportButton.onClick = [this] { updateFollowTransportState(); };
addAndMakeVisible (explanation);
explanation.setText ("Select an audio file in the treeview above, and this page will display its waveform, and let you play it..", dontSendNotification);
@@ -277,7 +277,7 @@ public:
startStopButton.setButtonText ("Play/Stop");
startStopButton.setColour (TextButton::buttonColourId, Colour (0xff79ed7f));
startStopButton.setColour (TextButton::textColourOffId, Colours::black);
startStopButton.onClick = [this]() { startOrStop(); };
startStopButton.onClick = [this] { startOrStop(); };
addAndMakeVisible (fileTreeComp);


+ 1
- 1
examples/Demo/Source/Demos/AudioRecordingDemo.cpp View File

@@ -233,7 +233,7 @@ public:
recordButton.setColour (TextButton::buttonColourId, Colour (0xffff5c5c));
recordButton.setColour (TextButton::textColourOnId, Colours::black);
recordButton.onClick = [this]()
recordButton.onClick = [this]
{
if (recorder.isRecording())
stopRecording();


+ 2
- 2
examples/Demo/Source/Demos/AudioSynthesiserDemo.cpp View File

@@ -245,12 +245,12 @@ public:
sineButton.setButtonText ("Use sine wave");
sineButton.setRadioGroupId (321);
sineButton.setToggleState (true, dontSendNotification);
sineButton.onClick = [this]() { synthAudioSource.setUsingSineWaveSound(); };
sineButton.onClick = [this] { synthAudioSource.setUsingSineWaveSound(); };
addAndMakeVisible (sampledButton);
sampledButton.setButtonText ("Use sampled sound");
sampledButton.setRadioGroupId (321);
sampledButton.onClick = [this]() { synthAudioSource.setUsingSampledSound(); };
sampledButton.onClick = [this] { synthAudioSource.setUsingSampledSound(); };
addAndMakeVisible (liveAudioDisplayComp);


+ 2
- 2
examples/Demo/Source/Demos/CameraDemo.cpp View File

@@ -48,11 +48,11 @@ public:
cameraSelectorComboBox.onChange = [this] { cameraChanged(); };
addAndMakeVisible (snapshotButton);
snapshotButton.onClick = [this]() { takeSnapshot(); };
snapshotButton.onClick = [this] { takeSnapshot(); };
snapshotButton.setEnabled (false);
addAndMakeVisible (recordMovieButton);
recordMovieButton.onClick = [this]() { startRecording(); };
recordMovieButton.onClick = [this] { startRecording(); };
recordMovieButton.setEnabled (false);
addAndMakeVisible (lastSnapshot);


+ 3
- 3
examples/Demo/Source/Demos/ChildProcessDemo.cpp View File

@@ -63,15 +63,15 @@ public:
addAndMakeVisible (launchButton);
launchButton.setButtonText ("Launch Child Process");
launchButton.onClick = [this]() { launchChildProcess(); };
launchButton.onClick = [this] { launchChildProcess(); };
addAndMakeVisible (pingButton);
pingButton.setButtonText ("Send Ping");
pingButton.onClick = [this]() { pingChildProcess(); };
pingButton.onClick = [this] { pingChildProcess(); };
addAndMakeVisible (killButton);
killButton.setButtonText ("Kill Child Process");
killButton.onClick = [this]() { killChildProcess(); };
killButton.onClick = [this] { killChildProcess(); };
addAndMakeVisible (testResultsBox);
testResultsBox.setMultiLine (true);


+ 2
- 2
examples/Demo/Source/Demos/CryptographyDemo.cpp View File

@@ -43,7 +43,7 @@ public:
addAndMakeVisible (generateRSAButton);
generateRSAButton.setButtonText ("Generate RSA");
generateRSAButton.onClick = [this]() { createRSAKey(); };
generateRSAButton.onClick = [this] { createRSAKey(); };
addAndMakeVisible (rsaResultBox);
rsaResultBox.setReadOnly (true);
@@ -137,7 +137,7 @@ public:
hashEntryBox.setReturnKeyStartsNewLine (true);
hashEntryBox.setText ("Type some text in this box and the resulting MD5, SHA and Whirlpool hashes will update below");
auto updateHashes = [this]()
auto updateHashes = [this]
{
auto text = hashEntryBox.getText();
updateMD5Result (text.toUTF8());


+ 2
- 2
examples/Demo/Source/Demos/DialogsDemo.cpp View File

@@ -117,7 +117,7 @@ public:
addAndMakeVisible (nativeButton);
nativeButton.setButtonText ("Use Native Windows");
nativeButton.onClick = [this]() { getLookAndFeel().setUsingNativeAlertWindows (nativeButton.getToggleState()); };
nativeButton.onClick = [this] { getLookAndFeel().setUsingNativeAlertWindows (nativeButton.getToggleState()); };
static const char* windowNames[] =
{
@@ -147,7 +147,7 @@ public:
windowButtons.add (newButton);
addAndMakeVisible (newButton);
newButton->setButtonText (windowNames[i]);
newButton->onClick = [this, i, newButton]() { showWindow (*newButton, static_cast<DialogType> (i)); };
newButton->onClick = [this, i, newButton] { showWindow (*newButton, static_cast<DialogType> (i)); };
}
}


+ 27
- 27
examples/Demo/Source/Demos/FlexBoxDemo.cpp View File

@@ -36,19 +36,19 @@ struct DemoFlexPanel : public juce::Component
int x = 70;
int y = 3;
setupTextEditor (flexOrderEditor, { x, y, 20, 18 }, "0", [this]() { flexItem.order = (int) flexOrderEditor.getText().getFloatValue(); });
setupTextEditor (flexOrderEditor, { x, y, 20, 18 }, "0", [this] { flexItem.order = (int) flexOrderEditor.getText().getFloatValue(); });
addLabel ("order", flexOrderEditor);
y += 20;
setupTextEditor (flexGrowEditor, { x, y, 20, 18 }, "0", [this]() { flexItem.flexGrow = flexGrowEditor.getText().getFloatValue(); });
setupTextEditor (flexGrowEditor, { x, y, 20, 18 }, "0", [this] { flexItem.flexGrow = flexGrowEditor.getText().getFloatValue(); });
addLabel ("flex-grow", flexGrowEditor);
y += 20;
setupTextEditor (flexShrinkEditor, { x, y, 20, 18 }, "1", [this]() { flexItem.flexShrink = flexShrinkEditor.getText().getFloatValue(); });
setupTextEditor (flexShrinkEditor, { x, y, 20, 18 }, "1", [this] { flexItem.flexShrink = flexShrinkEditor.getText().getFloatValue(); });
addLabel ("flex-shrink", flexShrinkEditor);
y += 20;
setupTextEditor (flexBasisEditor, { x, y, 33, 18 }, "100", [this]() { flexItem.flexBasis = flexBasisEditor.getText().getFloatValue(); });
setupTextEditor (flexBasisEditor, { x, y, 33, 18 }, "100", [this] { flexItem.flexBasis = flexBasisEditor.getText().getFloatValue(); });
addLabel ("flex-basis", flexBasisEditor);
y += 20;
@@ -71,7 +71,7 @@ struct DemoFlexPanel : public juce::Component
te.setBounds (b);
te.setText (initialText);
te.onTextChange = [this, updateFn]()
te.onTextChange = [this, updateFn]
{
updateFn();
@@ -176,10 +176,10 @@ struct FlexBoxDemo : public juce::Component
int leftMargin = 15;
int topMargin = 45;
createToggleButton ("row", groupID, leftMargin, topMargin + i++ * 22, true, [this]() { flexBox.flexDirection = FlexBox::Direction::row; }).setToggleState (true, dontSendNotification);
createToggleButton ("row-reverse", groupID, leftMargin, topMargin + i++ * 22, false, [this]() { flexBox.flexDirection = FlexBox::Direction::rowReverse; });
createToggleButton ("column", groupID, leftMargin, topMargin + i++ * 22, false, [this]() { flexBox.flexDirection = FlexBox::Direction::column; });
createToggleButton ("column-reverse", groupID, leftMargin, topMargin + i++ * 22, false, [this]() { flexBox.flexDirection = FlexBox::Direction::columnReverse; });
createToggleButton ("row", groupID, leftMargin, topMargin + i++ * 22, true, [this] { flexBox.flexDirection = FlexBox::Direction::row; }).setToggleState (true, dontSendNotification);
createToggleButton ("row-reverse", groupID, leftMargin, topMargin + i++ * 22, false, [this] { flexBox.flexDirection = FlexBox::Direction::rowReverse; });
createToggleButton ("column", groupID, leftMargin, topMargin + i++ * 22, false, [this] { flexBox.flexDirection = FlexBox::Direction::column; });
createToggleButton ("column-reverse", groupID, leftMargin, topMargin + i++ * 22, false, [this] { flexBox.flexDirection = FlexBox::Direction::columnReverse; });
auto wrapGroup = addControl (new GroupComponent ("wrap", "flex-wrap"));
wrapGroup->setBounds (160, 30, 140, 110);
@@ -188,9 +188,9 @@ struct FlexBoxDemo : public juce::Component
++groupID;
leftMargin = 165;
createToggleButton ("nowrap", groupID, leftMargin, topMargin + i++ * 22, false, [this]() { flexBox.flexWrap = FlexBox::Wrap::noWrap; });
createToggleButton ("wrap", groupID, leftMargin, topMargin + i++ * 22, true, [this]() { flexBox.flexWrap = FlexBox::Wrap::wrap; });
createToggleButton ("wrap-reverse", groupID, leftMargin, topMargin + i++ * 22, false, [this]() { flexBox.flexWrap = FlexBox::Wrap::wrapReverse; });
createToggleButton ("nowrap", groupID, leftMargin, topMargin + i++ * 22, false, [this] { flexBox.flexWrap = FlexBox::Wrap::noWrap; });
createToggleButton ("wrap", groupID, leftMargin, topMargin + i++ * 22, true, [this] { flexBox.flexWrap = FlexBox::Wrap::wrap; });
createToggleButton ("wrap-reverse", groupID, leftMargin, topMargin + i++ * 22, false, [this] { flexBox.flexWrap = FlexBox::Wrap::wrapReverse; });
auto justifyGroup = addControl (new GroupComponent ("justify", "justify-content"));
justifyGroup->setBounds (10, 150, 140, 140);
@@ -200,11 +200,11 @@ struct FlexBoxDemo : public juce::Component
leftMargin = 15;
topMargin = 165;
createToggleButton ("flex-start", groupID, leftMargin, topMargin + i++ * 22, true, [this]() { flexBox.justifyContent = FlexBox::JustifyContent::flexStart; });
createToggleButton ("flex-end", groupID, leftMargin, topMargin + i++ * 22, false, [this]() { flexBox.justifyContent = FlexBox::JustifyContent::flexEnd; });
createToggleButton ("center", groupID, leftMargin, topMargin + i++ * 22, false, [this]() { flexBox.justifyContent = FlexBox::JustifyContent::center; });
createToggleButton ("space-between", groupID, leftMargin, topMargin + i++ * 22, false, [this]() { flexBox.justifyContent = FlexBox::JustifyContent::spaceBetween; });
createToggleButton ("space-around", groupID, leftMargin, topMargin + i++ * 22, false, [this]() { flexBox.justifyContent = FlexBox::JustifyContent::spaceAround; });
createToggleButton ("flex-start", groupID, leftMargin, topMargin + i++ * 22, true, [this] { flexBox.justifyContent = FlexBox::JustifyContent::flexStart; });
createToggleButton ("flex-end", groupID, leftMargin, topMargin + i++ * 22, false, [this] { flexBox.justifyContent = FlexBox::JustifyContent::flexEnd; });
createToggleButton ("center", groupID, leftMargin, topMargin + i++ * 22, false, [this] { flexBox.justifyContent = FlexBox::JustifyContent::center; });
createToggleButton ("space-between", groupID, leftMargin, topMargin + i++ * 22, false, [this] { flexBox.justifyContent = FlexBox::JustifyContent::spaceBetween; });
createToggleButton ("space-around", groupID, leftMargin, topMargin + i++ * 22, false, [this] { flexBox.justifyContent = FlexBox::JustifyContent::spaceAround; });
auto alignGroup = addControl (new GroupComponent ("align", "align-items"));
alignGroup->setBounds (160, 150, 140, 140);
@@ -214,10 +214,10 @@ struct FlexBoxDemo : public juce::Component
leftMargin = 165;
topMargin = 165;
createToggleButton ("stretch", groupID, leftMargin, topMargin + i++ * 22, true, [this]() { flexBox.alignItems = FlexBox::AlignItems::stretch; });
createToggleButton ("flex-start", groupID, leftMargin, topMargin + i++ * 22, false, [this]() { flexBox.alignItems = FlexBox::AlignItems::flexStart; });
createToggleButton ("flex-end", groupID, leftMargin, topMargin + i++ * 22, false, [this]() { flexBox.alignItems = FlexBox::AlignItems::flexEnd; });
createToggleButton ("center", groupID, leftMargin, topMargin + i++ * 22, false, [this]() { flexBox.alignItems = FlexBox::AlignItems::center; });
createToggleButton ("stretch", groupID, leftMargin, topMargin + i++ * 22, true, [this] { flexBox.alignItems = FlexBox::AlignItems::stretch; });
createToggleButton ("flex-start", groupID, leftMargin, topMargin + i++ * 22, false, [this] { flexBox.alignItems = FlexBox::AlignItems::flexStart; });
createToggleButton ("flex-end", groupID, leftMargin, topMargin + i++ * 22, false, [this] { flexBox.alignItems = FlexBox::AlignItems::flexEnd; });
createToggleButton ("center", groupID, leftMargin, topMargin + i++ * 22, false, [this] { flexBox.alignItems = FlexBox::AlignItems::center; });
auto alignContentGroup = addControl (new GroupComponent ("content", "align-content"));
alignContentGroup->setBounds (10, 300, 140, 160);
@@ -227,12 +227,12 @@ struct FlexBoxDemo : public juce::Component
leftMargin = 15;
topMargin = 315;
createToggleButton ("stretch", groupID, leftMargin, topMargin + i++ * 22, true, [this]() { flexBox.alignContent = FlexBox::AlignContent::stretch; });
createToggleButton ("flex-start", groupID, leftMargin, topMargin + i++ * 22, false, [this]() { flexBox.alignContent = FlexBox::AlignContent::flexStart; });
createToggleButton ("flex-end", groupID, leftMargin, topMargin + i++ * 22, false, [this]() { flexBox.alignContent = FlexBox::AlignContent::flexEnd; });
createToggleButton ("center", groupID, leftMargin, topMargin + i++ * 22, false, [this]() { flexBox.alignContent = FlexBox::AlignContent::center; });
createToggleButton ("space-between", groupID, leftMargin, topMargin + i++ * 22, false, [this]() { flexBox.alignContent = FlexBox::AlignContent::spaceBetween; });
createToggleButton ("space-around", groupID, leftMargin, topMargin + i++ * 22, false, [this]() { flexBox.alignContent = FlexBox::AlignContent::spaceAround; });
createToggleButton ("stretch", groupID, leftMargin, topMargin + i++ * 22, true, [this] { flexBox.alignContent = FlexBox::AlignContent::stretch; });
createToggleButton ("flex-start", groupID, leftMargin, topMargin + i++ * 22, false, [this] { flexBox.alignContent = FlexBox::AlignContent::flexStart; });
createToggleButton ("flex-end", groupID, leftMargin, topMargin + i++ * 22, false, [this] { flexBox.alignContent = FlexBox::AlignContent::flexEnd; });
createToggleButton ("center", groupID, leftMargin, topMargin + i++ * 22, false, [this] { flexBox.alignContent = FlexBox::AlignContent::center; });
createToggleButton ("space-between", groupID, leftMargin, topMargin + i++ * 22, false, [this] { flexBox.alignContent = FlexBox::AlignContent::spaceBetween; });
createToggleButton ("space-around", groupID, leftMargin, topMargin + i++ * 22, false, [this] { flexBox.alignContent = FlexBox::AlignContent::spaceAround; });
}
void setupFlexBoxItems()


+ 3
- 3
examples/Demo/Source/Demos/FontsDemo.cpp View File

@@ -58,9 +58,9 @@ public:
kerningSlider.addListener (this);
scaleSlider.addListener (this);
boldToggle.onClick = [this]() { refreshPreviewBoxFont(); };
italicToggle.onClick = [this]() { refreshPreviewBoxFont(); };
styleBox.onChange = [this]() { refreshPreviewBoxFont(); };
boldToggle.onClick = [this] { refreshPreviewBoxFont(); };
italicToggle.onClick = [this] { refreshPreviewBoxFont(); };
styleBox.onChange = [this] { refreshPreviewBoxFont(); };
Font::findFonts (fonts); // Generate the list of fonts


+ 1
- 1
examples/Demo/Source/Demos/LiveConstantDemo.cpp View File

@@ -74,7 +74,7 @@ public:
addAndMakeVisible (descriptionLabel);
addAndMakeVisible (startButton);
addChildComponent (demoComp);
startButton.onClick = [this]() { start(); };
startButton.onClick = [this] { start(); };
}
void paint (Graphics& g) override


+ 2
- 2
examples/Demo/Source/Demos/LookAndFeelDemo.cpp View File

@@ -535,12 +535,12 @@ public:
addLookAndFeel (slaf, "Square Look And Feel");
setupSquareLookAndFeelColours (*slaf);
lafBox.onChange = [this]() { setAllLookAndFeels (lookAndFeels[lafBox.getSelectedItemIndex()]); };
lafBox.onChange = [this] { setAllLookAndFeels (lookAndFeels[lafBox.getSelectedItemIndex()]); };
lafBox.setSelectedItemIndex (3);
addAndMakeVisible (randomButton);
randomButton.setButtonText ("Assign Randomly");
randomButton.onClick = [this]() { lafBox.setSelectedItemIndex (Random().nextInt (lafBox.getNumItems())); };
randomButton.onClick = [this] { lafBox.setSelectedItemIndex (Random().nextInt (lafBox.getNumItems())); };
}
void paint (Graphics& g) override


+ 3
- 3
examples/Demo/Source/Demos/MDIDemo.cpp View File

@@ -49,7 +49,7 @@ public:
editor.setReturnKeyStartsNewLine (true);
editor.getTextValue().referTo (textValueObject);
addAndMakeVisible (editor);
editor.onTextChange = [this]() { changed(); };
editor.onTextChange = [this] { changed(); };
}
void resized() override
@@ -155,11 +155,11 @@ public:
showInTabsButton.setButtonText ("Show with tabs");
showInTabsButton.setToggleState (false, dontSendNotification);
showInTabsButton.onClick = [this]() { updateLayoutMode(); };
showInTabsButton.onClick = [this] { updateLayoutMode(); };
addAndMakeVisible (showInTabsButton);
addNoteButton.setButtonText ("Create a new note");
addNoteButton.onClick = [this]() { addNote (String ("Note ") + String (multiDocumentPanel.getNumDocuments() + 1), "Hello World!"); };
addNoteButton.onClick = [this] { addNote (String ("Note ") + String (multiDocumentPanel.getNumDocuments() + 1), "Hello World!"); };
addAndMakeVisible (addNoteButton);
addAndMakeVisible (multiDocumentPanel);


+ 2
- 2
examples/Demo/Source/Demos/MidiDemo.cpp View File

@@ -90,7 +90,7 @@ public:
auto midiInputs = MidiInput::getDevices();
midiInputList.addItemList (midiInputs, 1);
midiInputList.onChange = [this]() { setMidiInput (midiInputList.getSelectedItemIndex()); };
midiInputList.onChange = [this] { setMidiInput (midiInputList.getSelectedItemIndex()); };
// find the first enabled device and use that by default
for (int i = 0; i < midiInputs.size(); ++i)
@@ -115,7 +115,7 @@ public:
addAndMakeVisible (midiOutputList);
midiOutputList.setTextWhenNoChoicesAvailable ("No MIDI Output Enabled");
midiOutputList.addItemList (MidiOutput::getDevices(), 1);
midiOutputList.onChange = [this]() { setMidiOutput (midiOutputList.getSelectedItemIndex()); };
midiOutputList.onChange = [this] { setMidiOutput (midiOutputList.getSelectedItemIndex()); };
addAndMakeVisible (keyboardComponent);
keyboardState.addListener (this);


+ 1
- 1
examples/Demo/Source/Demos/MultithreadingDemo.cpp View File

@@ -217,7 +217,7 @@ public:
controlButton.setTopLeftPosition (20, 20);
controlButton.setTriggeredOnMouseDown (true);
controlButton.setAlwaysOnTop (true);
controlButton.onClick = [this]() { showMenu(); };
controlButton.onClick = [this] { showMenu(); };
}
~MultithreadingDemo()


+ 2
- 2
examples/Demo/Source/Demos/NetworkingDemo.cpp View File

@@ -40,11 +40,11 @@ public:
addAndMakeVisible (urlBox);
urlBox.setText ("https://www.google.com");
urlBox.onReturnKey = [this]() { fetchButton.triggerClick(); };
urlBox.onReturnKey = [this] { fetchButton.triggerClick(); };
addAndMakeVisible (fetchButton);
fetchButton.setButtonText ("Download URL Contents");
fetchButton.onClick = [this]() { startThread(); };
fetchButton.onClick = [this] { startThread(); };
addAndMakeVisible (resultsBox);
}


+ 3
- 3
examples/Demo/Source/Demos/OpenGLDemo.cpp View File

@@ -360,7 +360,7 @@ struct OpenGLDemoClasses
speedLabel.attachToComponent (&speedSlider, true);
addAndMakeVisible (showBackgroundToggle);
showBackgroundToggle.onClick = [this]() { demo.doBackgroundDrawing = showBackgroundToggle.getToggleState(); };
showBackgroundToggle.onClick = [this] { demo.doBackgroundDrawing = showBackgroundToggle.getToggleState(); };
addAndMakeVisible (tabbedComp);
tabbedComp.setTabBarDepth (25);
@@ -377,11 +377,11 @@ struct OpenGLDemoClasses
textures.add (new DynamicTexture());
addAndMakeVisible (textureBox);
textureBox.onChange = [this]() { selectTexture (textureBox.getSelectedId()); };
textureBox.onChange = [this] { selectTexture (textureBox.getSelectedId()); };
updateTexturesList();
addAndMakeVisible (presetBox);
presetBox.onChange = [this]() { selectPreset (presetBox.getSelectedItemIndex()); };
presetBox.onChange = [this] { selectPreset (presetBox.getSelectedItemIndex()); };
auto presets = getPresets();
StringArray presetNames;


+ 1
- 1
examples/Demo/Source/Demos/OpenGLDemo2D.cpp View File

@@ -57,7 +57,7 @@ public:
presetLabel.attachToComponent (&presetBox, true);
addAndMakeVisible (presetBox);
presetBox.onChange = [this]() { selectPreset (presetBox.getSelectedItemIndex()); };
presetBox.onChange = [this] { selectPreset (presetBox.getSelectedItemIndex()); };
fragmentEditorComp.setOpaque (false);
fragmentDocument.addListener (this);


+ 2
- 2
examples/Demo/Source/Demos/TimersAndEventsDemo.cpp View File

@@ -151,11 +151,11 @@ public:
addAndMakeVisible (stopButton);
stopButton.setButtonText ("Stop");
stopButton.onClick = [this]() { stopButtonClicked(); };
stopButton.onClick = [this] { stopButtonClicked(); };
addAndMakeVisible (randomColourButton);
randomColourButton.setButtonText ("Set Random Colour");
randomColourButton.onClick = [this]() { randomColourButtonClicked(); };
randomColourButton.onClick = [this] { randomColourButtonClicked(); };
// lay out our components in a psudo random grid
Rectangle<int> area (0, 100, 150, 150);


+ 1
- 1
examples/Demo/Source/Demos/UnitTestsDemo.cpp View File

@@ -114,7 +114,7 @@ struct UnitTestClasses
setOpaque (true);
addAndMakeVisible (startTestButton);
startTestButton.onClick = [this]() { start(); };
startTestButton.onClick = [this] { start(); };
addAndMakeVisible (testResultsBox);
testResultsBox.setMultiLine (true);


+ 2
- 2
examples/Demo/Source/Demos/ValueTreesDemo.cpp View File

@@ -173,8 +173,8 @@ public:
addAndMakeVisible (undoButton);
addAndMakeVisible (redoButton);
undoButton.onClick = [this]() { undoManager.undo(); };
redoButton.onClick = [this]() { undoManager.redo(); };
undoButton.onClick = [this] { undoManager.undo(); };
redoButton.onClick = [this] { undoManager.redo(); };
startTimer (500);
}


+ 2
- 2
examples/Demo/Source/Demos/VideoDemo.cpp View File

@@ -143,8 +143,8 @@ public:
loadLeftButton.setButtonText ("Load Left");
loadRightButton.setButtonText ("Load Right");
loadLeftButton .onClick = [this]() { movieCompLeft .setFile (fileTree.getSelectedFile (0)); };
loadRightButton.onClick = [this]() { movieCompRight.setFile (fileTree.getSelectedFile (0)); };
loadLeftButton .onClick = [this] { movieCompLeft .setFile (fileTree.getSelectedFile (0)); };
loadRightButton.onClick = [this] { movieCompRight.setFile (fileTree.getSelectedFile (0)); };
addAndMakeVisible (loadLeftButton);
addAndMakeVisible (loadRightButton);


+ 4
- 4
examples/Demo/Source/Demos/WebBrowserDemo.cpp View File

@@ -78,18 +78,18 @@ public:
// Create an address box..
addAndMakeVisible (addressTextBox);
addressTextBox.setTextToShowWhenEmpty ("Enter a web address, e.g. https://www.juce.com", Colours::grey);
addressTextBox.onReturnKey = [this]() { webView->goToURL (addressTextBox.getText()); };
addressTextBox.onReturnKey = [this] { webView->goToURL (addressTextBox.getText()); };
// create the actual browser component
addAndMakeVisible (webView = new DemoBrowserComponent (addressTextBox));
// add some buttons..
addAndMakeVisible (goButton);
goButton.onClick = [this]() { webView->goToURL (addressTextBox.getText()); };
goButton.onClick = [this] { webView->goToURL (addressTextBox.getText()); };
addAndMakeVisible (backButton);
backButton.onClick = [this]() { webView->goBack(); };
backButton.onClick = [this] { webView->goBack(); };
addAndMakeVisible (forwardButton);
forwardButton.onClick = [this]() { webView->goForward(); };
forwardButton.onClick = [this] { webView->goForward(); };
// send the browser to a start page..
webView->goToURL ("https://www.juce.com");


+ 6
- 6
examples/Demo/Source/Demos/WidgetsDemo.cpp View File

@@ -351,7 +351,7 @@ struct ButtonsPage : public Component
down.setImage (ImageCache::getFromMemory (BinaryData::juce_icon_png, BinaryData::juce_icon_pngSize));
down.setOverlayColour (Colours::black.withAlpha (0.3f));
auto popupMessageCallback = [this]()
auto popupMessageCallback = [this]
{
if (auto* focused = Component::getCurrentlyFocusedComponent())
showBubbleMessage (*focused,
@@ -516,12 +516,12 @@ public:
depthLabel.attachToComponent (&depthSlider, false);
addAndMakeVisible (orientationButton);
orientationButton.onClick = [this]() { toolbar.setVertical (! toolbar.isVertical()); resized(); };
orientationButton.onClick = [this] { toolbar.setVertical (! toolbar.isVertical()); resized(); };
orientationButton.changeWidthToFitText (22);
orientationButton.setTopLeftPosition (depthSlider.getX(), depthSlider.getBottom() + 20);
addAndMakeVisible (customiseButton);
customiseButton.onClick = [this]() { toolbar.showCustomisationDialog (factory); };
customiseButton.onClick = [this] { toolbar.showCustomisationDialog (factory); };
customiseButton.changeWidthToFitText (22);
customiseButton.setTopLeftPosition (orientationButton.getRight() + 20, orientationButton.getY());
}
@@ -965,7 +965,7 @@ private:
comboBox.addItem ("swingin", 6);
comboBox.addItem ("wild", 7);
comboBox.onChange = [this]() { owner.setRating (row, comboBox.getSelectedId()); };
comboBox.onChange = [this] { owner.setRating (row, comboBox.getSelectedId()); };
comboBox.setWantsKeyboardFocus (false);
}
@@ -1277,7 +1277,7 @@ struct BurgerMenuHeader : public Component
p.loadPathFromData (burgerMenuPathData, sizeof (burgerMenuPathData));
burgerButton.setShape (p, true, true, false);
burgerButton.onClick = [this]() { showOrHide(); };
burgerButton.onClick = [this] { showOrHide(); };
addAndMakeVisible (burgerButton);
}
@@ -1340,7 +1340,7 @@ public:
popupButton.setButtonText ("Show Popup Menu");
popupButton.setTriggeredOnMouseDown (true);
popupButton.onClick = [this]() { getDummyPopupMenu().showMenuAsync (PopupMenu::Options().withTargetComponent (&popupButton), nullptr); };
popupButton.onClick = [this] { getDummyPopupMenu().showMenuAsync (PopupMenu::Options().withTargetComponent (&popupButton), nullptr); };
addAndMakeVisible (popupButton);
addChildComponent (menuHeader);


+ 2
- 2
examples/Demo/Source/Demos/WindowsDemo.cpp View File

@@ -204,11 +204,11 @@ public:
showWindowsButton.setButtonText ("Show Windows");
addAndMakeVisible (showWindowsButton);
showWindowsButton.onClick = [this]() { showAllWindows(); };
showWindowsButton.onClick = [this] { showAllWindows(); };
closeWindowsButton.setButtonText ("Close Windows");
addAndMakeVisible (closeWindowsButton);
closeWindowsButton.onClick = [this]() { closeAllWindows(); };
closeWindowsButton.onClick = [this] { closeAllWindows(); };
}
~WindowsDemo()


+ 1
- 1
examples/Demo/Source/Demos/XMLandJSONDemo.cpp View File

@@ -227,7 +227,7 @@ public:
typeBox.addItem ("XML", 1);
typeBox.addItem ("JSON", 2);
typeBox.onChange = [this]()
typeBox.onChange = [this]
{
if (typeBox.getSelectedId() == 1)
reset (xml);


+ 1
- 1
extras/Projucer/Source/Licenses/jucer_LicenseThread.h View File

@@ -452,7 +452,7 @@ struct LicenseThread : NetWorkerThread
if (owner.state.avatar.isValid() != newState.avatar.isValid()) { changed = true; }
if (changed)
executeOnMessageThreadAndBlock ([this, updatedState]() { owner.updateState (updatedState); });
executeOnMessageThreadAndBlock ([this, updatedState] { owner.updateState (updatedState); });
}
//==============================================================================


+ 1
- 1
modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp View File

@@ -1787,7 +1787,7 @@ private:
: owner (cd), device (d),
useInputs (useIns), useOutputs (useOuts)
{
d->setDeviceWrapperRestartCallback ([this]() { owner.restartAsync(); });
d->setDeviceWrapperRestartCallback ([this] { owner.restartAsync(); });
}
~DeviceWrapper()


+ 1
- 1
modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp View File

@@ -472,7 +472,7 @@ public:
if (MessageManager::getInstance()->isThisTheMessageThread())
instance->updateTrackProperties (trackProperties);
else
MessageManager::callAsync ([trackProperties, instance]()
MessageManager::callAsync ([trackProperties, instance]
{ instance->updateTrackProperties (trackProperties); });
}
}


+ 1
- 1
modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp View File

@@ -159,7 +159,7 @@ PluginListComponent::PluginListComponent (AudioPluginFormatManager& manager, Kno
addAndMakeVisible (table);
addAndMakeVisible (optionsButton);
optionsButton.onClick = [this]() { showOptionsMenu(); };
optionsButton.onClick = [this] { showOptionsMenu(); };
optionsButton.setTriggeredOnMouseDown (true);
setSize (400, 600);


+ 11
- 11
modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp View File

@@ -208,7 +208,7 @@ public:
if (hideAdvancedOptionsWithButton)
{
addAndMakeVisible (showAdvancedSettingsButton = new TextButton (TRANS("Show advanced settings...")));
showAdvancedSettingsButton->onClick = [this]() { showAdvanced(); };
showAdvancedSettingsButton->onClick = [this] { showAdvanced(); };
}
type.scanForDevices();
@@ -566,7 +566,7 @@ private:
{
addAndMakeVisible (showUIButton = new TextButton (TRANS ("Control Panel"),
TRANS ("Opens the device's own control panel")));
showUIButton->onClick = [this]() { showDeviceUIPanel(); };
showUIButton->onClick = [this] { showDeviceUIPanel(); };
}
resized();
@@ -583,7 +583,7 @@ private:
addAndMakeVisible (resetDeviceButton = new TextButton (TRANS ("Reset Device"),
TRANS ("Resets the audio interface - sometimes needed after changing a device's properties in its custom control panel")));
resetDeviceButton->onClick = [this]() { resetDevice(); };
resetDeviceButton->onClick = [this] { resetDevice(); };
resized();
}
@@ -601,7 +601,7 @@ private:
if (outputDeviceDropDown == nullptr)
{
outputDeviceDropDown = new ComboBox();
outputDeviceDropDown->onChange = [this]() { updateConfig (true, false, false, false); };
outputDeviceDropDown->onChange = [this] { updateConfig (true, false, false, false); };
addAndMakeVisible (outputDeviceDropDown);
@@ -613,7 +613,7 @@ private:
{
addAndMakeVisible (testButton = new TextButton (TRANS("Test"),
TRANS("Plays a test tone")));
testButton->onClick = [this]() { playTestSound(); };
testButton->onClick = [this] { playTestSound(); };
}
}
@@ -630,7 +630,7 @@ private:
if (inputDeviceDropDown == nullptr)
{
inputDeviceDropDown = new ComboBox();
inputDeviceDropDown->onChange = [this]() { updateConfig (false, true, false, false); };
inputDeviceDropDown->onChange = [this] { updateConfig (false, true, false, false); };
addAndMakeVisible (inputDeviceDropDown);
inputDeviceLabel = new Label ({}, TRANS("Input:"));
@@ -668,7 +668,7 @@ private:
}
sampleRateDropDown->setSelectedId (roundToInt (currentDevice->getCurrentSampleRate()), dontSendNotification);
sampleRateDropDown->onChange = [this]() { updateConfig (false, false, true, false); };
sampleRateDropDown->onChange = [this] { updateConfig (false, false, true, false); };
}
void updateBufferSizeComboBox (AudioIODevice* currentDevice)
@@ -695,7 +695,7 @@ private:
bufferSizeDropDown->addItem (String (bs) + " samples (" + String (bs * 1000.0 / currentRate, 1) + " ms)", bs);
bufferSizeDropDown->setSelectedId (currentDevice->getCurrentBufferSizeSamples(), dontSendNotification);
bufferSizeDropDown->onChange = [this]() { updateConfig (false, false, false, true); };
bufferSizeDropDown->onChange = [this] { updateConfig (false, false, false, true); };
}
public:
@@ -981,7 +981,7 @@ AudioDeviceSelectorComponent::AudioDeviceSelectorComponent (AudioDeviceManager&
deviceTypeDropDown->addItem (types.getUnchecked(i)->getTypeName(), i + 1);
addAndMakeVisible (deviceTypeDropDown);
deviceTypeDropDown->onChange = [this]() { updateDeviceType(); };
deviceTypeDropDown->onChange = [this] { updateDeviceType(); };
deviceTypeDropDownLabel = new Label ({}, TRANS("Audio device type:"));
deviceTypeDropDownLabel->setJustificationType (Justification::centredRight);
@@ -1002,7 +1002,7 @@ AudioDeviceSelectorComponent::AudioDeviceSelectorComponent (AudioDeviceManager&
{
addAndMakeVisible (bluetoothButton = new TextButton (TRANS("Bluetooth MIDI"),
TRANS("Scan for bluetooth MIDI devices")));
bluetoothButton->onClick = [this]() { handleBluetoothButton(); };
bluetoothButton->onClick = [this] { handleBluetoothButton(); };
}
}
else
@@ -1015,7 +1015,7 @@ AudioDeviceSelectorComponent::AudioDeviceSelectorComponent (AudioDeviceManager&
if (showMidiOutputSelector)
{
addAndMakeVisible (midiOutputSelector = new ComboBox());
midiOutputSelector->onChange = [this]() { updateMidiOutput(); };
midiOutputSelector->onChange = [this] { updateMidiOutput(); };
midiOutputLabel = new Label ("lm", TRANS("MIDI Output:"));
midiOutputLabel->attachToComponent (midiOutputSelector, true);


+ 4
- 4
modules/juce_core/misc/juce_StdFunctionCompat.cpp View File

@@ -107,10 +107,10 @@ public:
{
beginTest ("Lambdas");
std::function<int()> fStack ([]() { return 3; });
std::function<int()> fStack ([] { return 3; });
expectEquals (fStack(), 3);
std::function<int()> fHeap ([=]() { return bigData.sum(); });
std::function<int()> fHeap ([=] { return bigData.sum(); });
expectEquals (fHeap(), FunctionTestsHelpers::BigData::bigDataSum);
}
@@ -130,9 +130,9 @@ public:
std::function<int()> fEmpty;
std::function<int()> fStack ([]() { return 3; });
std::function<int()> fStack ([] { return 3; });
std::function<int()> fHeap ([=]() { return bigData.sum(); });
std::function<int()> fHeap ([=] { return bigData.sum(); });
{
beginTest ("copy constructor");


+ 2
- 2
modules/juce_gui_basics/components/juce_Component.cpp View File

@@ -1683,7 +1683,7 @@ void Component::exitModalState (int returnValue)
{
WeakReference<Component> target (this);
MessageManager::callAsync ([=]()
MessageManager::callAsync ([=]
{
if (auto* c = target.get())
c->exitModalState (returnValue);
@@ -2238,7 +2238,7 @@ void Component::postCommandMessage (int commandID)
{
WeakReference<Component> target (this);
MessageManager::callAsync ([=]()
MessageManager::callAsync ([=]
{
if (auto* c = target.get())
c->handleCommandMessage (commandID);


+ 2
- 2
modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp View File

@@ -93,7 +93,7 @@ FileBrowserComponent::FileBrowserComponent (int flags_,
addAndMakeVisible (currentPathBox);
currentPathBox.setEditableText (true);
resetRecentPaths();
currentPathBox.onChange = [this]() { updateSelectedPath(); };
currentPathBox.onChange = [this] { updateSelectedPath(); };
addAndMakeVisible (filenameBox);
filenameBox.setMultiLine (false);
@@ -106,7 +106,7 @@ FileBrowserComponent::FileBrowserComponent (int flags_,
fileLabel.attachToComponent (&filenameBox, true);
addAndMakeVisible (goUpButton = getLookAndFeel().createFileBrowserGoUpButton());
goUpButton->onClick = [this]() { goUp(); };
goUpButton->onClick = [this] { goUp(); };
goUpButton->setTooltip (TRANS ("Go up to parent directory"));
if (previewComp != nullptr)


+ 3
- 3
modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.cpp View File

@@ -104,9 +104,9 @@ FileChooserDialogBox::FileChooserDialogBox (const String& name,
setResizable (true, true);
setResizeLimits (300, 300, 1200, 1000);
content->okButton.onClick = [this]() { okButtonPressed(); };
content->cancelButton.onClick = [this]() { closeButtonPressed(); };
content->newFolderButton.onClick = [this]() { createNewFolder(); };
content->okButton.onClick = [this] { okButtonPressed(); };
content->cancelButton.onClick = [this] { closeButtonPressed(); };
content->newFolderButton.onClick = [this] { createNewFolder(); };
content->chooserComponent.addListener (this);


+ 5
- 5
modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.cpp View File

@@ -41,18 +41,18 @@ FileSearchPathListComponent::FileSearchPathListComponent()
listBox.setOutlineThickness (1);
addAndMakeVisible (addButton);
addButton.onClick = [this]() { addPath(); };
addButton.onClick = [this] { addPath(); };
addButton.setConnectedEdges (Button::ConnectedOnLeft | Button::ConnectedOnRight | Button::ConnectedOnBottom | Button::ConnectedOnTop);
addAndMakeVisible (removeButton);
removeButton.onClick = [this]() { deleteSelected(); };
removeButton.onClick = [this] { deleteSelected(); };
removeButton.setConnectedEdges (Button::ConnectedOnLeft | Button::ConnectedOnRight | Button::ConnectedOnBottom | Button::ConnectedOnTop);
addAndMakeVisible (changeButton);
changeButton.onClick = [this]() { editSelected(); };
changeButton.onClick = [this] { editSelected(); };
addAndMakeVisible (upButton);
upButton.onClick = [this]() { moveSelection (-1); };
upButton.onClick = [this] { moveSelection (-1); };
auto arrowColour = findColour (ListBox::textColourId);
@@ -67,7 +67,7 @@ FileSearchPathListComponent::FileSearchPathListComponent()
}
addAndMakeVisible (downButton);
downButton.onClick = [this]() { moveSelection (1); };
downButton.onClick = [this] { moveSelection (1); };
{
Path arrowPath;


+ 2
- 2
modules/juce_gui_basics/filebrowser/juce_FilenameComponent.cpp View File

@@ -45,7 +45,7 @@ FilenameComponent::FilenameComponent (const String& name,
filenameBox.setEditableText (canEditFilename);
filenameBox.setTextWhenNothingSelected (textWhenNothingSelected);
filenameBox.setTextWhenNoChoicesAvailable (TRANS ("(no recently selected files)"));
filenameBox.onChange = [this]() { setCurrentFile (getCurrentFile(), true); };
filenameBox.onChange = [this] { setCurrentFile (getCurrentFile(), true); };
setBrowseButtonText ("...");
@@ -90,7 +90,7 @@ void FilenameComponent::lookAndFeelChanged()
addAndMakeVisible (browseButton = getLookAndFeel().createFilenameComponentBrowseButton (browseButtonText));
browseButton->setConnectedEdges (Button::ConnectedOnLeft);
browseButton->onClick = [this]() { showChooser(); };
browseButton->onClick = [this] { showChooser(); };
resized();
}


+ 1
- 1
modules/juce_gui_basics/layout/juce_SidePanel.cpp View File

@@ -37,7 +37,7 @@ SidePanel::SidePanel (StringRef title, int width, bool positionOnLeft,
addAndMakeVisible (titleLabel);
dismissButton.onClick = [this]() { showOrHide (false); };
dismissButton.onClick = [this] { showOrHide (false); };
addAndMakeVisible (dismissButton);
Desktop::getInstance().addGlobalMouseListener (this);


+ 1
- 1
modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp View File

@@ -436,7 +436,7 @@ void TabbedButtonBar::updateTabPositions (bool animate)
addAndMakeVisible (extraTabsButton = lf.createTabBarExtrasButton());
extraTabsButton->setAlwaysOnTop (true);
extraTabsButton->setTriggeredOnMouseDown (true);
extraTabsButton->onClick = [this]() { showExtraItemsMenu(); };
extraTabsButton->onClick = [this] { showExtraItemsMenu(); };
}
auto buttonSize = jmin (proportionOfWidth (0.7f), proportionOfHeight (0.7f));


+ 2
- 2
modules/juce_gui_basics/mouse/juce_DragAndDropContainer.cpp View File

@@ -323,7 +323,7 @@ private:
if (owner.shouldDropFilesWhenDraggedExternally (details, files, canMoveFiles) && ! files.isEmpty())
{
MessageManager::callAsync ([=]() { DragAndDropContainer::performExternalDragDropOfFiles (files, canMoveFiles); });
MessageManager::callAsync ([=] { DragAndDropContainer::performExternalDragDropOfFiles (files, canMoveFiles); });
deleteSelf();
return;
}
@@ -332,7 +332,7 @@ private:
if (owner.shouldDropTextWhenDraggedExternally (details, text) && text.isNotEmpty())
{
MessageManager::callAsync ([=]() { DragAndDropContainer::performExternalDragDropOfText (text); });
MessageManager::callAsync ([=] { DragAndDropContainer::performExternalDragDropOfText (text); });
deleteSelf();
return;
}


+ 1
- 1
modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm View File

@@ -368,7 +368,7 @@ MultiTouchMapper<UITouch*> UIViewComponentPeer::currentTouches;
// On some devices the screen-size isn't yet updated at this point, so also trigger another
// async update to double-check..
MessageManager::callAsync ([=]() { sendScreenBoundsUpdate (self); });
MessageManager::callAsync ([=] { sendScreenBoundsUpdate (self); });
}
- (BOOL) prefersStatusBarHidden


+ 1
- 1
modules/juce_gui_basics/native/juce_ios_Windowing.mm View File

@@ -134,7 +134,7 @@ namespace juce
}
}];
MessageManager::callAsync ([self,application,app]() { app->suspended(); });
MessageManager::callAsync ([self,application,app] { app->suspended(); });
#else
ignoreUnused (application);
app->suspended();


+ 1
- 1
modules/juce_gui_basics/native/juce_mac_MainMenu.mm View File

@@ -209,7 +209,7 @@ public:
item.commandManager->invoke (info, true);
}
MessageManager::callAsync ([=]()
MessageManager::callAsync ([=]
{
if (instance != nullptr)
instance->invokeDirectly (item.itemID, topLevelIndex);


+ 1
- 1
modules/juce_gui_basics/native/juce_win32_FileChooser.cpp View File

@@ -279,7 +279,7 @@ private:
threadHasReference.signal();
Array<URL> r = openDialog (true);
MessageManager::callAsync ([safeThis, r]()
MessageManager::callAsync ([safeThis, r]
{
safeThis->results = r;


+ 1
- 1
modules/juce_gui_basics/properties/juce_BooleanPropertyComponent.cpp View File

@@ -36,7 +36,7 @@ BooleanPropertyComponent::BooleanPropertyComponent (const String& name,
{
addAndMakeVisible (button);
button.setClickingTogglesState (false);
button.onClick = [this]() { setState (! getState()); };
button.onClick = [this] { setState (! getState()); };
}
BooleanPropertyComponent::BooleanPropertyComponent (const Value& valueToControl,


+ 1
- 1
modules/juce_gui_basics/properties/juce_ButtonPropertyComponent.cpp View File

@@ -32,7 +32,7 @@ ButtonPropertyComponent::ButtonPropertyComponent (const String& name, bool trigg
{
addAndMakeVisible (button);
button.setTriggeredOnMouseDown (triggerOnMouseDown);
button.onClick = [this]() { buttonClicked(); };
button.onClick = [this] { buttonClicked(); };
}
ButtonPropertyComponent::~ButtonPropertyComponent()


+ 2
- 2
modules/juce_gui_basics/widgets/juce_Slider.cpp View File

@@ -567,10 +567,10 @@ public:
if (style == IncDecButtons)
{
owner.addAndMakeVisible (incButton = lf.createSliderButton (owner, true));
incButton->onClick = [this]() { incrementOrDecrement (interval); };
incButton->onClick = [this] { incrementOrDecrement (interval); };
owner.addAndMakeVisible (decButton = lf.createSliderButton (owner, false));
decButton->onClick = [this]() { incrementOrDecrement (-interval); };
decButton->onClick = [this] { incrementOrDecrement (-interval); };
if (incDecButtonMode != incDecButtonsNotDraggable)
{


+ 3
- 3
modules/juce_gui_basics/widgets/juce_Toolbar.cpp View File

@@ -246,7 +246,7 @@ Toolbar::Toolbar()
addChildComponent (missingItemsButton = getLookAndFeel().createToolbarMissingItemsButton (*this));
missingItemsButton->setAlwaysOnTop (true);
missingItemsButton->onClick = [this]() { showMissingItems(); };
missingItemsButton->onClick = [this] { showMissingItems(); };
}
Toolbar::~Toolbar()
@@ -733,13 +733,13 @@ private:
styleBox.setSelectedId (selectedStyle);
styleBox.onChange = [this]() { updateStyle(); };
styleBox.onChange = [this] { updateStyle(); };
}
if ((optionFlags & Toolbar::showResetToDefaultsButton) != 0)
{
addAndMakeVisible (defaultButton);
defaultButton.onClick = [this]() { toolbar.addDefaultItems (factory); };
defaultButton.onClick = [this] { toolbar.addDefaultItems (factory); };
}
addAndMakeVisible (instructions);


+ 1
- 1
modules/juce_gui_basics/windows/juce_ComponentPeer.cpp View File

@@ -540,7 +540,7 @@ bool ComponentPeer::handleDragDrop (const ComponentPeer::DragInfo& info)
// We'll use an async message to deliver the drop, because if the target decides
// to run a modal loop, it can gum-up the operating system..
MessageManager::callAsync ([=]()
MessageManager::callAsync ([=]
{
if (auto* c = targetComp.get())
{


+ 1
- 1
modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.cpp View File

@@ -393,7 +393,7 @@ KeyMappingEditorComponent::KeyMappingEditorComponent (KeyPressMappingSet& mappin
{
addAndMakeVisible (resetButton);
resetButton.onClick = [this]()
resetButton.onClick = [this]
{
AlertWindow::showOkCancelBox (AlertWindow::QuestionIcon,
TRANS("Reset to defaults"),


+ 5
- 5
modules/juce_gui_extra/native/juce_android_PushNotifications.cpp View File

@@ -492,7 +492,7 @@ struct PushNotifications::Pimpl
void notifyListenersTokenRefreshed (const String& token)
{
#if defined(JUCE_FIREBASE_INSTANCE_ID_SERVICE_CLASSNAME)
MessageManager::callAsync ([this, token]()
MessageManager::callAsync ([this, token]
{
owner.listeners.call ([&] (Listener& l) { l.deviceTokenRefreshed (token); });
});
@@ -587,7 +587,7 @@ struct PushNotifications::Pimpl
#if defined(JUCE_FIREBASE_MESSAGING_SERVICE_CLASSNAME)
GlobalRef rn (remoteNotification.get());
MessageManager::callAsync ([this, rn]()
MessageManager::callAsync ([this, rn]
{
auto notification = firebaseRemoteNotificationToJuceNotification (rn.get());
owner.listeners.call ([&] (Listener& l) { l.handleNotification (false, notification); });
@@ -600,7 +600,7 @@ struct PushNotifications::Pimpl
void notifyListenersAboutRemoteNotificationsDeleted()
{
#if defined(JUCE_FIREBASE_MESSAGING_SERVICE_CLASSNAME)
MessageManager::callAsync ([this]()
MessageManager::callAsync ([this]
{
owner.listeners.call ([] (Listener& l) { l.remoteNotificationsDeleted(); });
});
@@ -612,7 +612,7 @@ struct PushNotifications::Pimpl
#if defined(JUCE_FIREBASE_MESSAGING_SERVICE_CLASSNAME)
GlobalRef mid (messageId);
MessageManager::callAsync ([this, mid]()
MessageManager::callAsync ([this, mid]
{
auto midString = juceString ((jstring) mid.get());
owner.listeners.call ([&] (Listener& l) { l.upstreamMessageSent (midString); });
@@ -628,7 +628,7 @@ struct PushNotifications::Pimpl
#if defined(JUCE_FIREBASE_MESSAGING_SERVICE_CLASSNAME)
GlobalRef mid (messageId), e (error);
MessageManager::callAsync ([this, mid, e]()
MessageManager::callAsync ([this, mid, e]
{
auto midString = juceString ((jstring) mid.get());
auto eString = juceString ((jstring) e.get());


+ 1
- 1
modules/juce_gui_extra/native/juce_linux_XEmbedComponent.cpp View File

@@ -523,7 +523,7 @@ private:
if (allowResize)
configureNotify();
else
MessageManager::callAsync ([this]() {componentMovedOrResized (owner, true, true);});
MessageManager::callAsync ([this] {componentMovedOrResized (owner, true, true);});
return true;
}


+ 2
- 2
modules/juce_product_unlocking/native/juce_ios_InAppPurchases.cpp View File

@@ -633,7 +633,7 @@ struct InAppPurchases::Pimpl : public SKDelegateAndPaymentObserver
}
}
MessageManager::callAsync ([this, purchases]() { owner.listeners.call ([&] (Listener& l) { l.purchasesListRestored (purchases, true, NEEDS_TRANS ("Success")); }); });
MessageManager::callAsync ([this, purchases] { owner.listeners.call ([&] (Listener& l) { l.purchasesListRestored (purchases, true, NEEDS_TRANS ("Success")); }); });
return;
}
}
@@ -649,7 +649,7 @@ struct InAppPurchases::Pimpl : public SKDelegateAndPaymentObserver
void sendReceiptFetchFailAsync()
{
MessageManager::callAsync ([this]() { sendReceiptFetchFail(); });
MessageManager::callAsync ([this] { sendReceiptFetchFail(); });
}
static int64 getPurchaseDateMs (id date)


Loading…
Cancel
Save