<doc>
  <legacy_id>1813</legacy_id>
  <name>menu</name>
  <type>keyword</type>
  <syntax>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Windows &amp; Dialog Boxes</category>
    <category>Menus</category>
  </classification>
  <references>
    <function tag="menus">menus Function</function>
    <keyword tag="menuItem">menuItem Keyword</keyword>
    <command tag="doMenu">doMenu Command</command>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
  </classes>
  <security>
  </security>
  <summary>Used with the <property tag="decorations">decorations</property> <glossary tag="property">property</glossary> to specify that a window displays a <glossary tag="menu bar">menu bar</glossary>. When used as the <property tag="style">style</property> <glossary tag="property">property</glossary> of a <keyword tag="button">button</keyword>, specifies that the contents of the <keyword tag="button">button</keyword> is displayed as a <keyword tag="menu">menu</keyword>. Also used to designate a <keyword tag="menu">menu</keyword> by name or number.</summary>
  <examples>
    <example>disable menu "Text"</example>
    <example>set the decorations of stack "Help" to "menu,maximize"</example>
  </examples>
  <description>
    <p>Use the <b>menu</b> <glossary tag="keyword">keyword</glossary> to give a window a <glossary tag="menu bar">menu bar</glossary> (on <glossary tag="Unix">Unix</glossary> and <glossary tag="Windows">Windows systems</glossary>).</p><p/><p><b>Comments:</b></p><p>If a button's <b>style</b> is set to "menu", its <property tag="menuMode">menuMode</property> <glossary tag="property">property</glossary> determines how the <keyword tag="menu">menu</keyword> is displayed when the user clicks the <keyword tag="button">button</keyword>.</p><p/><p>You can use the <b>menu</b> <glossary tag="keyword">keyword</glossary> to refer to one of the <glossary tag="button">buttons</glossary> in the current <glossary tag="menu bar">menu bar</glossary>. For example, if the first <keyword tag="menu">menu</keyword> in the <glossary tag="menu bar">menu bar</glossary> is called "File", the <glossary tag="expression">expression</glossary> the name of menu 1 <glossary tag="evaluate">evaluates</glossary> to "button "File"". (Remember that in LiveCode, <function tag="menus">menus</function> are usually implemented as <glossary tag="button">buttons</glossary>:  the <glossary tag="button">button's</glossary> <property tag="style">style</property> and <property tag="menuMode">menuMode</property> <property tag="properties">properties</property> control how it is displayed, and the <glossary tag="button">button's</glossary> <keyword tag="text">text</keyword> <glossary tag="property">property</glossary> is used as the list of <glossary tag="menu item">menu items</glossary>.)</p><p/><p>The syntax for menu item strings is:</p><p>  [&lt;flags&gt;] &lt;label&gt; ['/' &lt;accelerator&gt; ['|' &lt;tag&gt;]]</p><p/><p>Where &lt;flags&gt; may include:</p><p>  !&lt;c|n|r&gt;                               (the menu item has respectively, a check, no check, or a selected radio button)</p><p>  (                                            (the menu item is disabled)</p><p>  -                                            (the menu item is replaced with a menu separator)</p><p>  multiple tab characters               (where the number of tabs specifes the depth of the menu item.  Use this to create submenus)</p><p/><p>The &lt;accelerator&gt; can be specified as one of:</p><p>  &lt;char&gt;                                 (Command key + specified char)</p><p>  &lt;keyname&gt;                         (Named key without modifiers)</p><p>  &lt;modifiers&gt; &lt;char&gt;           (Specified modifiers + character)</p><p>  &lt;modifiers&gt; &lt;keyname&gt;   (Specified modifiers + named key)</p><p>  </p><p>Here &lt;modifiers&gt; is either:</p><p>  1) a space separated list of:</p><p>        'command' or 'cmd', 'control' or 'ctrl', 'option' or 'opt', 'alt', 'shift'</p><p>        in this case the keyname/char should be separated from the list by a space</p><p>  2) a sequence of characters:</p><p>  ^        (Command)</p><p>  @       (Shift)</p><p>  #        (Option)</p><p>  %       (Control)</p><p>           in this case no space between the sequence and keyname/char is required.</p><p/><p>The following named keys are supported:</p><p>        F1, F2, F3, F4, ... F15,</p><p>        Left, Up, Right, Down,</p><p>        Backspace, Delete,</p><p>        Tab, Space,</p><p>        Return, Enter,</p><p>        Home, End, Escape,</p><p>        PgUp, PgDown,</p><p>        Insert (not on Mac OS X)</p><p> </p><p>On Mac OS X, these keys will be replaced with the appropriate system standard glyph.</p><p/><p>A tag can be specified as a '|' character followed by a string of ascii characters.  If such a tag is present then that tag will take the place of the menu label as the parameter to the <message tag="menuPick">menuPick message</message>.</p><p>A tag will only be recognised following &lt;accelerator&gt;.  To specify a menu tag without an accelerator shortcut, an empty &lt;accelerator&gt; can be specified using '/|' followed by the tag text.</p><p/><p><b>Note:</b> As Windows and Linux do not have the 'Command' modifier, on those platforms 'Command' is an synonym for 'Control'. To ensure cross-platform uniformity it is important that you use 'Command' in preference to 'Control' since 'Control' on Mac OS X is a less frequently used modifier.</p><p/><p><img src="202652"/> <b>Cross-platform note:</b> The <b>menu</b> decoration has no effect on <glossary tag="Mac OS">Mac OS</glossary> and <glossary tag="OS X">OS X systems</glossary>. On <glossary tag="Windows">Windows systems</glossary>, the <b>menu</b> decoration must be set along with the <keyword tag="maximize">maximize</keyword> or <keyword tag="minimize">minimize</keyword> decorations: you cannot use <keyword tag="maximize">maximize</keyword> or <keyword tag="minimize">minimize</keyword> without including <b>menu</b>.</p>
  </description>
</doc>