Rollo62 538 Posted November 1 (edited) Hi there, I'm not asking how to make it default, this I did already. Every time when dealing with the "Standard Edit.Text" on "Standard Button's", I get to the point where I have and want to enable Edit.TextSettings.WordWrap. I'm wondering, what could be the original reasoning for the decision, to keep wordwrap initially inactive. Shall I keep WordWrap alway Active ? Pro's - Wrapping text in a button is in 95% of the cases a style "bug" and not wanted: The philosophy is "Prefer "info over style" - Under normal conditions, active wordwrap has no negative impact on the display - With normal, 1 line of text, no truncation occurs - Too long text can be more safely identified, more information can be seen - The wordwrap takes place automatically, by the detection of available space - In TButton's default settings, the button can usually display 2 lines of text reasonable well - Multiline text can show more info, even if parts of the text may be invisible - No ability to control what is main the focus of the text to be show - Best use of available display space, to maximize information - Too long texts can be easily spotted by the developer, makes it easier to fix Con's - Wrapping text in a button is in 95% of the cases a style "bug" and not wanted: The philosophy is "Prefer "style over info" - Text display is looking ugly when it wraps, it's formatted and styled - Perhaps slight performance issues, to detect line counts, and so on - The wrap situation cannot be controlled manually, if inactive it just never wrap's - Multiline text can lead to keep the start of the sentence out of the view, showing the middle of the whole text - No ability to control what is main the focus of the text to be show - Some implementation with ellipsis ( tuncated text... ) even reduce the available display space by additional ... characters - Truncated texts can be hardly spotted by the developer, not so easy to fix I wonder, if there is any good reason not to activate wordwrap in any case? Please let me know your opinion, and if you know cases, where the wordwrap is a no-go. Edited November 1 by Rollo62 Share this post Link to post
Remy Lebeau 1418 Posted November 1 6 hours ago, Rollo62 said: I'm wondering, what could be the original reasoning for the decision, to keep wordwrap initially inactive. Well, since TEdit is supposed to be a single-line edit control, it doesn't make sense to enable word-wrapping on it by default. Use TMemo instead if you need a multi-line edit control. Share this post Link to post
Brian Evans 108 Posted November 1 After re-reading the post a couple of times: The poster is talking about the text on buttons in FMX. Share this post Link to post
Rollo62 538 Posted November 1 1 hour ago, Brian Evans said: After re-reading the post a couple of times: The poster is talking about the text on buttons in FMX. Yes, sorry, I should have made that clear. But my question is general. Same is for example VCL.TLabel, actually I'm not sure if wordwrap is active or not, but assume so. Perhaps these settings can be well explained by "history", in the old days it was a more massive mess, to produce multi-line thingies. Nowadays, with 8K screens its better. The "Intended to be one line" answer doesn't really explains a lot. Like said, also the Controls do nicely show Single-Line, while WordWrap on, so it doesn't really to foreced to 1-Line. The problem begins, if the controls receive unsuitable texts or dimensions, or suddenly foreign translation, then the issue gets visible. Why prefer not to handle such issues gracefully? Share this post Link to post
Uwe Raabe 2060 Posted November 1 (edited) With WordWrap = True, the AutoSize property of a Vcl TLabel doesn't work the same as without. Quote When WordWrap is True, the width of the label is fixed. If AutoSize is also True, changes to the text cause the label to change in height. When AutoSize is True and WordWrap is False, the font determines the height of the label, and changes to the text cause the label to change in width. BTW, almost the same holds true for FMX. Edited November 1 by Uwe Raabe 1 Share this post Link to post