Recent

Author Topic: Popupmenu show hint on item  (Read 13518 times)

AlistairG

  • Jr. Member
  • **
  • Posts: 70
Popupmenu show hint on item
« on: March 09, 2011, 11:05:19 pm »
Hi I have hints defined, but when mouseover item the hint is not shown in Ubuntu.
Any ideas thanks.
Alistair.
Lazarus 0.9.28.2-10ubuntu1 r22277 FPC 2.4.0 i386-linux-gtk 2 (beta)
       My pledge - if I waste your time, I donate to Lazarus.

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: Popupmenu show hint on item
« Reply #1 on: March 09, 2011, 11:27:45 pm »
Do you have:

ParentShowHint:=False;
ShowHint:=True;
Hint:='My hint';

This works on Kubuntu (Qt).

EDIT: Or did you mean hint over MenuItem. It seems does not work here too.
« Last Edit: March 09, 2011, 11:32:52 pm by Blaazen »
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Popupmenu show hint on item
« Reply #2 on: March 09, 2011, 11:38:17 pm »
Nor here.

Lazarus 0.9.29 r28656 FPC 2.5.1 i386-win32-win32/win64

AlistairG

  • Jr. Member
  • **
  • Posts: 70
Re: Popupmenu show hint on item
« Reply #3 on: March 09, 2011, 11:46:41 pm »
EDIT: Or did you mean hint over MenuItem. It seems does not work here too.

Exactly. I understood that Linux did not do hints so well, but if ur using Windows and its not showing hints then ????
Lazarus 0.9.28.2-10ubuntu1 r22277 FPC 2.4.0 i386-linux-gtk 2 (beta)
       My pledge - if I waste your time, I donate to Lazarus.

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Popupmenu show hint on item
« Reply #4 on: March 10, 2011, 12:13:24 am »

DirkS

  • Sr. Member
  • ****
  • Posts: 251
Re: Popupmenu show hint on item
« Reply #5 on: March 10, 2011, 12:17:53 am »
EDIT: Or did you mean hint over MenuItem. It seems does not work here too.

Exactly. I understood that Linux did not do hints so well, but if ur using Windows and its not showing hints then ????
I thought that Win does not show popup hints for menu items by design.

Gr.
Dirk.

AlistairG

  • Jr. Member
  • **
  • Posts: 70
Re: Popupmenu show hint on item
« Reply #6 on: March 10, 2011, 12:59:03 am »
Another thing which is Delphi related popupmenu is if you enter a '-' in the caption property it displays the caption as a divider.
Is there no such thing in Lazarus/FP?
Tks,
Al.
Lazarus 0.9.28.2-10ubuntu1 r22277 FPC 2.4.0 i386-linux-gtk 2 (beta)
       My pledge - if I waste your time, I donate to Lazarus.

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Popupmenu show hint on item
« Reply #7 on: March 10, 2011, 01:01:21 am »
Yes.

AlistairG

  • Jr. Member
  • **
  • Posts: 70
Re: Popupmenu show hint on item
« Reply #8 on: March 10, 2011, 03:45:15 am »
I am now showing application hints which include popupmenu as follows:

in formcreate:
Application.OnHint := @ShowHint;

procedure TmainForm.ShowHint(Sender: TObject);
var hintstr:string;
begin
try
hintstr:= GetLongHint(Tapplication(sender).Hint);
if hintstr<>'' then Showmessage(hintstr);
except
on e: Exception do
ShowMessage(e.ClassName);
end;
end;

Unfortunately, its throwing an access violation, which I havent been able to sus so far.
Lazarus 0.9.28.2-10ubuntu1 r22277 FPC 2.4.0 i386-linux-gtk 2 (beta)
       My pledge - if I waste your time, I donate to Lazarus.

AlistairG

  • Jr. Member
  • **
  • Posts: 70
Re: Popupmenu show hint on item
« Reply #9 on: March 10, 2011, 09:57:53 pm »
If I get rid of the showmessage (which interferes with messaging) the error above goes duh!

So to get hints all you need is above code and statusbar or balloonhints to replace the showmessage - that works.
Still doesnt sort out why the hints dont work on popupmenu.
Cheers,
Alistair.

Quote
procedure TmainForm.ShowHint(Sender: TObject);
var hintstr:string;
begin
try
hintstr:= GetLongHint(application.hint);
if hintstr<>'' then
begin
trayicon1.BalloonHint:=hintstr;
trayicon1.ShowBalloonHint;
end;
except
on e: Exception do
ShowMessage(e.ClassName);
end;
end;         
Lazarus 0.9.28.2-10ubuntu1 r22277 FPC 2.4.0 i386-linux-gtk 2 (beta)
       My pledge - if I waste your time, I donate to Lazarus.

 

TinyPortal © 2005-2018