Base Menu - Prepare Event

Prepare event can be used to display context sensitive menus

Member of Base Menu (PRIM_MENU)


NameTypeData TypeDescription
Context*InputPRIM_OBJTReference to the control associated with the menu item being shown


The Prepare event is fired whenever the popup is about to be shown.
This provides an opportunity to configure the menu appearance at the time of showing rather than having to control it as the application is used.


In this example, menu items are enabled by calling an evaluation routine to determine whether the items are valid for the user.
Evtroutine Handling(#PopupMenu.Prepare)
   #NewCustomer.Enabled := #gApplication.CanDo(Create Customer #User)
   #OpenCustomer := := #gApplication.CanDo(Open Customer #User)
   #DeleteCustomer := := #gApplication.CanDo(Delete Customer #User)

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2