Copy link to clipboard
Copied
And, if there is a way, to make it obvious in the API and/or documentation.
Thanks,
Rob
Answer: set allow_newlines = true in edit_field, e.g.
vf:edit_field {
-- ...
allow_newlines = true,
}
Enter/return key will then have the effect hoped for: a newline instead of OK'ing the dialog box.
PS - credit to John Ellis for informing me/us of this undocumented feature.
Copy link to clipboard
Copied
Any idea, is this feature request imlpemented yet? Can not find in documentation how do enable it...
Copy link to clipboard
Copied
Serhit wrote:
is this feature request imlpemented yet?
I doubt it.
Copy link to clipboard
Copied
Is the request for a user to be able to do this, or for the fireld to be programattically updated to contain a new line?
A user might be able to shift + enter or alt/option + enter to add a new line. Be aware that if it does work it is likely to be platform specific so make sure to test on both Mac and Windows.
Matt
Copy link to clipboard
Copied
User.
Problem is: if user does the natural thing when editing a multi-line text field (i.e. presses "enter" at end of line), it dismisses the dialog box instead of adding a new-line to the text field.
Copy link to clipboard
Copied
Answer: set allow_newlines = true in edit_field, e.g.
vf:edit_field {
-- ...
allow_newlines = true,
}
Enter/return key will then have the effect hoped for: a newline instead of OK'ing the dialog box.
PS - credit to John Ellis for informing me/us of this undocumented feature.
Copy link to clipboard
Copied
Thanks for that, Rob, got me out of a scrape. Next, obvious, question would be, is there any way to enable scroll bars on the field, for when the text is too large for the field?
Copy link to clipboard
Copied
You bet Kimaldis.
Well, multi-line edit fields do scroll if you cursor down.., but if you want scroll bars then you have to put them in a scrolled_view container (see LrView).
Rob
Copy link to clipboard
Copied
Thanks, Rob. Of course the edit_field never changes size to accommodate more rows or columns but I can kind of get round that just by making it large. I'm hazarding that there might be a way to tie size with input events but I think that's a battle for another day.
Again, thanks for your input.
Copy link to clipboard
Copied
Of course the edit_field never changes size to accommodate more rows or columns
If you make the dialog resizable ("resizable = true") and set all the fill properties correctly, the edit_field will resize as the dialog resizes. It's a pain to figure out how to set the fill properties, but it can be done.