<doc>
  <legacy_id>1885</legacy_id>
  <name>menuMode</name>
  <type>property</type>
  <syntax>
    <example>set the menuMode of <i>button</i> to <i>menuType</i></example>
  </syntax>
  <library></library>
  <objects>
    <button/>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Menus</category>
  </classification>
  <references>
    <command tag="pulldown">pulldown Command</command>
    <keyword tag="popup">popup Keyword</keyword>
    <property tag="menuName">menuName Property</property>
    <property tag="titleWidth">titleWidth Property</property>
    <property tag="menuLines">menuLines Property</property>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
  </classes>
  <security>
  </security>
  <summary>Determines the <glossary tag="appearance">appearance</glossary> and <glossary tag="behavior">behavior</glossary> of menus associated with a <keyword tag="button">button</keyword>.</summary>
  <examples>
    <example>set the menuMode of button "Edit" to pulldown</example>
  </examples>
  <description>
    <p>Use the <b>menuMode</b> <glossary tag="property">property</glossary> to specify the <glossary tag="appearance">appearance</glossary> and <glossary tag="behavior">behavior</glossary> of the menu associated with a <keyword tag="button">button</keyword>.</p><p/><p><b>Value:</b></p><p>The <b>menuMode</b> of a <keyword tag="button">button</keyword> is one of<code> pullDown</code>,<code> cascade</code>,<code> popup</code>,<code> tabbed</code>,<code> comboBox</code>, or<code> option</code>.</p><p/><p><b>Comments:</b></p><p>Any button's contents can be viewed as a menu if the button's <b>style</b> <glossary tag="property">property</glossary> is set to "menu". The <b>menuMode</b> setting creates <function tag="menus">menus</function> of different types from the <glossary tag="button">button's</glossary> contents. (You set the <glossary tag="button">button's</glossary> contents with the <keyword tag="text">text</keyword> <glossary tag="property">property</glossary>.)</p><p/><p>You can also associate a stack with the button, using the <b>menuName</b> <glossary tag="property">property</glossary>. In this case, the contents of the <glossary tag="stack">stack's</glossary> first <keyword tag="card">card</keyword> are displayed as a <keyword tag="menu">menu</keyword>.</p><p/><p><b>pulldown:  </b>Displays each <keyword tag="line">line</keyword> of the <glossary tag="button">button's</glossary> contents as a <glossary tag="menu item">menu item</glossary> in a normal pulldown menu. Use this <b>menuMode</b> for <glossary tag="button">buttons</glossary> that are grouped into a <property tag="menubar">menubar</property>.</p><p/><p>Setting a button's <b>menuMode</b> to "pulldown" has the same result as creating the equivalent <glossary tag="menu item">menu items</glossary> (as <glossary tag="button">buttons</glossary>) in a <object tag="stack">stack</object>, then using the <command tag="pulldown">pulldown</command> command to display the <object tag="stack">stack</object> as a <keyword tag="menu">menu</keyword>.</p><p/><p><code/><b>Note:</b><code/> On <glossary tag="Mac OS">Mac OS</glossary> and <glossary tag="OS X">OS X systems</glossary>, pulldown menus in a window are drawn by the standard operating system routines if the <glossary tag="button">button's</glossary> <property tag="showBorder">showBorder</property> <glossary tag="property">property</glossary> is set to true and its <property tag="borderWidth">borderWidth</property> is not zero. Pulldown menus in the <glossary tag="menu bar">menu bar</glossary> are always drawn by the operating system.</p><p/><p><b>cascade:  </b>Displays each <keyword tag="line">line</keyword> of the <glossary tag="button">button's</glossary> contents as a <glossary tag="menu item">menu item</glossary> in a <glossary tag="cascading menu">hierarchical menu</glossary>. (The <keyword tag="button">button</keyword> must be part of a <glossary tag="stack menu">stack menu</glossary>.)</p><p/><p><b>popup:  </b>Displays each <keyword tag="line">line</keyword> of the <glossary tag="button">button's</glossary> contents as a <glossary tag="menu item">menu item</glossary> in a <glossary tag="popup menu">popup menu</glossary>. The <keyword tag="menu">menu</keyword> appears at the <keyword tag="point">point</keyword> of the mouse click.</p><p/><p>Setting a button's <b>menuMode</b> to "popup" has the same result as creating the equivalent <glossary tag="menu item">menu items</glossary> (as <glossary tag="button">buttons</glossary>) in a <object tag="stack">stack</object>, then using the <command tag="popup">popup</command> <glossary tag="command">command</glossary> to display the <object tag="stack">stack</object> as a <keyword tag="menu">menu</keyword>.</p><p/><p><b>tabbed:  </b>Displays the <glossary tag="button">button's</glossary> contents as a horizontal list of tabs, like the tabs on <keyword tag="file">file</keyword> <function tag="folders">folders</function>. Each <keyword tag="line">line</keyword> of the <glossary tag="button">button's</glossary> contents is the title of a tab. Usually, <glossary tag="tabbed button">tabbed buttons</glossary> are used for <glossary tag="dialog box">dialog boxes</glossary> or <glossary tag="palette">palettes</glossary> containing a different <command tag="group">group</command> of <glossary tag="control">controls</glossary> for each tab. You can <glossary tag="handle">handle</glossary> the <message tag="menuPick">menuPick</message> <keyword tag="message box">message</keyword> to display the correct <command tag="group">group</command> when a tab is clicked:</p><p/><p><code>  on menuPick newTab,oldTab </code><code><i>-- sent when user clicks a tab</i></code></p><p><code>    lock screen </code><code><i>-- hide the swap</i></code></p><p><code>    hide group oldTab</code></p><p><code>    show group newTab</code></p><p><code>    unlock screen</code></p><p><code>  end menuPick</code></p><p/><p><b>comboBox:  </b>Displays the <glossary tag="button">button's</glossary> contents as a drop-down scrolling list, with an editable <keyword tag="field">field</keyword> at the top.</p><p/><p><code/><b>Note:</b><code/> If a <glossary tag="button">button's</glossary> <b>menuMode</b> is set to "comboBox", the <keyword tag="button">button</keyword> receives <keyword tag="field">field</keyword> <glossary tag="message">messages</glossary>. For example, when the user clicks in the editable <keyword tag="field">field</keyword>, an <message tag="openField">openField</message> <keyword tag="message box">message</keyword> is sent to the <keyword tag="button">button</keyword>.</p><p/><p><b>option:</b>  Displays an option menu (when the <property tag="lookAndFeel">lookAndFeel</property> <glossary tag="property">property</glossary> is set to "Motif"), a drop-down list (when the <property tag="lookAndFeel">lookAndFeel</property> <glossary tag="property">property</glossary> is set to "Windows 95"), or a Mac-style <glossary tag="popup menu">popup menu</glossary> (when the <property tag="lookAndFeel">lookAndFeel</property> <glossary tag="property">property</glossary> is set to "Appearance Manager" or "Macintosh"). Setting a <glossary tag="button">button's</glossary> <b>menuMode</b> to <code>option</code> has the same result as creating the equivalent menu items (as <glossary tag="button">buttons</glossary>) in a <object tag="stack">stack</object>, then using the <command tag="option">option</command> <glossary tag="command">command</glossary> to display the <object tag="stack">stack</object> as a menu.</p><p/><p>Regardless of the <i>menuType</i>, a <message tag="menuPick">menuPick</message> <keyword tag="message box">message</keyword> is sent to the <keyword tag="button">button</keyword> when the user chooses a <glossary tag="menu item">menu item</glossary> from the <keyword tag="menu">menu</keyword>.</p><p/><p>If the button's <b>style</b> <glossary tag="property">property</glossary> is not set to "menu", the setting of its <b>menuMode</b> <glossary tag="property">property</glossary> has no effect.</p>
  </description>
</doc>