HandleExpression
 determine the context menu that results in the context menu module from a right-click

 Calling Sequence HandleExpression(expr, isfullexpr)

Parameters

 expr - list; contains the expression to handle for which context menu is determined isfullexpr - truefalse; determines whether expr is considered to be a full expression (true) or a subselection (false)

Description

 • The HandleExpression command returns a nested data structure, which encapsulates the context menu structure displayed by this context menu module when the expression expr is right-clicked. The expr parameter can be any Maple object, including an expression sequence.
 • The HandleExpression command returns output in a specialized form used by Maple for generating its context-sensitive menus.  A simplified version of this output, more suitable for use in testing, is available from the command ContextMenu[Test][GetGeneratedMenu].

Examples of CurrentContext[HandleExpression]

 $\left[{\mathrm{CurrentContext}}{,}{\mathrm{Install}}{,}{\mathrm{New}}{,}{\mathrm{Save}}{,}{\mathrm{Test}}\right]$ (1)
 > newCM := New():
 Note the generated context-sensitive menu for newCM is empty because no entries have been added yet.
 > newCM:-HandleExpression(["test"], true);
 ${\mathrm{CONTEXTMENU}}{}\left({"Context Menu Actions"}{,}{""}{,}\left[{}\right]\right)$ (2)
 Following is the result of the built-in context menu module upon on the selected object false.
 > CurrentContext:-HandleExpression([false], true);
 ${\mathrm{CONTEXTMENU}}{}\left({"Context Menu Actions"}{,}{""}{,}\left[\left[{"Apply a Command"}{,}{"Apply a command"}{,}{{\mathrm{CM_GenericAction}}}_{{x}{→}{\mathrm{ContextMenu}}{:-}{\mathrm{Interactive}}{:-}{\mathrm{Apply}}{}\left({\mathrm{op}}{}\left({x}\right)\right){,}{\mathrm{true}}{,}{\to }}\right]{,}\left[{"Negate Boolean"}{,}{"Negate the boolean expression"}{,}{{\mathrm{CM_GenericAction}}}_{{"not\left(%EXPR\right)"}{,}{\mathrm{true}}{,}\stackrel{{\text{negate boolean}}}{{\to }}}\right]{,}{""}{,}\left[{"Help on Command"}{,}{"Display the help page for this command"}{,}{{\mathrm{CM_GenericAction}}}_{{\mathbf{proc}}\left({x}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{eval}}{}\left({\mathrm{help}}{}\left({\mathrm{op}}{}\left({1}{,}{x}\right)\right)\right){;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{"%CANCEL"}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}{,}{\mathrm{false}}{,}\stackrel{{\text{command help}}}{{\to }}}\right]\right]\right)$ (3)