The default drop behavior will be cancelled if either the ~cancel parameter is set to ~true, or
the ~menu parameter is populated with menu items. In the latter case, the menu will be opened
instead of the default drop behavior.
The following is a sample listener for the ~onDropMenu event:
listen onDropMenu
var diag=object, cp=(pos.x)+' '+(pos.y);
menu.append({signal:'FormView',callback:quickCreate , text:'Add Form', icon:'HEX23URL[ur~skin:symbols.formview16.gif]'});
menu.append({signal:'GridView',callback:quickCreate , text:'Add Grid', icon:'HEX23URL[ur~skin:symbols.gridview16.gif]'});
menu.append({signal:'ListView',callback:quickCreate , text:'Add List', icon:'HEX23URL[ur~skin:symbols.listview16.gif]'});
menu.append();
menu.append({signal:'cancel', text:'Cancel'});
function quickCreate(signal) {
if (signal == 'cancel') return;
diag.createElement('com.sap.vcsample:'+signal, 'elements', {'HEX40g:pos':cp});
}
end
event onDropMenu(object, dnd, pos, menu, callback, cancel);
<@doc>
Fires when the user triggers a drawing-related action.