Recent

Author Topic: Hints in menu items  (Read 6114 times)

tango13

  • New Member
  • *
  • Posts: 36
Hints in menu items
« on: December 09, 2007, 11:08:22 am »
Hi all,

I'm having problems with hints. Specifically what I'd like to do is hide the popup hints and instead make them appear in the status bar.
I set the Hint property of the object, create my custom OnHint method and then do something like Application.OnHint := @MyOnHint in the FormCreate method.

What I get this way is that I can correctly see the hint in the status bar (even though I haven't yet understood how the short/long hints work, I always seem to get the short one whatever I do), but also the popup hint: how can I hide only the popup one?

Moreover, this procedure doesn't work with menu items, I don't see their hints in the status bar, better yet I don't see the menu item hint at all: there doesn't seem to be any hint event fired with menu items.

Am I doing anything wrong? Any... hints? :D

Thanks,
Piero

Bart

  • Hero Member
  • *****
  • Posts: 5306
    • Bart en Mariska's Webstek
Hints in menu items
« Reply #1 on: December 09, 2007, 01:35:19 pm »
AFAIK (from Delphi), this is how it works.

You need to have the parent's form ShowHint  to be true.
Set the showhint on the controls to false: this prevents the popup hint.

In Delphi, this corretly shows the hint in the statusbar (with the method you describe) and supprresses the popup hint.
Menu itmes do not seem to have a popup hint by default (in D3 on Win9x, I was too lazy today to test this in Lazarus).

Then the matter of longhints.
If you make your hint like
Code: [Select]
SomeItem.Hint := 'This is the short hint|This is the very long and boring text for the longhint';The text after the pipe symbol will be the longhint, the text before the hint you see in the popup hint.

Hope this helps.

Bart

tango13

  • New Member
  • *
  • Posts: 36
Hints in menu items
« Reply #2 on: December 09, 2007, 02:56:40 pm »
Thanks Bart for your quick reply! :)

However:
Quote from: "Bart"
You need to have the parent's form ShowHint  to be true.
Set the showhint on the controls to false: this prevents the popup hint.

In Delphi, this corretly shows the hint in the statusbar (with the method you describe) and supprresses the popup hint.

This doesn't seem to work here.
I correctly have the hint in the status bar but there doesn't seem to be a way to "separate" the two hints: either I see both of them or none.

Quote from: "Bart"
Menu itmes do not seem to have a popup hint by default (in D3 on Win9x, I was too lazy today to test this in Lazarus).

Ok, thanks for the info.
If you'll ever have the chance (and time) to test it, I'd appreciate if you could post your results.

Quote from: "Bart"
Then the matter of longhints.
If you make your hint like
Code: [Select]
SomeItem.Hint := 'This is the short hint|This is the very long and boring text for the longhint';The text after the pipe symbol will be the longhint, the text before the hint you see in the popup hint.

This seems to behave strange too.
No matter what I use in my method (GetShortHint, GetLongHint) I only see the short one...  :?:

Thank you,
Piero

 

TinyPortal © 2005-2018