ComboBox documentation problem


#1

Hi,

on ComboBox documentation page (http://www.juce.com/api/classComboBox.html) there is a sentence (enum ComboBox::ColourIds) that does look a bit incomplete

 

To change the colours of the menu that pops up

...almost as if your phone rang in the middle of the writing.

 

Anyway I need to know what was the sentence trying to say. In my case I want to have the ComboBox list drawn with different colors than the rest of the popup menus. How would I do that? Because I cannot change the default color in the LookAndFeel, cause it would affect all the popup menus. I also cannot set the colors individually for the ComboBox, because the ComboBox list is created dynamically and I don't have access to the menu object. Or do I?


#2

Thanks, yes, it looks like I had to run away in mid-sentence!

I think it should have said "To change the colours of the menu that pops up, you can set the colour IDs in PopupMenu::ColourIDs."


#3

I think it should have said "To change the colours of the menu that pops up, you can set the colour IDs in PopupMenu::ColourIDs."

Well, that is what was afraid of... Do you see any way to change the background colour of the ComboBox drop down but not the rest of the popup menus? The thing is that the popup menu for ComboBox is created dynamically, thus I have no access to it and cannot set the colours individually...


#4

You can probably just set these colours for the combobox itself rather than changing them in a global lookandfeel.


#5

I have tried that already. Like this:

 

channelComboBox.setColour(PopupMenu::backgroundColourId, Colour(255,0,0)); //that's just an example, it would look terrible...

 

But the color stays the same as for any other popup menu. Either it does not work like this, or some kind of refresh is needed.

 

 Just so you may wanna know (it has nothing to do with the question above): I noticed that MainMenu bar height is not refreshed when changing the look and feel (you probably never noticed cause all the 3 lookandfeels have the same menu bar height...).


#6

You can probably just set these colours for the combobox itself rather than changing them in a global lookandfeel.

No, I'm pretty sure I can't... Though it would be really nice it worked that way.

 

The ComboBox::showPopup() would have to pass the colors to the newly created PopupMenu which it doesn't. It only sets the popup menu's LookAndFeel which makes it draw the ComboBox drop down the same way as all the other popup menus...