Skip to content

Commit 48e7062

Browse files
committed
Add action logging for buttons, sliders, and comboboxes
1 parent c5ec71a commit 48e7062

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

JuceLibraryCode/modules/juce_gui_basics/buttons/juce_Button.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
==============================================================================
3333
*/
3434

35+
36+
#include "../Source/Utils/Utils.h"
37+
3538
namespace juce
3639
{
3740

@@ -425,6 +428,8 @@ void Button::sendClickMessage (const ModifierKeys& modifiers)
425428
if (checker.shouldBailOut())
426429
return;
427430

431+
LOGA ("Button '", getName(), "' clicked");
432+
428433
buttonListeners.callChecked (checker, [this] (Listener& l) { l.buttonClicked (this); });
429434

430435
if (checker.shouldBailOut())

JuceLibraryCode/modules/juce_gui_basics/widgets/juce_ComboBox.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
==============================================================================
3333
*/
3434

35+
#include "../Source/Utils/Utils.h"
36+
37+
3538
namespace juce
3639
{
3740

@@ -629,6 +632,8 @@ void ComboBox::removeListener (ComboBox::Listener* l) { listeners.remove (l);
629632
void ComboBox::handleAsyncUpdate()
630633
{
631634
Component::BailOutChecker checker (this);
635+
636+
LOGA ("ComboBox '", getName(), "' selected option ", getSelectedId(), ": ", getText());
632637
listeners.callChecked (checker, [this] (Listener& l) { l.comboBoxChanged (this); });
633638

634639
if (checker.shouldBailOut())

JuceLibraryCode/modules/juce_gui_basics/widgets/juce_Slider.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
==============================================================================
3333
*/
3434

35+
#include "../Source/Utils/Utils.h"
36+
3537
namespace juce
3638
{
3739

@@ -365,6 +367,8 @@ class Slider::Pimpl : public AsyncUpdater, // this needs to be public otherwis
365367
{
366368
cancelPendingUpdate();
367369

370+
LOGA ("Slider '", owner.getName(), "' set value to ", owner.getValue());
371+
368372
Component::BailOutChecker checker (&owner);
369373
listeners.callChecked (checker, [&] (Slider::Listener& l) { l.sliderValueChanged (&owner); });
370374

0 commit comments

Comments
 (0)