ContextMenu
New
construct a new context menu module
Calling Sequence
Description
Examples of ContextMenu[New]
New()
The New command constructs a new context menu to which entries, queries, and entry generators can be added using the Entries[Add], Entries[AddMultiple], Queries[Add], and EntryGenerators[Add] commands. You can replace the current context menu with the new context menu using the Install command.
with(ContextMenu):
Replace the default context menu with a new context menu.
newCM := New();
newCM:=moduleoptionpackage;localListTestsPassed,ListTypesPassed,ListTestsRun,ListTypesRun,ListTestsByType,ExpressionHandler,BuildActionList,GetTestResult,IsEntryActive,SubmoduleLoadSet;exportEntries,Queries,EntryGenerators,HandleExpression,Categories,Copy,TypeTree,EntriesTests_by_Types,ActivityTests,Input,Load,_pexports;end module
newCM[Entries][Add]("Multiply by 2", "2*%EXPR", numeric);
0
newCM[Queries][Add]("Divisible by 2", proc(p) evalb(p mod 2 = 0) end proc);
newCM[Entries][Add]("Divide by 2", "%EXPR/2", integer, 'test'="Divisible by 2");
7
Install(newCM);
See Also
Entries/Add
Entries/AddMultiple
EntryGenerators/Add
Install
Queries/Add
Download Help Document