Lazarus

Programming => Packages and Libraries => Topic started by: dcminus on January 31, 2018, 01:02:03 am

Title: Trayicon: showballonhint when instead hint (eg.: when mouseover)
Post by: dcminus on January 31, 2018, 01:02:03 am
Hey

should be an easy one but could not think of an elegant way to do this. I would like to show a ballonhint when my cursor is over the trayicon.

thank you,

DC-


Title: Re: Trayicon: showballonhint when instead hint (eg.: when mouseover)
Post by: GAN on January 31, 2018, 05:31:45 am
May be TPopupNotifier http://wiki.lazarus.freepascal.org/TPopupNotifier
Title: Re: Trayicon: showballonhint when instead hint (eg.: when mouseover)
Post by: balazsszekely on January 31, 2018, 05:44:24 am
Set BalloonFlags, BalloonHint, BalloonTimeOut then:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   TrayIcon1.Show;
  4. end;
  5.  
  6. procedure TForm1.TrayIcon1MouseMove(Sender: TObject; Shift: TShiftState; X,
  7.   Y: Integer);
  8. begin
  9.   TrayIcon1.ShowBalloonHint;
  10. end;  
Title: Re: Trayicon: showballonhint when instead hint (eg.: when mouseover)
Post by: dcminus on February 03, 2018, 12:51:39 am
@GetMem: tried the same, but it went blinking mad :/ i should probably add a check if it is already showing and only on mousemove if it is not visible, but could not find .visible for ballonhint

@GAN: hmm, that might be suitible for this.
Title: Re: Trayicon: showballonhint when instead hint (eg.: when mouseover)
Post by: balazsszekely on February 03, 2018, 07:38:41 am
Quote
@GetMem: tried the same, but it went blinking mad :/ i should probably add a check if it is already showing and only on mousemove if it is not visible, but could not find .visible for ballonhint
Works fine with Lazarus trunk/FPC 3.0.4, both under windows and linux. What is your configuration?
Title: Re: Trayicon: showballonhint when instead hint (eg.: when mouseover)
Post by: ASerge on February 03, 2018, 11:46:43 am
@GetMem: tried the same, but it went blinking mad :/ i should probably add a check if it is already showing and only on mousemove if it is not visible, but could not find .visible for ballonhint
Also blinking. Windows 7, Lazarus 1.8
In my opinion, this property is used in different ways. To display information about the application (when you hover the mouse), the Hint property is used. But if the application itself does something and wants to attract the user's attention, then ShowBalloonHint is used. This hint automatically disappears through the specified interval to avoid annoying the user.
TinyPortal © 2005-2018