Recent

Author Topic: Missing line in ShowHint  (Read 4037 times)

Josh

  • Hero Member
  • *****
  • Posts: 1350
Re: Missing line in ShowHint
« Reply #15 on: June 08, 2024, 09:06:52 pm »
just done a test with hint of tbutton with your text (moded) displays fine, changed hint font to a mono font

The best way to get accurate information on the forum is to post something wrong and wait for corrections.

dsiders

  • Hero Member
  • *****
  • Posts: 1326
Re: Missing line in ShowHint
« Reply #16 on: June 09, 2024, 12:43:48 am »
just done a test with hint of tbutton with your text (moded) displays fine, changed hint font to a mono font

So far, the only thing we don;t know is what weird WM/DE/Theme combination the OP is using.
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

jipété

  • Full Member
  • ***
  • Posts: 182
Re: Missing line in ShowHint
« Reply #17 on: June 09, 2024, 08:38:20 am »
Hello,

just done a test with hint of tbutton with your text (moded) displays fine, changed hint font to a mono font
Glad for you to have a perfect result. Just one question: what operating system and what versions of FPC and Lazarus?

So far, the only thing we don't know is what weird WM/DE/Theme combination the OP is using.
WM/DE = Debian-OpenBox-LXDE, no theme used.

Have a nice day,

jamie

  • Hero Member
  • *****
  • Posts: 6791
Re: Missing line in ShowHint
« Reply #18 on: June 09, 2024, 08:54:14 pm »
Are you using SHORT strings in your code ?
The only true wisdom is knowing you know nothing

jipété

  • Full Member
  • ***
  • Posts: 182
Re: Missing line in ShowHint
« Reply #19 on: June 09, 2024, 11:33:53 pm »
Are you using SHORT strings in your code ?
No.

No code is used for displaying the Hint Window : I fill the Project Inspector by Copy/Paste with the values found in BGRABitmapType and one can read, in the bottom of the Project Inspector when the Hint property is selected, "Hint is a TTranslateString property with hint text displayed in a pop-up window when the mouse is hovered over the control..."

One more time, the content of my .lfm, section RadioGroup :
Code: Pascal  [Select][+][-]
  1.     object rdgResFilters: TRadioGroup
  2.       ...
  3.       Hint = 'Box          Equivalent of simple stretch with high quality and pixel-centered coordinates'#10'Linear       Linear interpolation giving slow transition between pixels'#10'HalfCosine   Mix of Linear and Cosine giving medium speed transition between pixels'#10'Cosine       Cosine-like interpolation giving fast transition between pixels'#10'Bicubic      Simple bi-cubic filter (blurry)'#10'Mitchell     Good for downsizing interpolation'#10'Spline       Good for upsizing interpolation, however slightly blurry'#10'Lanczos2     Lanczos with radius 2, blur is corrected'#10'Lanczos3     Lanczos with radius 3, high contrast'#10'Lanczos4     Lanczos with radius 4, high contrast'#10'BestQuality  Best quality using Mitchell or Spline'#10'  '
  4.       ...
  5.       Items.Strings = (
  6.         'Box          Equivalent of simple stretch with high quality and pixel-centered coordinates'
  7.         'Linear       Linear interpolation giving slow transition between pixels'
  8.         'HalfCosine   Mix of Linear and Cosine giving medium speed transition between pixels'
  9.         'Cosine       Cosine-like interpolation giving fast transition between pixels'
  10.         'Bicubic      Simple bi-cubic filter (blurry)'
  11.         'Mitchell     Good for downsizing interpolation'
  12.         'Spline       Good for upsizing interpolation, however slightly blurry'
  13.         'Lanczos2     Lanczos with radius 2, blur is corrected'
  14.         'Lanczos3     Lanczos with radius 3, high contrast'
  15.         'Lanczos4     Lanczos with radius 4, high contrast'
  16.         'BestQuality  Best quality using Mitchell or Spline'
  17.       )
  18.       ...
  19.     end

