<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
  SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
  <func>
    <title>CreateMenu</title>
    <category>Objects</category>
    <subcat>Menu</subcat>
    <version>5.1 OC</version>
    <syntax>
      <rtype>bool</rtype>
      <params>
        <param>
          <type>id</type>
          <name>symbol</name>
          <desc>The picture of this object definition is used as symbol.</desc>
        </param>
        <param>
          <type>object</type>
          <name>command_object</name>
          <desc>Object to receive the menu command (see <funclink>AddMenuItem</funclink>). Can be <code>nil</code> in local calls.</desc>
        </param>
        <param>
          <type>int</type>
          <name>extra</name>
          <desc>
            Additional information to be displayed about the currently selected entry. C4MN_ values are now also defined as constants: 
            <table>
              <rowh>
                <col>Constant</col>
                <col>Value</col>
                <col>Effect</col>
              </rowh>
              <row>
                <col>C4MN_Extra_None</col>
                <col>0</col>
                <col>Nothing</col>
              </row>
              <row>
                <col>C4MN_Extra_Value</col>
                <col>2</col>
                <col>Value</col>
              </row>
              <row>
                <col>C4MN_Extra_Info</col>
                <col>4</col>
                <col>Display object description immediately.</col>
              </row>
            </table>

          </desc>
        </param>
        <param>
          <type>string</type>
          <name>caption</name>
          <desc>Text to be displayed if the menu is empty.</desc>
        </param>
        <param>
          <type>int</type>
          <name>extra_data</name>
          <desc>Comparison value for extra 3.</desc>
        </param>
        <param>
          <type>int</type>
          <name>style</name>
          <desc>
            Appearance of the menu. The following constants are defined: 
            <table>
              <rowh>
                <col>Constant</col>
                <col>Value</col>
                <col>Appearance</col>
              </rowh>
              <row>
                <col>C4MN_Style_Normal</col>
                <col>0</col>
                <col>Normal</col>
              </row>
              <row>
                <col>C4MN_Style_Context</col>
                <col>1</col>
                <col>Context menu</col>
              </row>
              <row>
                <col>C4MN_Style_Info</col>
                <col>2</col>
                <col>Info menu</col>
              </row>
              <row>
                <col>C4MN_Style_Dialog</col>
                <col>3</col>
                <col>Dialog</col>
              </row>
              <row>
                <col>C4MN_Style_EqualItemHeight</col>
                <col>128</col>
                <col>Can be combined with C4MN_Style_Dialog: all entries with an icon are drawn with the same height.</col>
              </row>
            </table>

          </desc>
        </param>
        <param>
          <type>bool</type>
          <name>permanent</name>
          <desc>The menu stays open after an entry has been selected.</desc>
        </param>
        <param>
          <type>id</type>
          <name>menu_id</name>
          <desc>If specified, this id is used as menu id. The current menu id is returned by <funclink>GetMenu</funclink></desc>
          <optional />
        </param>
      </params>
    </syntax>
    <desc>Creates a user defined menu for the specified object. Menu entries are to be added using <funclink>AddMenuItem</funclink>.</desc>
    <examples>
      <example>
        <text>see <funclink>AddMenuItem</funclink></text>
      </example>
    </examples>
    <related>
      <funclink>AddMenuItem</funclink>
      <funclink>SelectMenuItem</funclink>
      <funclink>GetMenu</funclink>
      <funclink>CloseMenu</funclink>
    </related>
  </func>
  <author>springer</author><date>2002-04</date>
  <author>Sven2</author><date>2007-03</date>
</funcs>
