I’m looking to add a multiline text editor into one of my projects.
Problem is, I’ve been through all the SEditableTextBox and variants and none seem to allow multi line editing.
They seem to only allow single line edits and the enter key submits the response. (Even if you paste some text with \r\n inside it it seems to get trimmed out).
Is there any way to disable this and allow multiline edits?
That does seem to do the trick for the multiline strings. It doesn’t seem editable though. Looking at the source, it’s missing the TypeChar function stuff set in SEditableText:
void SMultiLineEditableText::TypeChar( const int32 Character )
{
}
It only seems to be used in STestSuite.cpp at the moment, and isn’t editable. Am I missing some way to override the function?
I’ll be honest, our multi-line text editing support has received very little love.
Do you feel confident enough about implementing that function for SMultiLineEditableText (I can’t imagine it will be too different from SEditableText). If you do, that’s great! If not, I’ll raise a bug about it internally.
Cool, if you get it working then a pull request for the change would be awesome
It looks like most of the functions that handle actual text editing are currently stubbed out (more than just TypeChar), so it should hopefully just be a case of implementing them based on SEditableText.
Just to let you know (and I wasn’t aware of this at the time), but someone at Epic has been working on adding a multi-line text edit control to Slate.
They’ve now passed this work over to me to finish off, so hopefully we should have a working (although admittedly basic at this point) multi-line text edit control for 4.3 (we just need to make sure it hasn’t caused any regressions).
I use SMultiLineEditableText right now but the scrollbar is not working.
They are not show, even if I put my own VScrollbar, i traced the code and the problem seam related that they are not in a SMultiLineEditableText child, they exists but not draw since they are not really linked to the main widgets…
SMultiLineEditableTextBox uses the HScrollBar and VScrollBar on SMultiLineEditableText to handle its scrollbars, so it does work (see SMultiLineEditableTextBox::Construct).
How have you set-up your scrollbars? You are responsible for actually adding them to the layout, the HScrollBar and VScrollBar are just handles to the scroll bars that get updated as the text content is changed.
So you’ve added your scrollbars to your widget layout somewhere? As I said before, SMultiLineEditableText will not do this for you, and neither will SMultiLineEditableTextBox if you provide custom scrollbars (as it’s assumed you want to place them at a custom location).
SMultiLineEditableText can appear to scroll even without having actual scrollbars.
The scrollbar padding is only used when SMultiLineEditableTextBox generates its own scrollbars, as it has no control over where your custom ones will be added.