TextEditor virtual methods request

Hi Jules and everybody,

I’m trying to make a new TextEditor component (for example I want a different shape for the box). Having a look in the api I found that TextEditor methods are not virtual, so I can’t inheritance and re-implement the paint method

Do you think it would be possible to make some of that functions virtual so we can re-implement them?

I don’t know if there is a better way to do it but I think it would be interesting to have this change.

Thanks!!
A

Have you checked out the LookAndFeel class?

HTH

The TextEditor component inherit from Component which have its paint method virtual. So TextEditor::paint IS actually virtual.

loca

LookAndFeel objects define the appearance of all the JUCE widgets, and subclasses can be used to apply different 'skins' to the application.

If you want “a different shape for the box” then you can make a subclass of LookAndFeel and implement your own version of:

void LookAndFeel::drawTextEditorOutline (Graphics& g, int width, int height, TextEditor& textEditor)

and give the text editor “box” rounded corners for example.