Hey,
I have Texteditor that is set to multiline mode with word wrap. Entered text is displayed and wrapped correctly. But if the default text is longer than a single line it gets chopped of.
Best,
Thomas
Hey,
I have Texteditor that is set to multiline mode with word wrap. Entered text is displayed and wrapped correctly. But if the default text is longer than a single line it gets chopped of.
Best,
Thomas
And the default text justification doesn’t match the regular text justification. It’s just always centered.
Try
setMultiLine(true, true);
https://docs.juce.com/master/classTextEditor.html#a939bf23c983f695379a92f9612928160
As I’ve said:
Multiline works. But only for the actual text. But you can also set a default text that is shown when the editor is empty. And this default text doesn’t get wrapped. It’s just a single line with three dots at the end.
I don’t know what a ‘default text’ means.
I use something like this and it works great for me:
class InfoPanel : public TextEditor
{
public:
InfoPanel()
{
setMultiLine(true, true);
setReadOnly(true);
setFont(18.0f);
setText("We are asked to provide more and more bespoke services that are all desirable - but the simple fact is there are too many desirable and deserving issues.");
}
I mean the text set with setTextToShowWhenEmpty().
Oh yes, sorry. I think Juce presumes it’ll be a simple instruction to the user, like ‘user name’ which will be short and to the point.
As of JUCE v7.0.6 this is still an issue.
myTextEditor.setMultiLine(true, true);
myTextEditor.setTextToShowWhenEmpty("A string which is longer than what "
"can fit into the TextEditor without wrapping");
The resulting TextEditor elides the default text.
Also, any attempt to workaround by manually inserting line breaks doesn’t work either (see this feature request).