52 lines
7.3 KiB
HTML
52 lines
7.3 KiB
HTML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>The Be Book - System Overview - The Interface Kit</title><link rel="stylesheet" href="be_book.css" type="text/css" media="all" /><link rel="shortcut icon" type="image/vnd.microsoft.icon" href="./images/favicon.ico" /><!--[if IE]>
|
||
<link rel="stylesheet" type="text/css" href="be_book_ie.css" />
|
||
<![endif]--><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="Access, BeOS, BeBook, API" /><link rel="start" href="index.html" title="The Be Book" /><link rel="up" href="TheInterfaceKit_Overview.html" title="The Interface Kit" /><link rel="prev" href="BListView_Overview.html" title="BListView" /><link rel="next" href="BMenuBar_Overview.html" title="BMenuBar" /></head><body><div id="header"><div id="headerT"><div id="headerTL"><a accesskey="p" href="BListView_Overview.html" title="BListView"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a accesskey="u" href="TheInterfaceKit_Overview.html" title="The Interface Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a accesskey="n" href="BMenuBar_Overview.html" title="BMenuBar"><img src="./images/navigation/next.png" alt="Next" /></a></div><div id="headerTR"><div id="navigpeople"><a href="http://www.haiku-os.org"><img src="./images/People_24.png" alt="haiku-os.org" title="Visit The Haiku Website" /></a></div><div class="navighome" title="Home"><a accesskey="h" href="index.html"><img src="./images/navigation/home.png" alt="Home" /></a></div><div class="navigboxed" id="navigindex"><a accesskey="i" href="ClassIndex.html" title="Index">I</a></div><div class="navigboxed" id="naviglang" title="English">en</div></div><div id="headerTC">The Be Book - System Overview - The Interface Kit</div></div><div id="headerB">Prev: <a href="BListView_Overview.html">BListView</a> Up: <a href="TheInterfaceKit_Overview.html">The Interface Kit</a> Next: <a href="BMenuBar_Overview.html">BMenuBar</a></div><hr /></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h2 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMenu_Overview"></a>BMenu</h2></div></div></div><a id="id550505" class="indexterm"></a><p>
|
||
A <a class="link" href="BMenu.html" title="BMenu"><code class="classname">BMenu</code></a>
|
||
object displays a pull-down or pop-up list of menu items. A menu
|
||
can contain simple menu items (
|
||
<a class="link" href="BMenuItem.html" title="BMenuItem"><code class="classname">BMenuItem</code></a>
|
||
objects), or other menus (other
|
||
<a class="link" href="BMenu.html" title="BMenu"><code class="classname">BMenu</code></a>s).
|
||
To add an item to a menu, call
|
||
<a class="link" href="BMenu.html#BMenu_AddItem" title="AddItem()"><code class="methodname">AddItem()</code></a>.
|
||
</p><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="id550557"></a>Menu Hierarchy</h3></div></div></div><p>
|
||
Menus are hierarchically arranged; an item in one menu can control
|
||
another menu. The controlled menu is a submenu; the menu that contains
|
||
the item that controls it is its supermenu. A submenu remains hidden
|
||
until the user operates the item that controls it; it becomes hidden
|
||
again when the user is finished with it.
|
||
</p><p>
|
||
The menu at the root of the hierarchy is displayed in a window as a
|
||
list - perhaps a list of just one item. Since it, unlike other menus,
|
||
doesn't have a controlling item, it must remain visible. A root menu is
|
||
therefore a special kind of menu in that it behaves more like an ordinary
|
||
view than do other menus, which stay hidden. Root menus should belong to
|
||
the <a class="link" href="BMenuBar.html" title="BMenuBar"><code class="classname">BMenuBar</code></a>
|
||
class, which is derived from
|
||
<a class="link" href="BMenu.html" title="BMenu"><code class="classname">BMenu</code></a>.
|
||
The typical root menu is a menu bar displayed across the top of a window.
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="id550598"></a>Menu Items</h3></div></div></div><p>
|
||
Each item in a menu is a kind of
|
||
<a class="link" href="BMenuItem.html" title="BMenuItem"><code class="classname">BMenuItem</code></a> object. An item can be marked
|
||
(displayed with a check mark to its left), assigned a keyboard shortcut,
|
||
enabled and disabled, and given a "trigger" character that the user can
|
||
type to invoke the item when its menu is open on-screen.
|
||
</p><p>
|
||
Every item has a particular job to do. If an item controls a submenu, its
|
||
job is to show the submenu on-screen and hide it again. All other items
|
||
give instructions to the application. When invoked by the user, they
|
||
deliver a
|
||
<a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a>
|
||
to a target
|
||
<a class="link" href="BHandler.html" title="BHandler"><code class="classname">BHandler</code></a>.
|
||
What the item does depends on the content of the
|
||
<a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a>
|
||
and the
|
||
<a class="link" href="BHandler.html" title="BHandler"><code class="classname">BHandler</code></a>'s
|
||
response to it.
|
||
</p></div></div><div id="footer"><hr /><div id="footerT">Prev: <a href="BListView_Overview.html">BListView</a> Up: <a href="TheInterfaceKit_Overview.html">The Interface Kit</a> Next: <a href="BMenuBar_Overview.html">BMenuBar</a> </div><div id="footerB"><div id="footerBL"><a href="BListView_Overview.html" title="BListView"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a href="TheInterfaceKit_Overview.html" title="The Interface Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a href="BMenuBar_Overview.html" title="BMenuBar"><img src="./images/navigation/next.png" alt="Next" /></a></div><div id="footerBR"><div><a href="http://www.haiku-os.org"><img src="./images/People_24.png" alt="haiku-os.org" title="Visit The Haiku Website" /></a></div><div class="navighome" title="Home"><a accesskey="h" href="index.html"><img src="./images/navigation/home.png" alt="Home" /></a></div></div><div id="footerBC"><a href="http://www.access-company.com/home.html" title="ACCESS Co."><img alt="Access Company" src="./images/access_logo.png" /></a></div></div></div><div id="licenseFooter"><div id="licenseFooterBL"><a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/" title="Creative Commons License"><img alt="Creative Commons License" style="border-width:0" src="https://licensebuttons.net/l/by-nc-nd/3.0/88x31.png" /></a></div><div id="licenseFooterBR"><a href="./LegalNotice.html">Legal Notice</a></div><div id="licenseFooterBC"><span id="licenseText">This work is licensed under a
|
||
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Creative
|
||
Commons Attribution-Non commercial-No Derivative Works 3.0 License</a>.</span></div></div></body></html>
|