Copy link to clipboard
Copied
Anybody know how to get a new-line into an edit-field, or some other way to have a multi-line text input?
If there isn't a way then consider this a feature request...
OK, so I found something in the SDK that says I have to disable the default button in order for a new-line to be enterable, but how???
Rob
Copy link to clipboard
Copied
Coincidentally, I was looking at the same issue today. The SDK Guide says:
NOTE: When the user types ENTER/RETURN in an edit field, the default button of the containing dialog is invoked. In the case of an Export dialog section, this is the Export button. If you do not want that to happen, disable the default button until the user indicates that input is done.
In the case of a custom dialog shown by LrDialogs.presentModalDialog(), there doesn't appear to be any documented way of disabling the default "OK" button.
I did notice that (on Windows), when typing into an edit field, typing a Ctrl+J will insert a newline. I'd guess you could also have a "Newline" button that would append a newline to the edit field.
Copy link to clipboard
Copied
OK John - first one to figure out how to disable the default button wins, OK?
(I searched the net and found some other people with the question, but no answer yet...)
Until then, I guess its Ctrl-J & a new-line button - good ideas - thanks.
PS - Would that be Cmd-J on Mac?
Rob
Copy link to clipboard
Copied
Would that be Cmd-J on Mac?
Possibly. But I half-recall that the Mac represents newlines differenly, so I couldn't guess as to whether it would work.
Copy link to clipboard
Copied
I guess one of my Mac client/users will let me know.
Do standby...
(Thanks)
Rob
Copy link to clipboard
Copied
Option-Return should get a newline inserted into a multi-line text field on the Mac.
Copy link to clipboard
Copied
Drarvik,
Thank you for the useful info.
Any idea how to disable that default button?
Rob
Copy link to clipboard
Copied
Chet,
I'm guessing there is no way to not have the text pre-selected in an edit_field, but if you could confirm that (or deny/inform) it would also be appreciated.
Thanks in advance,
Rob
Copy link to clipboard
Copied
To my knowledge, there is indeed no way to not have the text in an edit field be pre-selected.
Copy link to clipboard
Copied
Hi again John,
I've got another problem that the text is always selected, so as soon as the user types it wipes everything out. You wouldn't know how to force an append mode or something would you?
Thanks,
Rob
Copy link to clipboard
Copied
I've got another problem that the text is always selected, so as soon as the user types it wipes everything out. You wouldn't know how to force an append mode or something would you?
No idea on that one.
Copy link to clipboard
Copied
There is a documented way to disable the default button in the *Export* dialog (not in other dialogs). Look for LR_cantExportBecause in the SDK Guide.
Copy link to clipboard
Copied
Thank you - the information is helpful and very much appreciated.
Anything that can be done to remedy this would help at least two plugins .
Rob