ComboBox - Indent and Border customization needed


#1

Hi.

I have a window with TextEditors and ComboBoxes.
I have specified some indents and borders to my TextEditors, but cannot do it to the Label inside the ComboBox.

Two main issues:
[list=1]
[]We don’t have ComboBox::setIndents or ComboBox::setBorderSize.[/]
[]The Label default borders are set to 5,1 and the ComboBox’s defaults for ‘textWhenNothingSelected’ are 2, 1…[/][/list]

Is it possible to allow us to change the border sizes and make the ‘textWhenNothingSelected’ have the same border size as the label (as done in TextEditor)?
I might sound over-pedantic, but these things count…

Thanks.

P.S. forgive me about possible confusion between border size and indent in this case…


#2

You can use a lookandfeel to lay out a combobox in any way you want to, but it’s not something that I think belongs in the class itself.


#3

I somehow overlooked the ComboBox LNF, but I still believe that this line in ComboBox::paint should be changed to the label’s indents, instead of 1, 2…

g.drawFittedText (textWhenNothingSelected, label->getX() + 2, label->getY() + 1, label->getWidth() - 4, label->getHeight() - 2, label->getJustificationType(), jmax (1, (int) (label->getHeight() / label->getFont().getHeight())));