Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2001-11

THintWindow

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Shane Miller

I have commited the initial code for THintWindow. Here's the skinny:

How to use:
uses Forms;
Var
  MyHints : THintWindow;

constructor TMyForm.Create(owner : TObject);
begin
{
stuff...
...

}

  MyHints := THintWindow.Create(nil);
  MyHints.AutoHide := True;  //hides the hint
  MyHints.HideInterval := 3000;  //3 seconds
end;
procedure TMyForm.Something_happened_so_show_the_hint;
var
  AHint : String;
  Rect : TRect;
begin
  AHint := 'This is my hint.'#10'It is on 2 lines.';  //#10 makes it appear on 2 lines
  Rect := MyHints.CalcHintRect(0,AHint,nil);  //figures out how to size the hint window to fit the text
                                 //0 is the MaxWidth of thew window. Send whatever you like.  0 means no max
  MyHints.ActivateHint(Rect,AHint);
end;

Shane

Reply by email