Jump to content
JGMS

How to enable hint property in a MenuItem

Recommended Posts

A menuitem in Delphi (11.3 Enterprise) FMX has no "hint" property by default.
How can I add the Hint and Showhint properties to the menuitem class to show them in the Object Inspector?

Share this post


Link to post

Since FMX components have no hints altogether you'll need to program them on your own. Or look into our german site https://www.delphipraxis.net/169747-brennende-hinweise-fmx-hints-thintmanager-1-3-a.html.

Alternatively you can go the way of the accepted answer from here: https://stackoverflow.com/questions/22417565/is-there-any-way-to-add-a-hint-or-tooltip-with-firemonkey

 

Keep in mind however, that hints or tooltips are not something common on mobile devices!

Share this post


Link to post

Thank you @Sherlock. I followed the links you posted, but it did not help me any further.

In Delphi 11.3 FMX the common Windows components have hints, except for the menuitems.
MenuItems do have the Hint, ShowHint and the HitTest property too, but these are not visible in the Object Inspector.

I just tried the following to assign the names of the menuitems to the text of their hints:

 

For var I : Integer := 0 to Form1.ComponentCount -1 DO
    if Form1.components[I] is TMenuItem then
    begin
      (Form1.components[I] as TMenuItem).Hittest := True;
      (Form1.components[I] as TMenuItem).ShowHint := True;
      (Form1.components[I] as TMenuItem).Hint    := (Form1.components[I] as TMenuItem).name;
    end;

This seems to work, though not in the right way: only the topline mainmenu items invoke hints.

Having a mainmenu with items, like "File", "Options", an so on, hoving over them with the mouse shows the names of the sub-menuitems in "Files". Rather weird, isn't it?

 

Has anybody idea's how to get correct hints for (sub-)menuitems?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×