?? bimenuitem.html
字號:
<!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"></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><code>null</code></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"><img src="check.png" alt="checked"></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="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>Returns 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="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="shown"></a><code>shown</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 item is shown on the screen</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="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">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>
</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">oComponent</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>oComponent</code></td>
<td><code class="type"><code><a href="BiMenu.html">BiMenu</a></code> / <code><a href="BiMenuItem.html">BiMenuItem</a></code></code></td>
<td class="optional-column"></td>
<td></td>
<td>The component to test whether the current component 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 + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -