ArgumentType

From The Foundry MODO SDK wiki
Revision as of 20:54, 20 February 2012 by Shf (Talk | contribs) (More Information)

Jump to: navigation, search

ArgumentType is a config construct that provides username and description strings for a choice in a list or popup. The type string is often associated with TextValueHint array or a list-style User Value to provide user strings for each choice.

Creating an ArgumentType Config Entry

The AlignWithEdgeTypes-mode entry would exist in a CommandHelp block in a config file, and might look this:

<atom type="CommandHelp">
  <hash type="ArgumentType" key="AlignWithEdge-mode@en_US">
    <atom type="UserName">Align With Edge</atom>
    <hash type="Option" key="top">
      <atom type="UserName">Top</atom>
      <atom type="Desc">Top edge</atom>
    </hash>
    <hash type="Option" key="bot">
      <atom type="UserName">Bottom</atom>
      <atom type="Desc">Bottom edge</atom>
    </hash>
    <hash type="Option" key="left">
      <atom type="UserName">Left</atom>
      <atom type="Desc">Left edge</atom>
    </hash>
    <hash type="Option" key="right">
      <atom type="UserName">Right</atom>
      <atom type="Desc">Right edge</atom>
    </hash>
  </hash>
</atom>

The @en_US at the end of the name is the language type, in this case US English, which is also the default fallback for all languages.

The Option entries identify each option by the internal name given by the list property of the user value, and provides a username and description for each. A username for the entire argument type is also available.

Note that all of the key values are case sensitive.

More Information