bimenuitem.html
来自「ajax 框价.是个好工具.javascript 矿家.可以用在任何平台.」· HTML 代码 · 共 327 行
HTML
327 行
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><!--Generated using api.website.xsl version 2003-07-17--><head><META http-equiv="Content-Type" content="text/html; charset=utf-8"><title>BiMenuItem</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link type="text/css" rel="stylesheet" href="api.css"><script type="text/javascript"> function showDerivedClasses() { var ul = document.getElementById("api-derived-classes"); var lis = ul.childNodes; var l = lis.length; for (var i = 1; i < l; i++) lis[i].style.display = ""; lis[0].style.display = "none"; } </script></head><body><h1 id="BiMenuItem">BiMenuItem</h1><p>Represents a menu item for a <code><a href="BiMenu.html">menu</a></code>.</p><p>This class extends <code><a href="BiEventTarget.html">BiEventTarget</a></code> and therefore all methods and fields available for <code><a href="BiEventTarget.html">BiEventTarget</a></code> are also available for <code>BiMenuItem</code>.</p><ul class="partial-class-tree"><li><code><a href="BiObject.html">BiObject</a></code><ul><li><code><a href="BiEventTarget.html">BiEventTarget</a></code><ul><li><code>BiMenuItem</code><ul id="api-derived-classes"><li><code><a href="BiCheckBoxMenuItem.html">BiCheckBoxMenuItem</a></code></li><li><code><a href="BiMenuButton.html">BiMenuButton</a></code></li><li><code><a href="BiMenuSeparator.html">BiMenuSeparator</a></code></li><li><code><a href="BiRadioButtonMenuItem.html">BiRadioButtonMenuItem</a></code></li></ul></li></ul></li></ul></li></ul><h2>Constructor</h2><p><code> new BiMenuItem([<span class="methodArgument">sText</span> [, <span class="methodArgument">oSubMenu</span>]])</code></p><h3>Parameters</h3><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>sText</code></td><td><code class="type">String</code></td><td class="optional-column"><img src="check.png" alt="checked"></td><td></td><td>The text to show on the menu item </td></tr><tr><td><code>oSubMenu</code></td><td><code class="type"> <code><a href="BiMenu.html">BiMenu</a></code> </code></td><td class="optional-column"><img src="check.png" alt="checked"></td><td></td><td>The sub menu that should be opened by the menu item. </td></tr></tbody></table><h2>Properties</h2><table><thead><tr><td>Name</td><td>Type</td><td class="get-header">get</td><td class="set-header">set</td><td>Descripton</td></tr></thead><tbody><tr><td><a name="command"></a><code>command</code></td><td><code class="type"> <code><a href="BiCommand.html">BiCommand</a></code> </code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>The command to executed when the menu item is clicked.</td></tr><tr><td><a name="enabled"></a><code>enabled</code></td><td><code class="type">Boolean</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"><img src="check.png" alt="checked"></td><td>Whether the component is enabled or not. When this is changed the component fires the <code><a href="#enabledchanged">enabledchanged</a></code> event.</td></tr><tr><td><a name="html"></a><code>html</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"><img src="check.png" alt="checked"></td><td>The html text to show on the menu item</td></tr><tr><td><a name="icon"></a><code>icon</code></td><td><code class="type"> <code><a href="BiImage.html">BiImage</a></code> </code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"><img src="check.png" alt="checked"></td><td>The icon image to show on the menu item. Note that changing the image object does not update the label icon. You'll have to set the icon property to update the label icon. The size of the icon of the menu item is currently fixed.</td></tr><tr><td><a name="isVisible"></a><code>isVisible</code></td><td><code class="type">Boolean</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>Whether the menu item is shown on the screen</td></tr><tr><td><a name="mnemonic"></a><code>mnemonic</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"><img src="check.png" alt="checked"></td><td>A character used to give UI hints about the access key for the menu label</td></tr><tr><td><a name="nextSibling"></a><code>nextSibling</code></td><td><code class="type"> <code><a href="BiMenuItem.html">BiMenuItem</a></code> </code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>Returns the next menu item after the current</td></tr><tr><td><a name="parent"></a><code>parent</code></td><td><code class="type"> <code><a href="BiMenu.html">BiMenu</a></code> </code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>The menu containing the menu item</td></tr><tr><td><a name="previousSibling"></a><code>previousSibling</code></td><td><code class="type"> <code><a href="BiMenuItem.html">BiMenuItem</a></code> </code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>Returns the previous menu item beforer the current</td></tr><tr><td><a name="screenLeft"></a><code>screenLeft</code></td><td><code class="type">Number</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>The left postion of the menu item relative to the screen</td></tr><tr><td><a name="screenTop"></a><code>screenTop</code></td><td><code class="type">Number</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>The top postion of the menu item relative to the screen</td></tr><tr><td><a name="shortcutText"></a><code>shortcutText</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"><img src="check.png" alt="checked"></td><td>The shortcut text is shown on the menu to give the user a hint about keyboard shortcuts. Setting this on the menu just adds the text. It does not set up the keyboard shortcut.</td></tr><tr><td><a name="subMenu"></a><code>subMenu</code></td><td><code class="type"> <code><a href="BiMenu.html">BiMenu</a></code> </code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"><img src="check.png" alt="checked"></td><td>The menu that should be opened as a sub menu when the current menu is selected.</td></tr><tr><td><a name="text"></a><code>text</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"><img src="check.png" alt="checked"></td><td>The plain text to show on the menu item</td></tr><tr><td><a name="toolTipText"></a><code>toolTipText</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"><img src="check.png" alt="checked"></td><td>The text to show as a tool tip for the menu item.</td></tr><tr><td><a name="topLevelComponent"></a><code>topLevelComponent</code></td><td><code class="type"> <code><a href="BiComponent.html">BiComponent</a></code> </code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>Returns the top level ancestor component. This is usually the application window hosting the application.</td></tr><tr><td><a name="visible"></a><code>visible</code></td><td><code class="type">Boolean</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"><img src="check.png" alt="checked"></td><td>Shows or hides the menu item</td></tr></tbody></table><h2>Methods</h2><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td><code><a href="#contains">contains</a></code></td><td>Returns true if the menu item contains another menu item or menu. This means that the current component is an ancestor of the descendant. Note that the current component contains itself so calling <code>component.contains(component)</code> will return <code>true</code>.<br> <br> A menu item is considered parent of its sub menu and will therefore contain the sub menu.</td></tr></tbody></table><h2>Events</h2><table><thead><tr><td>Name</td><td>Type</td><td class="bubbles-header">Bubbles</td><td>Descripton</td></tr></thead><tbody><tr><td><a name="action"></a><code>action</code></td><td><code class="type"> <code><a href="BiEvent.html">BiEvent</a></code> </code></td><td class="bubbles-column"></td><td>Fired when the menu item is clicked or invoked using the keyboard</td></tr><tr><td><a name="enabledchanged"></a><code>enabledchanged</code></td><td><code class="type"> <code><a href="BiEvent.html">BiEvent</a></code> </code></td><td class="bubbles-column"></td><td>This is fired when the enabled property is changed</td></tr></tbody></table><h2>Static Methods</h2><p>None.</p><h2>Static Fields</h2><p>None.</p><h2>Remarks</h2><p>The size of the icon for the menu item is fixed to 16x16.<br> <br> If the menu item has a <code><a href="BiMenuItem.html#command">command</a></code> the command will be <code><a href="BiCommand.html#execute">executed</a></code> when the user clicks the item. The <code><a href="#shortcutText">shortcutText</a></code> property is synchronized with the <code><a href="BiCommand.html#shortcut">command shortcut</a></code>.</p><h2>Method Details</h2><h3><a name="contains"></a>contains</h3><p>Returns true if the menu item contains another menu item or menu. This means that the current component is an ancestor of the descendant. Note that the current component contains itself so calling <code>component.contains(component)</code> will return <code>true</code>.<br> <br> A menu item is considered parent of its sub menu and will therefore contain the sub menu.</p><h4>Syntax</h4><pre class="method-syntax">object.contains(<span class="methodArgument">oDescendant</span>)</pre><h4>Parameters</h4><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>oDescendant</code></td><td><code class="type">Object</code></td><td class="optional-column"></td><td></td><td>The<code><a href="BiMenu.html">BiMenu</a></code> or<code><a href="BiMenuItem.html">BiMenuItem</a></code> to test whether the current menu item contains it.</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">Boolean</code></p></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?