Forum > LCL

TStatusBar.AutoHint without hint popup?


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 ( 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,4697.0.html, there seems to be a relation to the forms ShowHint property. Is this true?

TIA, Rudi

mas steindorff:
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: ---...
    RgCardType.OnShowHint := @myShowHint;  // RgCardType is a tradiogroup in this case

procedure Tfrm.myShowHint(Sender: TObject; info:PHintinfo);

--- End code ---

<edit>  just retested it and I guess I also get the popup too

mas steindorff:
OK, finally got it working with short and long hints

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

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

--- End code ---

If I start the hint out as '|this is my hint" I do not see the popup

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...



[0] Message Index

Go to full version