JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::ButtonTracker Class Reference

A class that automatically sends analytics events to the Analytics singleton when a button is clicked. More...

#include <juce_ButtonTracker.h>

Inheritance diagram for juce::ButtonTracker:
Collaboration diagram for juce::ButtonTracker:

Public Member Functions

 ButtonTracker (Button &buttonToTrack, const String &triggeredEventName, const StringPairArray &triggeredEventParameters={}, int triggeredEventType=0)
 Creating one of these automatically sends analytics events to the Analytics singeton when the corresponding button is clicked. More...
 
 ~ButtonTracker () override
 Destructor. More...
 

Private Member Functions

void buttonClicked (Button *) override
 
virtual void buttonStateChanged (Button *)
 Called when the button's state changes. More...
 

Private Attributes

Buttonbutton
 
const String eventName
 
const StringPairArray eventParameters
 
const int eventType
 

Detailed Description

A class that automatically sends analytics events to the Analytics singleton when a button is clicked.

See also
Analytics, AnalyticsDestination::AnalyticsEvent

{Analytics}

Constructor & Destructor Documentation

◆ ButtonTracker()

juce::ButtonTracker::ButtonTracker ( Button buttonToTrack,
const String triggeredEventName,
const StringPairArray triggeredEventParameters = {},
int  triggeredEventType = 0 
)

Creating one of these automatically sends analytics events to the Analytics singeton when the corresponding button is clicked.

The name and parameters of the analytics event will be populated from the variables supplied here. If clicking changes the button's state then the parameters will have a {"ButtonState", "On"/"Off"} entry added.

Parameters
buttonToTrackthe button to track
triggeredEventNamethe name of the generated event
triggeredEventParametersthe parameters to add to the generated event
triggeredEventType(optional) an integer to indicate the event type, which will be set to 0 if not supplied.
See also
Analytics, AnalyticsDestination::AnalyticsEvent

◆ ~ButtonTracker()

juce::ButtonTracker::~ButtonTracker ( )
override

Destructor.

Member Function Documentation

◆ buttonClicked()

void juce::ButtonTracker::buttonClicked ( Button )
overrideprivatevirtual

◆ buttonStateChanged()

virtual void juce::Button::Listener::buttonStateChanged ( Button )
inlinevirtualinherited

Called when the button's state changes.

Member Data Documentation

◆ button

Button& juce::ButtonTracker::button
private

◆ eventName

const String juce::ButtonTracker::eventName
private

◆ eventParameters

const StringPairArray juce::ButtonTracker::eventParameters
private

◆ eventType

const int juce::ButtonTracker::eventType
private

The documentation for this class was generated from the following file: