Recent

Author Topic: [SOLVED] Multiline Hints or Captions? (Mac users: Please test)  (Read 10740 times)

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
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';
« Last Edit: April 22, 2016, 01:34:56 am by Hansaplast »

Blaazen

  • Hero Member
  • *****
  • Posts: 3237
  • POKE 54296,15
    • Eye-Candy Controls
Re: Multiline Hints?
« Reply #1 on: April 15, 2015, 06:09:35 pm »
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.
« Last Edit: April 15, 2015, 06:13:53 pm by Blaazen »
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: Multiline Hints?
« Reply #2 on: April 15, 2015, 08:04:38 pm »
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

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: Multiline Hints?
« Reply #3 on: April 15, 2015, 08:11:28 pm »
I wouldn't mind digging in the IDE code, but I have gotten as far as TPropertyEditor and then I got completely lost ... :-(

BitBangerUSA

  • Full Member
  • ***
  • Posts: 183
Re: Multiline Hints?
« Reply #4 on: April 15, 2015, 08:19:22 pm »
for what it's worth - problem(s) not occurring with Windows 7 and Lazarus 1.2.4 / FPC 2.6.4 / SVN 45510
Lazarus Ver 2.2.6 FPC Ver 3.2.2
Windows 10 Pro 64-bit

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: Multiline Hints?
« Reply #5 on: April 15, 2015, 08:39:56 pm »
Thanks BitBangerUSA for checking ....
So ... this would be a bug in the MacOS X version of Lazarus ...?

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis
Re: Multiline Hints?
« Reply #6 on: April 15, 2015, 09:08:22 pm »
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

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: Multiline Hints?
« Reply #7 on: April 15, 2015, 09:10:14 pm »
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

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: Multiline Hints?
« Reply #8 on: April 15, 2015, 09:12:30 pm »
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4467
  • I like bugs.
Re: Multiline Hints?
« Reply #9 on: May 02, 2015, 10:19:42 am »
I 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.
« Last Edit: May 02, 2015, 11:12:11 am by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: Multiline Hints and Captions? (Mac users - please test!)
« Reply #10 on: May 02, 2015, 10:31:13 am »
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 ...  :D
« Last Edit: May 02, 2015, 10:33:56 am by Hansaplast »

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: Multiline Hints? (Mac users: Please test)
« Reply #11 on: May 04, 2015, 01:47:44 pm »
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

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: Multiline Hints? (Mac users: Please test)
« Reply #12 on: September 10, 2015, 12:36:28 pm »
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

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: Multiline Hints? (Mac users: Please test)
« Reply #13 on: October 06, 2015, 09:03:00 pm »
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

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: Multiline Hints? (Mac users: Please test)
« Reply #14 on: October 06, 2015, 10:17:15 pm »
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?
« Last Edit: October 06, 2015, 10:19:48 pm by Hansaplast »

 

TinyPortal © 2005-2018