[SOLVED] Multiline Hints or Captions? (Mac users: Please test) lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- Hansaplast · 2015-04-15 16:01 I was just wondering if I simply missed something or if something is going wrong ... When I enter the hint property of a TLabel (for example), using the editor, I can enter multiple lines. However,... when I close the editor and open the editor again, it all became one big line (linebreaks replaced with a space). The compiled result will have the same problem. Multiple lines have become one long line. If I assign a multiline string to the hint in core (using LineEnding in between), then this works just fine. Example in the editor (accessed from the '...' button in the Object Inspector): Code: [Select]hint line example 1 hint line example 2 Close editor and open it again, and it will show: Code: [Select]hint line example 1 hint line example 2 Or if you didn't reopen the editor, the hint in the application will be a single line as well. However, when I do this in code, the hint will show a correct multiline hint. Code: [Select]Label1.hint := 'hint line example 1' + LineEnding + 'hint line example 2'; ---------------------------------------------------------------------- Blaazen · 2015-04-15 16:09 I cannot confirm here Laz.1.5 SVN, Linux+Qt. I can repeatedly open the editor and linespacing persists. In running app. is hint displayed correctly. EDIT: Now I noticed it's in category Mac OS X. ---------------------------------------------------------------------- Hansaplast · 2015-04-15 18:04 Thanks Blaazen for checking ... I forgot to mention that I'm using Lazarus 1.2.6, FPC 2.6.4, under MacOS X 10.10.3 (Intel). I can however confirm that this problem has consistently been there under MacOS X for quite a lot of versions. It's only now that it started to annoy me :-) ---------------------------------------------------------------------- Hansaplast · 2015-04-15 18:11 I wouldn't mind digging in the IDE code, but I have gotten as far as TPropertyEditor and then I got completely lost ... :-( ---------------------------------------------------------------------- BitBangerUSA · 2015-04-15 18:19 for what it's worth - problem(s) not occurring with Windows 7 and Lazarus 1.2.4 / FPC 2.6.4 / SVN 45510 ---------------------------------------------------------------------- Hansaplast · 2015-04-15 18:39 Thanks BitBangerUSA for checking .... So ... this would be a bug in the MacOS X version of Lazarus ...? ---------------------------------------------------------------------- exdatis · 2015-04-15 19:08 I use : #13#10 e.g. myString := some_line + #13#10 + new_line etc. ... label.Hint:= myString I have no problem(linux, win7 32bit). ---------------------------------------------------------------------- Hansaplast · 2015-04-15 19:10 Just out of curiosity I installed Windows XP on VMWare Fusion to compare ... This issue also occurs when editing a caption. Multiple lines under Windows for both Hint and Caption, remain multiple lines. On MacOS X however, in both cases, the get mangled into one single line. I posted a bug report for this. ---------------------------------------------------------------------- Hansaplast · 2015-04-15 19:12 Thanks Exdatis! In code this works indeed just fine, the way you do it, or by using the LineEnding constant. I have noticed however that under Windows, both HINT and CAPTION work just fine and maintains the multilines. Under Mac however it does not, even though Carbon seems to support it just fine (as your code proves). ---------------------------------------------------------------------- JuhaManninen · 2015-05-02 08:19 Quote from: Hansaplast on April 15, 2015, 09:10:14 pmI posted a bug report for this. Mac OSX users please test if this can be reproduced. It sounds like a big and visible error but nobody else has reported it nor added comments after reproducing it. ---------------------------------------------------------------------- Hansaplast · 2015-05-02 08:31 Thanks Juha for giving it some extra attention. I'd love to contribute but I have no idea where to find the code that handles this. I have seen this with Lazarus since 0.9.x. Currently I'm running 1.4.0 (FPC 2.6.4) under Yosemite 10.10.3. I have seen this on several Mac's that I have. (Mac Pro, MacBook Pro 15" retina, MacBook Pro 13" retina, with several versions of MacOS X) Maybe other Mac users have not been aware that this was supposed to work. It took me several years to see this as a bug ... ---------------------------------------------------------------------- Hansaplast · 2015-05-04 11:47 For those interested, I've attached some screenshots to illustrate what is happening. Seems that the text editor in Object Inspector filters out the new line character(s) under MacOS X. ---------------------------------------------------------------------- Hansaplast · 2015-09-10 10:36 The problem still persists in 1.4.2, and I'd love to see it fixed for the 1.4.4 release. Is there anyone who can help finding this annoying bug under MacOS X? I have spend a lot of time digging in the code, but it kind-a is over my head. ---------------------------------------------------------------------- Hansaplast · 2015-10-06 19:03 Is there any Mac user who can help me debug this? I have been digging through the Interface code for numerous hours now, each time ending at a point where I just get lost (aka it's a little over my head at times) ... not sure how many Mac users are out there? ---------------------------------------------------------------------- Hansaplast · 2015-10-06 20:17 So far I gotten from: TStringMultilinePropertyEditor.Edit-> SetStrValue -> SetStrProp (in: /Developer/lazarus/components/ideintf/propedits.pp and /usr/local/share/fpcsrc/rtl/objpas/typinfo.pp) At SetStrProp I kind-a get lost, that procedure is just over my head. I'm not a that advanced developer yet ...  I got to TStringMultilinePropertyEditor through the IDE output in Terminal: Code: [Select]AddComponent TLabel Parent=Form1:TForm1 59,89,0,0 Parent is 'Form1:TForm1' TMainIDE.OnPropHookPersistentAdded A Label1:TLabel TPkgManager.AddUnitDependenciesForComponentClasses Extending Uses unit1.pas StdCtrls FindCarbonFontID Error: ATSUFindFontFromName  failed with result -8796 FindCarbonFontID Error: ATSUFindFontFromName  failed with result -8796 FindCarbonFontID Error: ATSUFindFontFromName  failed with result -8796 #################### TOICustomPropertyGrid.DoCallEdit for TStringMultilinePropertyEditor Edit=True Can anyone help me out here? ---------------------------------------------------------------------- Hansaplast · 2016-04-19 11:38 Since this issue still persists, in Lazarus 1.6 / FPC 3.0, I'm yet again try to find where the problem might be so I can try to fix it myself (and contribute to Lazarus). So far I know that adding a Caption or Hint with line breaks works perfectly fine under Windows and Linux. I also know it works when I set these at runtime, and I know that editing the .lfm works as well like so: 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      object Label1: TLabel        Left = 415        Height = 16        Top = 297      Width = 87        Caption = 'Label1'#13#10'Label2'        ParentColor = False        WordWrap = True      end As soon as I enter something in the Caption or Hint in the Object Inspector, the new line and/or carriage return gets filtered out. Can anyone tell me how to debug the object inspector - I suspect the issue is to be found there, and a Carbon specific piece. I just have no idea how to do this. ---------------------------------------------------------------------- jwdietrich · 2016-04-21 10:04 Did you submit a bug report? ---------------------------------------------------------------------- Hansaplast · 2016-04-21 11:22 Yes I did: bugreport And in a different topic, I've started (with help of others) to debug.  It seems that TEdit does not store newline characters under Carbon. Since the Object Inspector uses a TEdit for editing the Caption and Hint properties, newline characters get removed. I am however a little surprised that other Mac users have not encountered this problem ... ---------------------------------------------------------------------- jwdietrich · 2016-04-21 11:47 Quote from: Hansaplast on April 21, 2016, 01:22:10 pmYes I did: bugreport And in a different topic, I've started (with help of others) to debug.  Great! Quote from: Hansaplast on April 21, 2016, 01:22:10 pmI am however a little surprised that other Mac users have not encountered this problem ... Well, I did years ago, but I didn't regard it as important enough to mind it. But it is good that you are caring. ---------------------------------------------------------------------- Hansaplast · 2016-04-21 13:59 Thanks  Well, I do love the Mac and I love Lazarus, but I also like to support Windows and Linux. So I do develop apps for all 3 platforms if I can (it's all freeware, available on my website). Sometimes I really need multi-line captions and hints and ... it's a little annoying to see that Lazarus on the Mac still comes with it's (understandable) hurdles. So instead of complaining, I'm trying to help as far as I can ... ---------------------------------------------------------------------- jwdietrich · 2016-04-21 21:24 Quote from: Hansaplast on April 21, 2016, 03:59:18 pm... it's a little annoying to see that Lazarus on the Mac still comes with it's (understandable) hurdles. So instead of complaining, I'm trying to help as far as I can ...  You are right, the Mac port could well do with some additional care. But this is, as open source software goes. ---------------------------------------------------------------------- Hansaplast · 2016-04-21 23:34 Yeah I suppose so ... anyhoo, I think I fixed it (see the other post).