[SOLVED] dialogs.TTaskDialog: How to get multi-line values at design- time? lazarus / 31-LCL ---------------------------------------------------------------------- dsiders · 2021-07-06 15:14 I was looking at TTaskDialog in dialogs.pas. It allows multi-line text in selected properties like ExpandedText, Text, et. al. At run-time I can set the value using embedded LF (#10) characters, like: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ADialog.ExpandedText := 'Line One.' + #10 + 'Line Two.' + #10+#10 + 'New paragraph.' ; How would the value be entered at design-time? Would registering a TStringMultiLinePropertyEditor for the properties do the trick? ---------------------------------------------------------------------- lucamar · 2021-07-06 16:24 At design time (or, indeed, in code too) add "\n" to the string and they will be converted to LineEnding(s). ETA: As documented, Quote from: Reference for unit DialogsTTaskDialog.ExpandedText Text that is shown when dialog is expanded. Use "\n" for new lines. ---------------------------------------------------------------------- Bart · 2021-07-06 16:37 Quote from: lucamar on July 06, 2021, 06:24:54 pmAt design time (or, indeed, in code too) add "\n" to the string and they will be converted to LineEnding(s). ETA: As documented, Quote from: Reference for unit DialogsTTaskDialog.ExpandedText Text that is shown when dialog is expanded. Use "\n" for new lines. IIRC then this isn't the case anymore, because a path like 'C:\users\john\nosehair\pictures' would get mangled by it. (ANy windows pat starting with an 'n' to be precise). The alternative would be to have an escape char. In the end it was decided that, since this is Pascal and not C, to not suppoprt the conversion of '\n' to LineEnding anymore. So, in OI you can't I guess (like you cannot for e.g. captions of a button or a label). If this is a very common scenario (having to specify multi line text for that property), then the property editor for that property should be altered maybe? Bart ---------------------------------------------------------------------- Bart · 2021-07-06 16:40 See: https://wiki.lazarus.freepascal.org/Lazarus_2.2.0_release_notes#C onversion_of_.27.5Cn.27_sequences_in_LCLTaskDialog.TTaskDialog Bart ---------------------------------------------------------------------- lucamar · 2021-07-06 17:16 Quote from: Bart on July 06, 2021, 06:40:23 pmSee: https://wiki.lazaru s.freepascal.org/Lazarus_2.2.0_release_notes#Conversion_of_.27.5Cn.27_ sequences_in_LCLTaskDialog.TTaskDialog Oops! Didn't remember that little tidbit for next release Thanks for pointng it out, Bart, and sorry for the non future-proof advice, dsiders ---------------------------------------------------------------------- dsiders · 2021-07-06 18:01 Quote from: lucamar on July 06, 2021, 07:16:13 pmOops! Didn't remember that little tidbit for next release Thanks for pointng it out, Bart, and sorry for the non future-proof advice, dsiders No problem. I didn't mention that I was using Lazarus trunk either. ---------------------------------------------------------------------- dsiders · 2021-07-06 18:28 Quote from: lucamar on July 06, 2021, 06:24:54 pmAt design time (or, indeed, in code too) add "\n" to the string and they will be converted to LineEnding(s). ETA: As documented, Quote from: Reference for unit DialogsTTaskDialog.ExpandedText Text that is shown when dialog is expanded. Use "\n" for new lines. The documentation is what I was updating... to reflect the new usage. I discovered while playing with it that the OI doesn't allow entry of the multi-line value. Other properties, like Caption and Hint, use TStringMultilinePropertyEditor in the OI. I was was looking for confirmation (or denial) that this was a workable solution. I was going to tinker... [EDIT] Patch submitted https://bugs.freepascal.org/view.php?id=39170 ---------------------------------------------------------------------- Bart · 2021-07-06 20:22 Quote from: dsiders on July 06, 2021, 08:28:01 pm[EDIT] Patch submitted https://bugs.freepascal.org/view.php?id=39170 And already applied by Juha. Bart