I'd like to replace the 'tick' on the ComboBox class with a custom image.
I have attempted to add a StringArray list to a Popup menu, and ->addItems to that popupmenu including the image I wanted to use, and then passed that popupmenu to the comboBox using the .addItemsToMenu function. However considering this is a virtual function, it doesn't seem to be the right approach.
Thoughts on the most straightforward way of doing this?
You inherit this, override the methods you want to change (i.e. https://www.juce.com/doc/structComboBox_1_1LookAndFeelMethods#ae43e629153160f3ff1ddacbad9430fb7 ). Then you set an instance of your look and feel class either to that component or to the parent component as defaultLookAndFeel.
You can use the original drawing code as a starting point: https://github.com/julianstorer/JUCE/blob/master/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp#L1114
The tick is part of the popup menu class, which is inherited by the comboBox class. Would I set a popup menu lookAndFeel and set that to the ComboBox as well? I spent a bit of time on it yesterday and it seems to go beyond a typical LookAndFeel use case.
If anyone else reading this has replaced the 'tick' graphic in the ComboBox class, please let me know your method of doing so.
Ok, I see. The Combobox doensn't inherit the popup menu, but it is created in the showPopup method: https://www.juce.com/doc/classComboBox#a46d401e92f606ef7ffa081d5e0bdb609
This is virtual so that you can override it with your own custom popup mechanism if you need some really unusual behaviour.
But the popup menu takes the default look and feel, so either alter that one, or override this: https://github.com/julianstorer/JUCE/blob/536ca6cedf7b3e373778f653da9e0c1a8e3438b2/modules/juce_gui_basics/widgets/juce_ComboBox.cpp#L531