DIAdemヘルプ

Method: Item for MenuPoints

  • 更新日2024-09-12
  • 3分で読める

Method: Item for MenuPoints

Returns the context menu item for a certain index.

Set oMenuPoint = Object.Item(Index)
ObjectMenuPoints
Object with this method
IndexLongInteger
Specifies the index of the context menu item.
oMenuPointMenuPoint
Returned object
Note  To test the following example script, you must first save the script and register the script as a user command in the dialog box that opens when you select Settings»Extensions»User Commands.

The following example disables all entries in the context menu:

'--- For DIAdem-NAVIGATOR ------------------------------------------
Call AddUserCommandToEvent("Navigator.Events.OnShowingContextMenu","MyNavigatorOnShowingContextMenu")

Sub MyNavigatorOnShowingContextMenu(ParentObj, MenuPoints)
  Dim Index
  For Index = 1 To MenuPoints.Count
    MenuPoints.Item(Index).Enable(False)
  Next
End Sub


'--- For DIAdem-VIEW ------------------------------------------
Call AddUserCommandToEvent("View.Events.OnShowingContextMenu","MyViewOnShowingContextMenu")

Sub MyViewOnShowingContextMenu(Area, MenuPoints)
  Dim Index
  For Index = 1 To MenuPoints.Count
    MenuPoints.Item(Index).Enable(False)
  Next
End Sub