[lazarus] THintWindow

Shane Miller SMiller1 at stvgb.org
Fri Nov 9 14:48:24 EST 2001


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







More information about the Lazarus mailing list