3.1. Create Scripts for Before Context Menu/Before Editor Context Menu Events

Before Context Menu event

Before Editor Context Menu Event

Before Context Menu Event

  1. Click the Popup button to the right of the Before context menu event field.

  2. Select New Script on the Popup menu.

An Edit Script window opens with the following default code.

Sub OnPreContextMenu(oContextMenu As GefContextMenu)

End Sub

  1. Write and compile the script that is needed for the Before Context Menu event.

  2. Close the Edit Script window.

The Save global script browser opens.

  1. Do the following.

 

Field

Action

A

File name

Enter a name for the script.

B

File of type

Select a script type.

Options are:

 

 

*.cms

(Recommended) CimEdit/CimView scripts

 

 

*.bcl

Basic Control Language scripts

  1. Click Open.

Result: The script can be applied to the Before context menu event.

  1. Click the Arrow button to the right of the Before context menu event.

  2. Select one of the following.

 

Option

Result

A

<No action>

The Before context menu event will not be used.

B

Script Entry point

Is triggered when a user opens a Popup (Context) menu on any CimView screen.

Before Editor Context Menu Event

  1. Click the Popup button to the right of the Before editor context menu event field.

  2. Select New Script on the Popup menu.

An Edit Script window opens with the following default code.

Sub OnEditorPreContextMenu(oContextMenu As GefContextMenu)

End Sub

  1. Write and compile the script that is needed for the Before Editor Context Menu event.

  2. Close the Edit Script window.

The Save global script browser opens.

  1. Do the following.

 

Field

Action

A

File name

Enter a name for the script.

B

File of type

Select a script type.

Options are:

 

 

*.cms

(Recommended) CimEdit/CimView scripts

 

 

*.bcl

Basic Control Language scripts

  1. Click Open.

Result: The script can be applied to the Before context menu event.

  1. Click the Arrow button to the right of the Before context menu event.

  2. Select one of the following.

 

Option

Result

A

<No action>

The Before context menu event will not be used.

B

Script Entry point

Is triggered when a user opens a Popup (Context) menu on any CimView screen.

More information

3. Before Context Menu/Before Editor Context Menu global events.