I’d like the “editor” member of the Label class to be protected, since I need to addToDesktop() it in a subclass of Label.
This is because I found no other way to overcome the bug of some hosts not passing pressed keys to plug-ins. The only solution that works on some hosts (i.e. Ableton Live on Windows) is to have the TextEditor added to the desktop for proper input by the user.
I thought of adding my custom code in createEditorComponent, which is virtual, but unfortunately moving the TextEditor to the desktop at that time is too early for two reasons:
Label calls enterModalState() on itself inside showEditor(), thus disabling any possibility of acting on the TextEditor if it is on the desktop rather than a child of the Label itself
I can’t addToDesktop the TextEditor when it is created, because its size and position are not correct at that time. Indeed they are set up later in showEditor(), when the resized() call is made, much later than createEditorComponent has been called.
Because of these reasons, I thought of re-writing myself the two methods showEditor and hideEditor, but I can’t do that as the editor member is protected.
Even better, adding two empty protected virtual functions editorShown and editorBeingHidden would greatly help in customizing the behaviour of the TextEditor, in the same direction of what createEditorComponent is supposed to lead.