More widgets please!

It would be nice to have access to more widgets in the Jucer; for example, I’d like to be able to create different types of buttons (text button with graphic and text, button that is only an image.

I just added imagebuttons to it recently…

Do you mean File->New Button?

No, I mean “create a new ImageButton”.

I must have an older version.

I built 1.45 and I also downloaded it from the download page. Is this change only in SVN?

Edit: Downloaded from SVN and there it is.


This is a pretty old post but you said above that you implemented ImageButton to address (among other things) the text button with graphic and text issue (not being able to simply combine text over an image in a button).

But text option is not available for ImageButton, is it ?

I mean doing something like imageButton.setText("blablabla") will do nothing, right ?

It's a ridiculously old post, I've no idea what state the library was in back in 2007!

Maybe the DrawableButton would do what you need?

Ha ha ! I'm not asking what the library was in 2007, but what it is like now. I thought maybe I was missing something with ImageButton class.

Sorry for the confusion. I guess your answer means that in order to use a button with text and a graphics background your best choice remains a DrawableButton. Thanks for that.


... except that for DrawableButtons the text label will be below the image, not merged on top of it....

... or you can do what I did and use TextButtons, overriding the drawButtonBackground LookAndFeel method, e.g.

void BCMLookAndFeel::drawButtonBackground
    Graphics& g,
    Button& button,
    const Colour& backgroundColour,
    bool isMouseOverButton,
    bool isButtonDown
    bool toggleState = button.getToggleState();

    if (textButtonUp.isValid() && textButtonDown.isValid() && textButtonOverDown.isValid() && textButtonOverUp.isValid())
        Image buttonImage;
        if (isMouseOverButton)
            if (isButtonDown || toggleState)
                buttonImage = textButtonOverDown;
                buttonImage = textButtonOverUp;
            if (isButtonDown || toggleState)
                buttonImage = textButtonDown;
                buttonImage = textButtonUp;
        g.drawImage(buttonImage, 0, 0, buttonImage.getWidth(), buttonImage.getHeight(), 0, 0, buttonImage.getWidth(), buttonImage.getHeight());
        LookAndFeel_V3::drawButtonBackground(g, button, backgroundColour, isMouseOverButton, isButtonDown);

Thank you w_ellis.

I ended up doing something similar using a transparent TextButton over a DrawableImage. But your solution is more elegant.