Recent

Author Topic: Notification before MainMenu is opened  (Read 2373 times)

Pascal

  • Hero Member
  • *****
  • Posts: 932
Notification before MainMenu is opened
« on: July 01, 2015, 10:02:57 am »
Hello,

is there a way to get notified before the main menu gests opened to update some menu items?

Regards
Pascal
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Groffy

  • Full Member
  • ***
  • Posts: 204
Re: Notification before MainMenu is opened
« Reply #1 on: July 01, 2015, 10:19:39 am »
is there a way to get notified before the main menu gests opened to update some menu items?

Maybe the TMenuItem - OnClick event works for you?


Ulrich
Linux Mint / Windows 10 / Lazarus 3.0.0 / trunk -qt

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Notification before MainMenu is opened
« Reply #2 on: July 02, 2015, 09:46:57 am »
Unfortunately not!

OnClick is called A F T E R a menu item is displayed and clicked.

Pascal
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Notification before MainMenu is opened
« Reply #3 on: July 02, 2015, 10:22:58 am »
Unfortunately not!

OnClick is called A F T E R a menu item is displayed and clicked.

Pascal
use actions and action lists and link them to your menu items. After that use the onupdate of the action.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

rvk

  • Hero Member
  • *****
  • Posts: 6169
Re: Notification before MainMenu is opened
« Reply #4 on: July 02, 2015, 10:23:28 am »
OnClick is called A F T E R a menu item is displayed and clicked.
No (and yes). But Groffy was talking about the OnClick event of MAIN-MENU item. The one on the top bar. The one that's always visible. When catching that one you still have time to change the sub-menus before that sub-menu is opened.

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Notification before MainMenu is opened
« Reply #5 on: July 02, 2015, 11:23:34 am »
Yes, sorry, you are right.

In the meantime i also realized that the OnClick-Event of the Main-Menu item ist the right place to do this!
Thank you.

Pascal
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

 

TinyPortal © 2005-2018