Event: OnContextMenuPointSelected



DIAdem 2018ヘルプ


発行年月: 2018年6月
製品番号: 370858P-0112
製品情報を参照

ダウンロード (Windowsのみ)


DIAdem 2017 ヘルプ
DIAdem 2018 ヘルプ
DIAdem 2019 ヘルプ
DIAdem 2020 ヘルプ
DIAdem 2020 SP1 ヘルプ

Is triggered in DIAdem NAVIGATOR by the selection of an entry in the context menu of the file browser, data browser, or search results list. The event starts the user command that you have assigned to the property Navigator.Events.OnContextMenuPointSelected.

If you open a context menu in DIAdem NAVIGATOR, DIAdem configures a context menu and triggers the event OnShowingContextMenu before the context menu is displayed. If you select a context menu item, DIAdem triggers the event OnContextMenuPointSelected. Then DIAdem closes the context menu again.

Refer to Working with Events in DIAdem for further information on events in DIAdem.

OnContextMenuPointSelected(ParentObj, MenuPoint)

ParentObj Specifies the object corresponding to the context in the NAVIGATOR in which you opened the context menu. The object can be Browser <DataFinder>, Browser <DataStore>, ResultsList <DataFinder>, or ResultsList <DataStore>. You can also use the channel preview and the property preview in the NAVIGATOR. Use the IsKindof method with the following selection terms to specify the object types.
eDataFinderResultsList Search results list of a DataFinder
eDataStoreResultsList Search Results of a Data Store
eDataResultsList Search results list of a data store or DataFinder
eDataFinderBrowser Browser of a DataFinder
eDataStoreBrowser Browser of a data store
eDataBrowser Browser of a DataFinder or a data store
eChannelPreView Channel preview in the NAVIGATOR
ePropertyListPreView Property preview in the NAVIGATOR
MenuPoint Specifies an entry in the context menu.

Note  To test the 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 executes the user command MyOnShowingContextMenu as soon as you open the context menu in DIAdem NAVIGATOR. If you select an entry in the context menu, the example executes the user command MyOnContextMenuPointSelected:

Call AddUserCommandToEvent("Navigator.Events.OnShowingContextMenu","MyOnShowingContextMenu")

Call AddUserCommandToEvent("Navigator.Events.OnContextMenuPointSelected","MyOnContextMenuPointSelected")

Sub MyOnShowingContextMenu (ParentObj, MenuPoints)
  If (ParentObj.IsKindOf(eDataBrowser)) then           ' eDataStoreBrowser or eDataFinderBrowser
    Call MenuPoints.Add("My Browser Menu Point", 1)
    If (ParentObj.IsKindOf(eDataFinderBrowser)) then           ' eDataStoreBrowser or eDataFinderBrowser
      Call MenuPoints.Add("My DataFinder Browser Menu Point", 2)
    ElseIf (ParentObj.IsKindOf(eDataStoreBrowser)) then           ' eDataStoreBrowser or eDataFinderBrowser
      Call MenuPoints.Add("My DataStore Browser Menu Point", 3)
    End If
  ElseIf (ParentObj.IsKindOf(eDataResultsList)) then       ' eDataStoreResultsList or eDataFinderResultsList
    Call MenuPoints.Add("My Results List Menu Point", 4)
    If (ParentObj.IsKindOf(eDataFinderResultsList)) then       ' eDataStoreResultsList or eDataFinderResultsList
      Call MenuPoints.Add("My DataFinder Results List Menu Point", 5)
    ElseIf (ParentObj.IsKindOf(eDataStoreResultsList)) then       ' eDataStoreResultsList or eDataFinderResultsList
      Call MenuPoints.Add("My DataStore Results List Menu Point", 6)
    End If
  ElseIf (ParentObj.IsKindOf(eChannelPreview)) then      
    Call MenuPoints.Add("My Preview Area Channel Menu Point", 7)
  ElseIf (ParentObj.IsKindOf(ePropertyListPreview)) then
    Call MenuPoints.Add("My Preview Area Properties Menu Point", 8)
  End If
End Sub

Sub MyOnContextMenuPointSelected (ParentObj, MenuPoint)
   Select Case MenuPoint.ID
      Case 1 MsgBox "DataStore or DataFinder Browser Entry"
      Case 2 MsgBox "DataStore Browser Entry"
      Case 3 MsgBox "DataFinder Browser Entry"
      Case 4 MsgBox "DataStore or DataFinder ResultsList Entry"
      Case 5 MsgBox "DataStore ResultsList Entry"
      Case 6 MsgBox "DataFinder ResultsList Entry"
      Case 7 MsgBox "Preview Area Channels Entry"
      Case 8 MsgBox "Preview Area Properties Entry"
   End Select
End Sub

Note Use the AddUserCommandToEvent command to assign several user commands to one event. Use the RemoveUserCommandFromEvent command to delete a single user command from a list of user commands which you assigned to an event. To not assign a user command to an event anymore, assign an empty string.



この記事は役に立ちましたか。

役に立たなかった