Recent

Author Topic: Hints on TMainMenu / TMenuItem are not working  (Read 1222 times)

QuinnMartin

  • Jr. Member
  • **
  • Posts: 56
Hints on TMainMenu / TMenuItem are not working
« on: June 09, 2024, 11:12:33 pm »
Are hints for TMainMenu objects implemented properly in Lazarus V3.2?  I cannot get them working.   I do confirm that hints on a TButton and TLabel do work on this same form, so the form does appear to be structured correctly.

In short I am trying to set up the TMainMenu where a user can hover on the menu items and understand what each one does before they click on a choice.

I have the following set:

Application.ShowHint := Set to true at design time in Object Inspector
TMenuItem.Hint := contains text, I verified this

Before throwing out guesses about what to set next, please confirm that the property actually exists, since TMainMenu seems somewhat of an oddball (for example there is no ShowHint property for TMainForm for TMenuItem, all you can do is set hints for TMenuItems).

jamie

  • Hero Member
  • *****
  • Posts: 6943
Re: Hints on TMainMenu / TMenuItem are not working
« Reply #1 on: June 10, 2024, 12:20:30 am »
interesting.

Docs states that HINTS from menuItems appear in a TstatusBar on the form.
https://lazarus-ccr.sourceforge.io/docs/lcl/menus/tmenuitem.hint.html

I just played with it and it has some interesting effects.

I believe you also need to Application.ShowHInt  set to true also.
The only true wisdom is knowing you know nothing

jamie

  • Hero Member
  • *****
  • Posts: 6943
Re: Hints on TMainMenu / TMenuItem are not working
« Reply #2 on: June 10, 2024, 12:30:23 am »
I think this should be reported.

The think the bloody ship is broke!  :D
The only true wisdom is knowing you know nothing

jamie

  • Hero Member
  • *****
  • Posts: 6943
Re: Hints on TMainMenu / TMenuItem are not working
« Reply #3 on: June 10, 2024, 01:03:43 am »
apparently you will not get a bubble popup like you would think.

Also it appears the code isn't projecting the hint string over the StatusPanel as stated but I found this works.

Code: Pascal  [Select][+][-]
  1. procedure TForm1.ApplicationProperties1Hint(Sender: TObject);
  2. begin
  3.   StatusBar1.SimpleText  := Application.Hint;
  4. end;
  5.                                                      
The only true wisdom is knowing you know nothing

QuinnMartin

  • Jr. Member
  • **
  • Posts: 56
Re: Hints on TMainMenu / TMenuItem are not working
« Reply #4 on: June 10, 2024, 06:05:56 am »
Docs states that HINTS from menuItems appear in a TstatusBar on the form.

That sounds like program design out of the 1990s.  I can't remember the last time I've seen hint help presented  in a status bar.  Oh well, the rest of it is working ok so I'll figure something out..

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Hints on TMainMenu / TMenuItem are not working
« Reply #5 on: June 10, 2024, 06:20:44 am »
That sounds like program design out of the 1990s.  I can't remember the last time I've seen hint help presented  in a status bar.  Oh well, the rest of it is working ok so I'll figure something out..
The clue is that you can do whatever you do at the onhint event. So if you want to play an mp3, start your browser to show a metube video, X a message and start your car then you could do that  ;D
Today is tomorrow's yesterday.

QuinnMartin

  • Jr. Member
  • **
  • Posts: 56
Re: Hints on TMainMenu / TMenuItem are not working
« Reply #6 on: June 10, 2024, 07:31:48 am »
The clue is that you can do whatever you do at the onhint event.

Good point... Thank you TRon.

 

TinyPortal © 2005-2018