Recent

Author Topic: TStatusBar.AutoHint without hint popup?  (Read 6423 times)

Rudi1703

  • Newbie
  • Posts: 2
TStatusBar.AutoHint without hint popup?
« on: June 10, 2010, 02:13:59 pm »
Finally arrived here from D7 (and not quite sure if this is the right place for my question...)

In my D7 apps, I used TStatusBar.AutoHint = true and TForm.ShowHint = false. While the mouse hovers over a component, its hint will be shown in the status bar. This happens regardless of the components property ShowHint. With the components property ShowHint I controlled the hint popup display separately for specific components.

With Lazarus (0.9.28.2 r22279 FPC 2.2.4 i386-win32-win32/win64), I found no way to display the hint in the status bar without getting the popup hint, too.

Is this a bug or a feature? Any work around known?

As of http://www.lazarus.freepascal.org/index.php/topic,4697.0.html, there seems to be a relation to the forms ShowHint property. Is this true?

TIA, Rudi

mas steindorff

  • Hero Member
  • *****
  • Posts: 534
Re: TStatusBar.AutoHint without hint popup?
« Reply #1 on: June 10, 2010, 04:34:06 pm »
from what I remember of D5, it's the same way for Lazarus only the OnShowHint event does not appear in the object inspector (yet).

this works for me:
Code: [Select]
...
   FormCreate
   ...
    RgCardType.OnShowHint := @myShowHint;  // RgCardType is a tradiogroup in this case
end;

procedure Tfrm.myShowHint(Sender: TObject; info:PHintinfo);
begin
  StatusBar1.SimpleText:=info^.HintStr;
end;


<edit>  just retested it and I guess I also get the popup too
« Last Edit: June 10, 2010, 04:36:00 pm by mas steindorff »
windows 10 &11, Ubuntu 21+ IDE 3.2.2 general releases

mas steindorff

  • Hero Member
  • *****
  • Posts: 534
Re: TStatusBar.AutoHint without hint popup?
« Reply #2 on: June 10, 2010, 05:19:06 pm »
OK, finally got it working with short and long hints

Code: [Select]
add this line or use the object inspector
RgCardType.Hint:='short |long hint';

procedure TfrmTConfig.myShowHint(Sender: TObject; info:PHintinfo);
var str:string;
begin
  str:= GetLongHint(Tcontrol(sender).Hint);// info^.HintStr is just the short string
  StatusBar1.SimpleText := str;
end;


If I start the hint out as '|this is my hint" I do not see the popup
windows 10 &11, Ubuntu 21+ IDE 3.2.2 general releases

Rudi1703

  • Newbie
  • Posts: 2
Re: TStatusBar.AutoHint without hint popup?
« Reply #3 on: June 11, 2010, 01:31:19 am »
Thanks mas!

It is sufficient to prefix the hint with "|" to suppress the popup hint. IMHO a little bit more Delphi compatibility would be fine...

Rudi

 

TinyPortal © 2005-2018