Base Menu - Prepare Event

Prepare event can be used to display context sensitive menus

Member of Base Menu (PRIM_MENU)

Parameters

Name

Type

Data Type

Description

Context

*Input

PRIM_OBJT

Reference to the control associated with the menu item being shown

Details

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.

Example

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)

Endroutine


See also

All Component Classes

Technical Reference

  • No labels