And again, the 8 characters following the words
Code: Pascal  [Select][+][-]
  1. 'BestQuality  Best quality using Mitchell or Spline'
, " #10'  ' ",
are added by me so I can read the last sentence.
If I don't add them, no last sentence is visible, the HintWindow ends up with
Code: Pascal  [Select][+][-]
  1. 'Lanczos4     Lanczos with radius 4, high contrast'
, followed by an empty line.
To avoid it, I must limit the number of lines to 8, but doing that, I loose 3 hints, not fun...  %)
« Last Edit: June 09, 2024, 11:47:21 pm by jipété »

jamie

  • Hero Member
  • *****
  • Posts: 6791
Re: Missing line in ShowHint
« Reply #20 on: June 09, 2024, 11:50:37 pm »
have you implemented the "OnShowHint" event, so you can examine the last line of the text ?

 It appears you are on a nix and from what little I know about them, they use only a #10 as new line characters.

 It could also be the last line in the hint text has a LineFeed/CR trailing at the end.

 But you can see all of this if you examine the string during the OnShowHint event.
The only true wisdom is knowing you know nothing

jipété

  • Full Member
  • ***
  • Posts: 182
Re: Missing line in ShowHint
« Reply #21 on: June 10, 2024, 12:37:03 am »
have you implemented the "OnShowHint" event, so you can examine the last line of the text ?
No. I didn't know that.

It appears you are on a nix and from what little I know about them, they use only a #10 as new line characters.
Yes yes. But if I only have 8 items or less, EVERYTHING WORKS FINE.

It could also be the last line in the hint text has a LineFeed/CR trailing at the end.
No.
Look at the screenshot below (end of the long hints' line in .lfm posted in my last post).

But you can see all of this if you examine the string during the OnShowHint event.
Dunno what to ask here :
Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormShowHint(Sender: TObject; HintInfo: PHintInfo);
  2. begin
  3.   ???????????????
  4. end;
  5.  
« Last Edit: June 10, 2024, 12:39:24 am by jipété »

jamie

  • Hero Member
  • *****
  • Posts: 6791
Re: Missing line in ShowHint
« Reply #22 on: June 10, 2024, 01:42:57 am »
I don't care what the lfm file holds.

PHintInfo^.hintstr holds the string that is going to be displayed.

You need to examine that one.

make a reference to it so the debugger can stop and show you the contents.
The only true wisdom is knowing you know nothing

jipété

  • Full Member
  • ***
  • Posts: 182
Re: Missing line in ShowHint
« Reply #23 on: June 10, 2024, 06:32:06 am »
Hello,
PHintInfo^.hintstr holds the string that is going to be displayed.

make a reference to it...
First time in my life that someone asks me to do that.
I don't know what you want, I don't understand what you mean...

Tried the following (see screenshot) but compiler not happy.

cdbc

  • Hero Member
  • *****
  • Posts: 1779
    • http://www.cdbc.dk
Re: Missing line in ShowHint
« Reply #24 on: June 10, 2024, 06:35:30 am »
Hi
The variable HintInfo IS a PHintInfo...!
So, try with
Code: Pascal  [Select][+][-]
  1. S:= HintInfo^.hintstr;
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

jipété

  • Full Member
  • ***
  • Posts: 182
Re: Missing line in ShowHint
« Reply #25 on: June 10, 2024, 06:45:17 am »
Ok, so I tried the following :
Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormShowHint(Sender: TObject; HintInfo: PHintInfo);
  2. var s: string;
  3. begin
  4.   s := HintInfo^.HintStr;  // <--- the breakpoint here
  5.   memo1.Append(s);
  6. end;

and nothing is displayed in the memo, after a MouseMove on the radiogroup...
EDIT :
If I add a Breakpoint on line 4 above, a MouseMove over the radiogroup shows the HintWindow but doesn't break the flow of instructions...  :o
« Last Edit: June 10, 2024, 10:11:32 am by jipété »

 

TinyPortal © 2005-2018