On my way to implement a LookAndFeel for popup menu, I succeded in drawing a red background for popup menu, but I could not find a way to change the font, when apparently the method is the strictly the same !
in .h :
[code]class My_Look_And_Feel : public Component,
public LookAndFeel
{
public:
//==============================================================================
My_Look_And_Feel ();
~My_Look_And_Feel();
//==============================================================================
//[UserMethods] -- You can add your own custom methods in this section.
void drawPopupMenuBackground (Graphics &g, int width, int height);
const Font getMenuBarFont (MenuBarComponent &menuBar,int itemIndex, const String & itemText);
//[/UserMethods]
void paint (Graphics& g);
void resized();
juce_UseDebuggingNewOperator
private:
My_Look_And_Feel (const My_Look_And_Feel&);
const My_Look_And_Feel& operator= (const My_Look_And_Feel&);
};[/code]
And in the cpp file :
[code]void My_Look_And_Feel::drawPopupMenuBackground (Graphics &g, int width, int height)
{
g.fillAll (Colours::red);
} <<<<< this one gets called
const Font My_Look_And_Feel::getMenuBarFont(MenuBarComponent &menuBar, int itemIndex, const String & itemText)
{
Font myFont;
myFont.setSizeAndStyle((float)(6),0,1.0f,0.0f);
myFont.setItalic(true);
myFont.setBold(true);
return myFont;
} <<<<< this one never gets called[/code]
It must be some syntax problem, I really don’t have any clue, the getMenuBarFont seems to never be called, what am I doing wrong ?
Nicolas