DataView.ReplaceActionMenuItemCode

Prototypes

void ReplaceActionMenuItemCode( String sExistingItem, String sNewCode )

Parameters

String sExistingItem
An existing menu item. See the documentation for AppendActionMenuItemToGroup for ways to specify sExistingItem for cascading menus.

String sNewCode
One or more IMLPlus statements that will be executed when the menu item is invoked.

Remarks

This method replaces the code associated with an item on the action menu.

You cannot replace a menu separator.

This method is equivalent to calling ReplaceActionMenuItem( sExistingItem, "", sNewCode ).

Example
declare ScatterPlot plot;
plot = ScatterPlot.Create( "Action Menu", 1:10, 1:10 );

plot.AppendActionMenuItem( "Item 1",
    "print 'Item 1';" );
plot.AppendActionMenuItem( "Item 2",
    "print 'Item 2';" );
plot.ReplaceActionMenuItemCode( "Item 1",
    "print 'First Item';" );
/* Press F11 in the plot window to see the menu. */
See Also

DataView.AppendActionMenuItem
DataView.ReplaceActionMenuItem
DataView.ReplaceActionMenuItemText