Button::internalClickCallback commit [9d50560] breaks setClickingTogglesState and clicktogglestate


Jules, after updating an app immediately didnt passed tests, as we checked i tried to isolate the bug to the simplest form:

addAndMakeVisible (&someButton);
someButton.setBounds(10, 7, 56, 56);
someButton.setRadioGroupId(666, sendNotification);

addAndMakeVisible (&otherButton);
otherButton.setBounds(76, 7, 56, 56);
otherButton.setRadioGroupId(666, sendNotification);

On Button Clicked:

if (activeButton == &someButton)
   DBG("someButton clicked");
else if (activeButton == &otherButton)
   DBG("otherButton clicked");

And the dbg statement shows that the buttons got somehow inverted in no time, this was caused by commit: 

[9d50560]  Stopped buttons with auto-toggle sending duplicated events

Reverting commit modification makes app pass tests again:

void Button::internalClickCallback (const ModifierKeys& modifiers)


    if (clickTogglesState)

        setToggleState (radioGroupId != 0 || ! lastToggleState, sendNotification);


    sendClickMessage (modifiers);




This happens with Juce latest pull.


That last commit was an attempt to fix this: http://www.juce.com/forum/topic/drawablebutton-not-showing-correct-image

..but I've had yet another go at this now, let me know if it solves what you're seeing.


Thanks Jules, Commit bbd620c fixes this, I also noticed the strange drawable buttons behavior, that also seems gone.