1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-08 04:20:09 +00:00

Used Button::onClick to simplify a bunch of library classes and demo code

This commit is contained in:
jules 2018-01-03 10:45:13 +00:00
parent be5f2d62c4
commit ce8b2d865a
52 changed files with 557 additions and 954 deletions

View file

@ -104,9 +104,10 @@ FileChooserDialogBox::FileChooserDialogBox (const String& name,
setResizable (true, true);
setResizeLimits (300, 300, 1200, 1000);
content->okButton.addListener (this);
content->cancelButton.addListener (this);
content->newFolderButton.addListener (this);
content->okButton.onClick = [this]() { okButtonPressed(); };
content->cancelButton.onClick = [this]() { closeButtonPressed(); };
content->newFolderButton.onClick = [this]() { createNewFolder(); };
content->chooserComponent.addListener (this);
FileChooserDialogBox::selectionChanged();
@ -154,13 +155,6 @@ int FileChooserDialogBox::getDefaultWidth() const
}
//==============================================================================
void FileChooserDialogBox::buttonClicked (Button* button)
{
if (button == &(content->okButton)) okButtonPressed();
if (button == &(content->cancelButton)) closeButtonPressed();
if (button == &(content->newFolderButton)) createNewFolder();
}
void FileChooserDialogBox::closeButtonPressed()
{
setVisible (false);