I'm trying to subclass BooleanPropertyComponent in order to get callbacks when my toggle button is clicked. However setState is not called when I toggle the button... is this normal? If so, how am I supposed to know when the button is toggled?
class MyButtonComponent : public BooleanPropertyComponent
{
public:
MyButtonComponent (const Value &valueToControl, const String &propertyName, const String &buttonText)
: BooleanPropertyComponent (valueToControl, propertyName, buttonText)
{
}
//toggling the button does not call this method
void setState (bool newState) override
{
m_bState = newState;
}
//toggling the button does not call this method either
void buttonClicked (Button * p_pButtonClicked) override
{
}
bool getState () const override
{
return m_bState;
}
private:
bool m_bState;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MyButtonComponent)
};
