hi,
I wanted more control over the DrawableButtons than what’s available by default with PreferencesPanel (different images when toggle state is true).
So after adding the pages with addSettingsPage(“page name”, NULL, NULL);
I then scan the child components and explicitly call setImages(). the problem is that afterward the button is clickable everywhere but not on the icon image anymore.
I had to use a custom Drawable image with a custom hitTest and createCopy to avoid that.
looking briefly at the Drawable button code my patch shouldn’t be necessary, the following code is already enough to avoid the custom hitTest but it doesn’t work in my case:
if (currentImage != 0)
{
currentImage->setInterceptsMouseClicks (false, false);
addAndMakeVisible (currentImage);
DrawableButton::resized();
}