<contextmenu>

This element defines a context menu, called a command menu in the application's user interface. Context menus are small menus that appear near the mouse when the right mouse button is clicked. Context menus are "context sensitive". For example: In Scenome applications, all selections are context sensitive. Interaction modes are also context sensitive.

Whenever a selection is active, a right click produces the appropriate command menu, regardless of the active mode. When the selection is empty and a draw mode is active, a right click displays the draw mode command menu.

Attribute Value
name string, name="DissolveModifier"
class string, class="DissolveModifier"

Examples

Several examples are provided below.

  1. The following example shows how to define a <contextmenu> element. The name attribute determines the name used to present the context menu in the customization center. Generally, it should match the class name or the name of the mode for which it is used. The class attribute must match the C++ class name or mode name.
    <contextmenu name="DissolveModifier" class="DissolveModifier"></contextmenu>
             
  2. The following example shows how to create a context menu for the DissolveModifier. This context menu appears when a DissolveModifier is selected and the user clicks the right mouse button. The text in this example is re-arranged to make increase its readability in this example.
    <contextmenu name="DissolveModifier" class="DissolveModifier">
        <item name="&Toggle Modifier" 
              guid="{1F91F9CF-F612-46D4-A453-4B81096121A9}" 
              text="true" 
              image="true"/> 
        <separator/> 
        <item name="Select Modifier &Input" 
              guid="{1F91F8EE-F612-46D4-A453-4B81096121A9}" 
              text="true" 
              image="true"/> 
        <separator/> 
        <item name="&Delete" 
              guid="{1F91F9D2-F612-46D4-A453-4B81096121A9}" 
              text="true" 
              image="true"/> 
       <separator/&gt; 
       <item name="&Properties..." 
             guid="{1F91F85C-F612-46D4-A453-4B81096121A9}" 
             text="true" 
             image="true"/> 
    </contextmenu>
             
  3. The following example shows how to create a context menu for the Draw interaction mode. This context menu appears when any draw mode is active and the selection is empty. ( Any right click with an active selection always produces the command menu for the selection. )
    <contextmenu name="Draw Mode" class="Draw Mode">
      <item name="Duplicate Active Mesh" 
            guid="{1F91F88D-F612-46D4-A453-4B81096121A9}" 
            text="true" 
            image="true"/> 
      <item name="Draw Light" 
            guid="{1F91F8C4-F612-46D4-A453-4B81096121A9}" 
            text="true" 
            image="true"/> 
      <separator /> 
      <item name="Align Grid With Face" 
            guid="{1F91F8BD-F612-46D4-A453-4B81096121A9}" 
            text="true" 
            image="true"/> 
      <item name="Align Grid With Edge" 
            guid="{1F91F8BC-F612-46D4-A453-4B81096121A9}" 
            text="true" 
            image="true"/> 
      <item name="Align Grid With Vertex" 
            guid="{1F91F8C1-F612-46D4-A453-4B81096121A9}" 
            text="true" 
            image="true"/> 
      <item name="Align Grid With Three Points" 
            guid="{1F91F8C3-F612-46D4-A453-4B81096121A9}" 
            text="true" 
            image="true"/> 
      <separator /> 
      <item name="&Translate" 
            guid="{1F91FA6D-F612-46D4-A453-4B81096121A9}" 
            text="true" 
            image="true"/> 
      <item name="&Scale" 
            guid="{1F91FA6E-F612-46D4-A453-4B81096121A9}" 
            text="true" 
            image="true"/> 
      <item name="&Rotate" 
            guid="{1F91FA6F-F612-46D4-A453-4B81096121A9}" 
            text="true" 
            image="true"/> 
    </contextmenu>