Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > b3a1f4d91c26f535919e39e25606614a > files > 1907

wt-doc-3.2.3-1.fc18.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Wt: Wt::WMenuItem Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Wt
   &#160;<span id="projectnumber">3.2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespaceWt.html">Wt</a>      </li>
      <li class="navelem"><a class="el" href="classWt_1_1WMenuItem.html">WMenuItem</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">Wt::WMenuItem Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="Wt::WMenuItem" --><!-- doxytag: inherits="Wt::WObject" -->
<p>A single item in a menu.  
 <a href="classWt_1_1WMenuItem.html#details">More...</a></p>
<div class="dynheader">
Inheritance diagram for Wt::WMenuItem:</div>
<div class="dyncontent">
<div class="center"><img src="classWt_1_1WMenuItem__inherit__graph.png" border="0" usemap="#Wt_1_1WMenuItem_inherit__map" alt="Inheritance graph"/></div>
<map name="Wt_1_1WMenuItem_inherit__map" id="Wt_1_1WMenuItem_inherit__map">
<area shape="rect" href="classWt_1_1WSubMenuItem.html" title="A menu item that contains a nested sub menu." alt="" coords="5,155,144,181"/><area shape="rect" href="classWt_1_1WObject.html" title="A base class for objects that participate in the signal/slot system." alt="" coords="27,5,123,32"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="classWt_1_1WMenuItem-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#a5e276ed0505694a7b89a1dd0c62aa55a">LoadPolicy</a> { <a class="el" href="classWt_1_1WMenuItem.html#a5e276ed0505694a7b89a1dd0c62aa55aa58296165dae031cb608e3d198ed0dee0">LazyLoading</a>, 
<a class="el" href="classWt_1_1WMenuItem.html#a5e276ed0505694a7b89a1dd0c62aa55aa7917744540a0fbf7f6822014550f990b">PreLoading</a>
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enumeration that determines when contents should be loaded.  <a href="classWt_1_1WMenuItem.html#a5e276ed0505694a7b89a1dd0c62aa55a">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#a772f165f3dc02138c28d74f1f42d1a45">WMenuItem</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;text, <a class="el" href="classWt_1_1WWidget.html">WWidget</a> *contents, <a class="el" href="classWt_1_1WMenuItem.html#a5e276ed0505694a7b89a1dd0c62aa55a">LoadPolicy</a> policy=LazyLoading)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new item.  <a href="#a772f165f3dc02138c28d74f1f42d1a45"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#ae9f4792069fcf2f3410c002fdab2d2f1">setText</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;text)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the text for this item.  <a href="#ae9f4792069fcf2f3410c002fdab2d2f1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#a2061c3c242e98e53c820bfa500db492c">text</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the text for this item.  <a href="#a2061c3c242e98e53c820bfa500db492c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#a4291756303dbf128b718679cdb907a5a">setPathComponent</a> (const std::string &amp;path)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the path component for this item.  <a href="#a4291756303dbf128b718679cdb907a5a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#a5ab0b5430b9fb852a45886deb0ff01b1">pathComponent</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the path component for this item.  <a href="#a5ab0b5430b9fb852a45886deb0ff01b1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#a59b6dee6c95ae958f0c3b76d5ef7272d">setCloseable</a> (bool closeable)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Make it possible to close this item interactively or by <a class="el" href="classWt_1_1WMenuItem.html#a9da31eaf6a40078207bbf484d21b9285" title="Closes this item.">close()</a>.  <a href="#a59b6dee6c95ae958f0c3b76d5ef7272d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#ae03b46148932c131c587309d467e8726">isCloseable</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether the item is closeable.  <a href="#ae03b46148932c131c587309d467e8726"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#a9da31eaf6a40078207bbf484d21b9285">close</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Closes this item.  <a href="#a9da31eaf6a40078207bbf484d21b9285"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#a0b58d771300d77ca4469cb3c593fc5a7">setHidden</a> (bool hidden)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets whether the item widget is hidden.  <a href="#a0b58d771300d77ca4469cb3c593fc5a7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#ae1f847ff58f4cc42074d17533b6d630f">isHidden</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether the item widget is hidden.  <a href="#ae1f847ff58f4cc42074d17533b6d630f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#a0adfa71810c98c38de6e320fc055fef0">hide</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Hides the item widget.  <a href="#a0adfa71810c98c38de6e320fc055fef0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#ae3d9bf7a2961a00164fea173e21b8506">show</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Shows the item widget.  <a href="#ae3d9bf7a2961a00164fea173e21b8506"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#a68e76f69ea40e66b9f478a84a06e44a8">setDisabled</a> (bool disabled)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables or disables an item.  <a href="#a68e76f69ea40e66b9f478a84a06e44a8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#af0516fd47f049e1ffc571bccfa45c65e">isDisabled</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether an item is enabled.  <a href="#af0516fd47f049e1ffc571bccfa45c65e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#aa45b04a291e4d07d704bab6fd0341794">enable</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables the item.  <a href="#aa45b04a291e4d07d704bab6fd0341794"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#a777dd93e35f1eb7d91e6f6f2795918da">disable</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Disables the item.  <a href="#a777dd93e35f1eb7d91e6f6f2795918da"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#ab762c297976419ee419884572b7e7506">setToolTip</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;tip)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a tooltip.  <a href="#ab762c297976419ee419884572b7e7506"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac3cb0dce81168657669e9574950618dd"></a><!-- doxytag: member="Wt::WMenuItem::toolTip" ref="ac3cb0dce81168657669e9574950618dd" args="() const " -->
const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#ac3cb0dce81168657669e9574950618dd">toolTip</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the tooltip. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a768d7928949e1d54c0e85dba488e3ea6"></a><!-- doxytag: member="Wt::WMenuItem::menu" ref="a768d7928949e1d54c0e85dba488e3ea6" args="() const " -->
<a class="el" href="classWt_1_1WMenu.html">WMenu</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#a768d7928949e1d54c0e85dba488e3ea6">menu</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the menu. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classWt_1_1WWidget.html">WWidget</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#a961bb119e2231aa47d31d829178899d6">contents</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the contents widget for this item.  <a href="#a961bb119e2231aa47d31d829178899d6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classWt_1_1WWidget.html">WWidget</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#a185b334943c3e07d63d3e45a17e960f7">itemWidget</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the widget that represents the item.  <a href="#a185b334943c3e07d63d3e45a17e960f7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#a9acd8465249e221093f87d9a726c33af">select</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Selects this item.  <a href="#a9acd8465249e221093f87d9a726c33af"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classWt_1_1WWidget.html">WWidget</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#a5dd1286e97b110b621e00e02e58a15d2">createItemWidget</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates the widget that represents the item.  <a href="#a5dd1286e97b110b621e00e02e58a15d2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#adf18031f469001bdd5333cff0a66a9a4">updateItemWidget</a> (<a class="el" href="classWt_1_1WWidget.html">WWidget</a> *itemWidget)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the widget that represents the item.  <a href="#adf18031f469001bdd5333cff0a66a9a4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#a3af62f2a97827c844e021ad2dd3f6085">renderSelected</a> (bool selected)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Renders the item as selected or unselected.  <a href="#a3af62f2a97827c844e021ad2dd3f6085"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classWt_1_1SignalBase.html">SignalBase</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#a5f1d03e160011fcd39759b681f8bc063">activateSignal</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the signal used to activate the item.  <a href="#a5f1d03e160011fcd39759b681f8bc063"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classWt_1_1SignalBase.html">SignalBase</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#a41f18df878ec8f23247c4c1e9d2ee5e1">closeSignal</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the signal used to close the item.  <a href="#a41f18df878ec8f23247c4c1e9d2ee5e1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WMenuItem.html#a5a000f3fe0b005bec22153f44a50bd12">enableAjax</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Progresses to an Ajax-enabled widget.  <a href="#a5a000f3fe0b005bec22153f44a50bd12"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>A single item in a menu. </p>
<p>The item determines the look and behaviour of a single item in a <a class="el" href="classWt_1_1WMenu.html" title="A widget that shows a menu of options.">WMenu</a>.</p>
<p>By default, for enabled menu items a <a class="el" href="classWt_1_1WMenuItem.html" title="A single item in a menu.">WMenuItem</a> uses a <a class="el" href="classWt_1_1WAnchor.html" title="A widget that represents an HTML anchor (to link to other documents).">WAnchor</a> widget. For disabled menu items it uses a <a class="el" href="classWt_1_1WText.html" title="A widget that renders (XHTML) text.">WText</a> widget. If item is closeable, <a class="el" href="classWt_1_1WMenuItem.html" title="A single item in a menu.">WMenuItem</a> puts these widgets and extra <a class="el" href="classWt_1_1WText.html" title="A widget that renders (XHTML) text.">WText</a> widget (for a close icon) in a <a class="el" href="classWt_1_1WContainerWidget.html" title="A widget that holds and manages child widgets.">WContainerWidget</a>. When the menu participates in application internal paths (see <a class="el" href="classWt_1_1WMenu.html#ae1807eba0b1002808dbec779d00a79dc" title="Enables internal paths for items.">WMenu::setInternalPathEnabled()</a>), the anchor references the bookmark URL corresponding to the <a class="el" href="classWt_1_1WMenuItem.html#a5ab0b5430b9fb852a45886deb0ff01b1" title="Returns the path component for this item.">pathComponent()</a> for the item (see <a class="el" href="classWt_1_1WApplication.html#a37b4cf44f393688785ed3b34f53fead1" title="Returns a bookmarkable URL for the current internal path.">WApplication::bookmarkUrl()</a>).</p>
<p>To provide another look for the menu items (such as perhaps adding an icon), you can specialize this class, and reimplement the virtual methods:</p>
<ul>
<li><a class="el" href="classWt_1_1WMenuItem.html#a5dd1286e97b110b621e00e02e58a15d2" title="Creates the widget that represents the item.">createItemWidget()</a>: to provide another widget to represent the item.</li>
<li><a class="el" href="classWt_1_1WMenuItem.html#adf18031f469001bdd5333cff0a66a9a4" title="Updates the widget that represents the item.">updateItemWidget()</a>: to update the widget to reflect item changes, triggered by for example <a class="el" href="classWt_1_1WMenuItem.html#ae9f4792069fcf2f3410c002fdab2d2f1" title="Sets the text for this item.">setText()</a> and <a class="el" href="classWt_1_1WMenuItem.html#a4291756303dbf128b718679cdb907a5a" title="Sets the path component for this item.">setPathComponent()</a>.</li>
<li>optionally, <a class="el" href="classWt_1_1WMenuItem.html#a5f1d03e160011fcd39759b681f8bc063" title="Returns the signal used to activate the item.">activateSignal()</a>: to bind the event for activating the item to something else than the clicked event.</li>
<li>optionally, <a class="el" href="classWt_1_1WMenuItem.html#a41f18df878ec8f23247c4c1e9d2ee5e1" title="Returns the signal used to close the item.">closeSignal()</a>: to bind the event for closing the item to something else than the clicked event.</li>
<li>optionally, <a class="el" href="classWt_1_1WMenuItem.html#a3af62f2a97827c844e021ad2dd3f6085" title="Renders the item as selected or unselected.">renderSelected(bool)</a>: if you need to do additional styling to reflect a selection, other than changing style classes.</li>
</ul>
<p>To provide another look for the close icon you can override <code>Wt-closeicon</code> CSS class (see <a class="el" href="classWt_1_1WMenu.html" title="A widget that shows a menu of options.">WMenu</a> for more details).</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WMenu.html" title="A widget that shows a menu of options.">WMenu</a> </dd>
<dd>
<a class="el" href="classWt_1_1WMenu.html#acbccfeebf2c93244516dec81dcc56fda" title="Adds an item.">WMenu::addItem(WMenuItem *)</a> </dd></dl>
</div><hr/><h2>Member Enumeration Documentation</h2>
<a class="anchor" id="a5e276ed0505694a7b89a1dd0c62aa55a"></a><!-- doxytag: member="Wt::WMenuItem::LoadPolicy" ref="a5e276ed0505694a7b89a1dd0c62aa55a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classWt_1_1WMenuItem.html#a5e276ed0505694a7b89a1dd0c62aa55a">Wt::WMenuItem::LoadPolicy</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Enumeration that determines when contents should be loaded. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="a5e276ed0505694a7b89a1dd0c62aa55aa58296165dae031cb608e3d198ed0dee0"></a><!-- doxytag: member="LazyLoading" ref="a5e276ed0505694a7b89a1dd0c62aa55aa58296165dae031cb608e3d198ed0dee0" args="" -->LazyLoading</em>&nbsp;</td><td>
<p>Lazy loading: on first use. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a5e276ed0505694a7b89a1dd0c62aa55aa7917744540a0fbf7f6822014550f990b"></a><!-- doxytag: member="PreLoading" ref="a5e276ed0505694a7b89a1dd0c62aa55aa7917744540a0fbf7f6822014550f990b" args="" -->PreLoading</em>&nbsp;</td><td>
<p>Pre-loading: before first use. </p>
</td></tr>
</table>
</dd>
</dl>

</div>
</div>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a772f165f3dc02138c28d74f1f42d1a45"></a><!-- doxytag: member="Wt::WMenuItem::WMenuItem" ref="a772f165f3dc02138c28d74f1f42d1a45" args="(const WString &amp;text, WWidget *contents, LoadPolicy policy=LazyLoading)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Wt::WMenuItem::WMenuItem </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;&#160;</td>
          <td class="paramname"><em>text</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classWt_1_1WWidget.html">WWidget</a> *&#160;</td>
          <td class="paramname"><em>contents</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classWt_1_1WMenuItem.html#a5e276ed0505694a7b89a1dd0c62aa55a">LoadPolicy</a>&#160;</td>
          <td class="paramname"><em>policy</em> = <code>LazyLoading</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates a new item. </p>
<p>The text specifies the item text. The contents is the widget that must be shown in the <a class="el" href="classWt_1_1WMenu.html" title="A widget that shows a menu of options.">WMenu</a> contents stack when the item is selected.</p>
<p>The load policy specifies whether the contents widgets is transmitted only when it the item is activated for the first time (LazyLoading) or transmitted prior to first rendering.</p>
<p>The <a class="el" href="classWt_1_1WMenuItem.html#a5ab0b5430b9fb852a45886deb0ff01b1" title="Returns the path component for this item.">pathComponent()</a> is derived from <code>text</code>, and can be customized using <a class="el" href="classWt_1_1WMenuItem.html#a4291756303dbf128b718679cdb907a5a" title="Sets the path component for this item.">setPathComponent()</a>.</p>
<p><code>contents</code> may be 0, in which case no contents is associated with the item in the contents stack. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a5f1d03e160011fcd39759b681f8bc063"></a><!-- doxytag: member="Wt::WMenuItem::activateSignal" ref="a5f1d03e160011fcd39759b681f8bc063" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1SignalBase.html">SignalBase</a> &amp; Wt::WMenuItem::activateSignal </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the signal used to activate the item. </p>
<p>The default implementation will tries to cast the <a class="el" href="classWt_1_1WMenuItem.html#a185b334943c3e07d63d3e45a17e960f7" title="Returns the widget that represents the item.">itemWidget()</a> or its first child if item is <a class="el" href="classWt_1_1WMenuItem.html#a59b6dee6c95ae958f0c3b76d5ef7272d">closeable</a> to a <a class="el" href="classWt_1_1WInteractWidget.html" title="An abstract widget that can receive user-interface interaction.">WInteractWidget</a> and returns the <a class="el" href="classWt_1_1WInteractWidget.html#ae11e050cce0d4a8f742afa3ef92bfe8c">clicked signal</a>. </p>

<p>Reimplemented in <a class="el" href="classWt_1_1WSubMenuItem.html#a38d7a0fa3581f34aa72c9fd4d1a6eaeb">Wt::WSubMenuItem</a>.</p>

</div>
</div>
<a class="anchor" id="a9da31eaf6a40078207bbf484d21b9285"></a><!-- doxytag: member="Wt::WMenuItem::close" ref="a9da31eaf6a40078207bbf484d21b9285" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WMenuItem::close </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Closes this item. </p>
<p>Hides the item widget and emits <a class="el" href="classWt_1_1WMenu.html#ab9fa68e381972fb5385478b1e9eb6c78" title="Signal which indicates that an item was closed.">WMenu::itemClosed()</a> signal. Only closeable items can be closed.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WMenuItem.html#a59b6dee6c95ae958f0c3b76d5ef7272d" title="Make it possible to close this item interactively or by close().">setCloseable()</a>, <a class="el" href="classWt_1_1WMenuItem.html#a0adfa71810c98c38de6e320fc055fef0" title="Hides the item widget.">hide()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a41f18df878ec8f23247c4c1e9d2ee5e1"></a><!-- doxytag: member="Wt::WMenuItem::closeSignal" ref="a41f18df878ec8f23247c4c1e9d2ee5e1" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1SignalBase.html">SignalBase</a> &amp; Wt::WMenuItem::closeSignal </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the signal used to close the item. </p>
<p>The default implementation will tries to cast the <a class="el" href="classWt_1_1WMenuItem.html#a185b334943c3e07d63d3e45a17e960f7" title="Returns the widget that represents the item.">itemWidget()</a> (or its second child if item is <a class="el" href="classWt_1_1WMenuItem.html#a59b6dee6c95ae958f0c3b76d5ef7272d">closeable</a>) to a <a class="el" href="classWt_1_1WInteractWidget.html" title="An abstract widget that can receive user-interface interaction.">WInteractWidget</a> and returns the <a class="el" href="classWt_1_1WInteractWidget.html#ae11e050cce0d4a8f742afa3ef92bfe8c">clicked signal</a>. </p>

</div>
</div>
<a class="anchor" id="a961bb119e2231aa47d31d829178899d6"></a><!-- doxytag: member="Wt::WMenuItem::contents" ref="a961bb119e2231aa47d31d829178899d6" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1WWidget.html">WWidget</a> * Wt::WMenuItem::contents </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the contents widget for this item. </p>
<p>The contents widget is the widget in the <a class="el" href="classWt_1_1WStackedWidget.html" title="A container widget that stacks its widgets on top of each other.">WStackedWidget</a> associated with this item. </p>

</div>
</div>
<a class="anchor" id="a5dd1286e97b110b621e00e02e58a15d2"></a><!-- doxytag: member="Wt::WMenuItem::createItemWidget" ref="a5dd1286e97b110b621e00e02e58a15d2" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1WWidget.html">WWidget</a> * Wt::WMenuItem::createItemWidget </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates the widget that represents the item. </p>
<p>The default implementation will return:</p>
<ul>
<li>a <a class="el" href="classWt_1_1WAnchor.html" title="A widget that represents an HTML anchor (to link to other documents).">WAnchor</a> if item is not closeable and enabled;</li>
<li>a <a class="el" href="classWt_1_1WText.html" title="A widget that renders (XHTML) text.">WText</a> if item is not closeable and disabled;</li>
<li>a <a class="el" href="classWt_1_1WContainerWidget.html" title="A widget that holds and manages child widgets.">WContainerWidget</a> with <a class="el" href="classWt_1_1WAnchor.html" title="A widget that represents an HTML anchor (to link to other documents).">WAnchor</a> or <a class="el" href="classWt_1_1WText.html" title="A widget that renders (XHTML) text.">WText</a> (the label of enabled or disabled item accordingly) and <a class="el" href="classWt_1_1WText.html" title="A widget that renders (XHTML) text.">WText</a> (the close icon) inside if item is closeable.</li>
</ul>
<p>A call to <a class="el" href="classWt_1_1WMenuItem.html#a5dd1286e97b110b621e00e02e58a15d2" title="Creates the widget that represents the item.">createItemWidget()</a> is immediately followed by <a class="el" href="classWt_1_1WMenuItem.html#adf18031f469001bdd5333cff0a66a9a4" title="Updates the widget that represents the item.">updateItemWidget()</a>.</p>
<p>If you reimplement this method, you should probably also reimplement <a class="el" href="classWt_1_1WMenuItem.html#adf18031f469001bdd5333cff0a66a9a4" title="Updates the widget that represents the item.">updateItemWidget()</a>. </p>

<p>Reimplemented in <a class="el" href="classWt_1_1WSubMenuItem.html#a3883ce17fd7d04553510700189fbc7af">Wt::WSubMenuItem</a>.</p>

</div>
</div>
<a class="anchor" id="a777dd93e35f1eb7d91e6f6f2795918da"></a><!-- doxytag: member="Wt::WMenuItem::disable" ref="a777dd93e35f1eb7d91e6f6f2795918da" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WMenuItem::disable </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Disables the item. </p>
<p>This calls <a class="el" href="classWt_1_1WMenuItem.html#a68e76f69ea40e66b9f478a84a06e44a8">setDisabled(true)</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WMenuItem.html#aa45b04a291e4d07d704bab6fd0341794" title="Enables the item.">enable()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="aa45b04a291e4d07d704bab6fd0341794"></a><!-- doxytag: member="Wt::WMenuItem::enable" ref="aa45b04a291e4d07d704bab6fd0341794" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WMenuItem::enable </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Enables the item. </p>
<p>This calls <a class="el" href="classWt_1_1WMenuItem.html#a68e76f69ea40e66b9f478a84a06e44a8">setDisabled(false)</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WMenuItem.html#a777dd93e35f1eb7d91e6f6f2795918da" title="Disables the item.">disable()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a5a000f3fe0b005bec22153f44a50bd12"></a><!-- doxytag: member="Wt::WMenuItem::enableAjax" ref="a5a000f3fe0b005bec22153f44a50bd12" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WMenuItem::enableAjax </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Progresses to an Ajax-enabled widget. </p>
<p>This method is called when the progressive bootstrap method is used, and support for AJAX has been detected. The default behavior will upgrade the menu and the contents event handling to use AJAX instead of full page reloads.</p>
<p>You may want to reimplement this method if you want to make changes to widget when AJAX is enabled.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WMenu.html#aea92a8e3abe2ac6130eb93acec605ec9" title="Progresses to an Ajax-enabled widget.">WMenu::enableAjax()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a0adfa71810c98c38de6e320fc055fef0"></a><!-- doxytag: member="Wt::WMenuItem::hide" ref="a0adfa71810c98c38de6e320fc055fef0" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WMenuItem::hide </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Hides the item widget. </p>
<p>This calls <a class="el" href="classWt_1_1WMenuItem.html#a0b58d771300d77ca4469cb3c593fc5a7">setHidden(true)</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WMenuItem.html#ae3d9bf7a2961a00164fea173e21b8506" title="Shows the item widget.">show()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ae03b46148932c131c587309d467e8726"></a><!-- doxytag: member="Wt::WMenuItem::isCloseable" ref="ae03b46148932c131c587309d467e8726" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Wt::WMenuItem::isCloseable </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns whether the item is closeable. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WMenuItem.html#a59b6dee6c95ae958f0c3b76d5ef7272d" title="Make it possible to close this item interactively or by close().">setCloseable()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="af0516fd47f049e1ffc571bccfa45c65e"></a><!-- doxytag: member="Wt::WMenuItem::isDisabled" ref="af0516fd47f049e1ffc571bccfa45c65e" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Wt::WMenuItem::isDisabled </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns whether an item is enabled. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WMenuItem.html#a68e76f69ea40e66b9f478a84a06e44a8" title="Enables or disables an item.">setDisabled()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ae1f847ff58f4cc42074d17533b6d630f"></a><!-- doxytag: member="Wt::WMenuItem::isHidden" ref="ae1f847ff58f4cc42074d17533b6d630f" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Wt::WMenuItem::isHidden </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns whether the item widget is hidden. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WMenuItem.html#a0b58d771300d77ca4469cb3c593fc5a7" title="Sets whether the item widget is hidden.">setHidden()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a185b334943c3e07d63d3e45a17e960f7"></a><!-- doxytag: member="Wt::WMenuItem::itemWidget" ref="a185b334943c3e07d63d3e45a17e960f7" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1WWidget.html">WWidget</a> * Wt::WMenuItem::itemWidget </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the widget that represents the item. </p>
<p>This returns the item widget, creating it using <a class="el" href="classWt_1_1WMenuItem.html#a5dd1286e97b110b621e00e02e58a15d2" title="Creates the widget that represents the item.">createItemWidget()</a> if necessary. </p>

</div>
</div>
<a class="anchor" id="a5ab0b5430b9fb852a45886deb0ff01b1"></a><!-- doxytag: member="Wt::WMenuItem::pathComponent" ref="a5ab0b5430b9fb852a45886deb0ff01b1" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string Wt::WMenuItem::pathComponent </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the path component for this item. </p>
<p>You may want to reimplement this to customize the path component set by the item in the application internal path.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WMenuItem.html#a4291756303dbf128b718679cdb907a5a" title="Sets the path component for this item.">setPathComponent()</a></dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>the <code>path</code> component is UTF8 encoded (we may fix the API to use <a class="el" href="classWt_1_1WString.html" title="A value class which describes a locale-aware unicode string.">WString</a> in the future). </dd></dl>

<p>Reimplemented in <a class="el" href="classWt_1_1WSubMenuItem.html#af774d49f24f2ee362cc28eb688cb9eef">Wt::WSubMenuItem</a>.</p>

</div>
</div>
<a class="anchor" id="a3af62f2a97827c844e021ad2dd3f6085"></a><!-- doxytag: member="Wt::WMenuItem::renderSelected" ref="a3af62f2a97827c844e021ad2dd3f6085" args="(bool selected)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WMenuItem::renderSelected </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>selected</em></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Renders the item as selected or unselected. </p>
<p>The default implementation sets the styleclass for <a class="el" href="classWt_1_1WMenuItem.html#a185b334943c3e07d63d3e45a17e960f7" title="Returns the widget that represents the item.">itemWidget()</a> to 'item' for an unselected not closeable, 'itemselected' for selected not closeable, 'citem' for an unselected closeable and 'citemselected' for selected closeable item.</p>
<p>Note that this method is called from within a stateless slot implementation, and thus should be stateless as well. </p>

<p>Reimplemented in <a class="el" href="classWt_1_1WSubMenuItem.html#ad3096bef2abbc291cb2560cd16d92458">Wt::WSubMenuItem</a>.</p>

</div>
</div>
<a class="anchor" id="a9acd8465249e221093f87d9a726c33af"></a><!-- doxytag: member="Wt::WMenuItem::select" ref="a9acd8465249e221093f87d9a726c33af" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WMenuItem::select </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Selects this item. </p>
<p>If the item was previously closed it will be shown.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WMenuItem.html#a9da31eaf6a40078207bbf484d21b9285" title="Closes this item.">close()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a59b6dee6c95ae958f0c3b76d5ef7272d"></a><!-- doxytag: member="Wt::WMenuItem::setCloseable" ref="a59b6dee6c95ae958f0c3b76d5ef7272d" args="(bool closeable)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WMenuItem::setCloseable </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>closeable</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Make it possible to close this item interactively or by <a class="el" href="classWt_1_1WMenuItem.html#a9da31eaf6a40078207bbf484d21b9285" title="Closes this item.">close()</a>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WMenuItem.html#a9da31eaf6a40078207bbf484d21b9285" title="Closes this item.">close()</a>, <a class="el" href="classWt_1_1WMenuItem.html#ae03b46148932c131c587309d467e8726" title="Returns whether the item is closeable.">isCloseable()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a68e76f69ea40e66b9f478a84a06e44a8"></a><!-- doxytag: member="Wt::WMenuItem::setDisabled" ref="a68e76f69ea40e66b9f478a84a06e44a8" args="(bool disabled)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WMenuItem::setDisabled </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>disabled</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Enables or disables an item. </p>
<p>A disabled item cannot be activated.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WMenuItem.html#aa45b04a291e4d07d704bab6fd0341794" title="Enables the item.">enable()</a>, <a class="el" href="classWt_1_1WMenuItem.html#a777dd93e35f1eb7d91e6f6f2795918da" title="Disables the item.">disable()</a>, isEnabled() </dd></dl>

</div>
</div>
<a class="anchor" id="a0b58d771300d77ca4469cb3c593fc5a7"></a><!-- doxytag: member="Wt::WMenuItem::setHidden" ref="a0b58d771300d77ca4469cb3c593fc5a7" args="(bool hidden)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WMenuItem::setHidden </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>hidden</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets whether the item widget is hidden. </p>
<p>Hides or show the item widget.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WMenuItem.html#a0adfa71810c98c38de6e320fc055fef0" title="Hides the item widget.">hide()</a>, <a class="el" href="classWt_1_1WMenuItem.html#ae3d9bf7a2961a00164fea173e21b8506" title="Shows the item widget.">show()</a>, <a class="el" href="classWt_1_1WMenuItem.html#ae1f847ff58f4cc42074d17533b6d630f" title="Returns whether the item widget is hidden.">isHidden()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a4291756303dbf128b718679cdb907a5a"></a><!-- doxytag: member="Wt::WMenuItem::setPathComponent" ref="a4291756303dbf128b718679cdb907a5a" args="(const std::string &amp;path)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WMenuItem::setPathComponent </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>path</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets the path component for this item. </p>
<p>The path component is used by the menu item in the application internal path (see <a class="el" href="classWt_1_1WApplication.html#a2c1a10aadc0d7ed877b5715b42ca4911" title="Changes the internal path.">WApplication::setInternalPath()</a>), when internal paths are enabled (see <a class="el" href="classWt_1_1WMenu.html#ae1807eba0b1002808dbec779d00a79dc" title="Enables internal paths for items.">WMenu::setInternalPathEnabled()</a>) for the menu.</p>
<p>You may specify an empty <code>path</code> to let a menu item be the "default" menu option.</p>
<p>For example, if <a class="el" href="classWt_1_1WMenu.html#a8cdf2f75f67efa0c10c6fb25fd1cd4da" title="Returns the internal base path.">WMenu::internalBasePath()</a> is <code>"/examples/"</code> and <a class="el" href="classWt_1_1WMenuItem.html#a5ab0b5430b9fb852a45886deb0ff01b1" title="Returns the path component for this item.">pathComponent()</a> for is <code>"charts/"</code>, then the internal path for the item will be <code>"/examples/charts/"</code>.</p>
<p>By default, the path is automatically derived from <a class="el" href="classWt_1_1WMenuItem.html#a2061c3c242e98e53c820bfa500db492c" title="Returns the text for this item.">text()</a>. If a <a class="el" href="classWt_1_1WString.html#a61a714a97bb6d70d60be6f9a1997e636">literal text</a> is used, the path is based on the text itself, otherwise on the <a class="el" href="classWt_1_1WString.html#a18807776c41bdaebd7264bbabdd2282a">key</a>. It is converted to lower case, and replacing white space and special characters with '_'.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WMenuItem.html#ae9f4792069fcf2f3410c002fdab2d2f1" title="Sets the text for this item.">setText()</a>, <a class="el" href="classWt_1_1WMenu.html#ae1807eba0b1002808dbec779d00a79dc" title="Enables internal paths for items.">WMenu::setInternalPathEnabled()</a></dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>the <code>path</code> should be UTF8 encoded (we may fix the API to use <a class="el" href="classWt_1_1WString.html" title="A value class which describes a locale-aware unicode string.">WString</a> in the future). </dd></dl>

</div>
</div>
<a class="anchor" id="ae9f4792069fcf2f3410c002fdab2d2f1"></a><!-- doxytag: member="Wt::WMenuItem::setText" ref="ae9f4792069fcf2f3410c002fdab2d2f1" args="(const WString &amp;text)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WMenuItem::setText </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;&#160;</td>
          <td class="paramname"><em>text</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets the text for this item. </p>
<p>Unless a custom path component was defined, the <a class="el" href="classWt_1_1WMenuItem.html#a5ab0b5430b9fb852a45886deb0ff01b1" title="Returns the path component for this item.">pathComponent()</a> is also updated based on the new text.</p>
<p>The item widget is updated using <a class="el" href="classWt_1_1WMenuItem.html#adf18031f469001bdd5333cff0a66a9a4" title="Updates the widget that represents the item.">updateItemWidget()</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WMenuItem.html#a4291756303dbf128b718679cdb907a5a" title="Sets the path component for this item.">setPathComponent()</a>; </dd></dl>

</div>
</div>
<a class="anchor" id="ab762c297976419ee419884572b7e7506"></a><!-- doxytag: member="Wt::WMenuItem::setToolTip" ref="ab762c297976419ee419884572b7e7506" args="(const WString &amp;tip)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WMenuItem::setToolTip </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;&#160;</td>
          <td class="paramname"><em>tip</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets a tooltip. </p>
<p>The tooltip is displayed when the cursor hovers over the label of the item, i.e. <a class="el" href="classWt_1_1WAnchor.html" title="A widget that represents an HTML anchor (to link to other documents).">WAnchor</a> or <a class="el" href="classWt_1_1WText.html" title="A widget that renders (XHTML) text.">WText</a>, depending on whether the item is enabled or not (see <a class="el" href="classWt_1_1WMenuItem.html#a5dd1286e97b110b621e00e02e58a15d2" title="Creates the widget that represents the item.">createItemWidget()</a>).</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WMenuItem.html#ac3cb0dce81168657669e9574950618dd" title="Returns the tooltip.">toolTip()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ae3d9bf7a2961a00164fea173e21b8506"></a><!-- doxytag: member="Wt::WMenuItem::show" ref="ae3d9bf7a2961a00164fea173e21b8506" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WMenuItem::show </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Shows the item widget. </p>
<p>If the item was previously closed it will be shown.</p>
<p>This calls <a class="el" href="classWt_1_1WMenuItem.html#a0b58d771300d77ca4469cb3c593fc5a7">setHidden(false)</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WMenuItem.html#a0adfa71810c98c38de6e320fc055fef0" title="Hides the item widget.">hide()</a>, <a class="el" href="classWt_1_1WMenuItem.html#a9acd8465249e221093f87d9a726c33af" title="Selects this item.">select()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a2061c3c242e98e53c820bfa500db492c"></a><!-- doxytag: member="Wt::WMenuItem::text" ref="a2061c3c242e98e53c820bfa500db492c" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classWt_1_1WString.html">WString</a>&amp; Wt::WMenuItem::text </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the text for this item. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WMenuItem.html#ae9f4792069fcf2f3410c002fdab2d2f1" title="Sets the text for this item.">setText()</a>; </dd></dl>

</div>
</div>
<a class="anchor" id="adf18031f469001bdd5333cff0a66a9a4"></a><!-- doxytag: member="Wt::WMenuItem::updateItemWidget" ref="adf18031f469001bdd5333cff0a66a9a4" args="(WWidget *itemWidget)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WMenuItem::updateItemWidget </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classWt_1_1WWidget.html">WWidget</a> *&#160;</td>
          <td class="paramname"><em>itemWidget</em></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Updates the widget that represents the item. </p>
<p>The default implementation will cast the <code>itemWidget</code> to a <a class="el" href="classWt_1_1WAnchor.html" title="A widget that represents an HTML anchor (to link to other documents).">WAnchor</a>, and set the anchor's text and destination according to <a class="el" href="classWt_1_1WMenuItem.html#a2061c3c242e98e53c820bfa500db492c" title="Returns the text for this item.">text()</a> and <a class="el" href="classWt_1_1WMenuItem.html#a5ab0b5430b9fb852a45886deb0ff01b1" title="Returns the path component for this item.">pathComponent()</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WMenuItem.html#a5dd1286e97b110b621e00e02e58a15d2" title="Creates the widget that represents the item.">createItemWidget()</a> </dd></dl>

<p>Reimplemented in <a class="el" href="classWt_1_1WSubMenuItem.html#a44820d1555db0e1f6593dd80d1c0b34e">Wt::WSubMenuItem</a>.</p>

</div>
</div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr size="1"><address style="text-align: right; margin: 3px"><small>
Generated on Thu Nov 1 2012 for <a href="http://www.webtoolkit.eu/wt">the
C++ Web Toolkit (Wt)</a> by&nbsp;<a
href="http://www.doxygen.org/index.html"><img src="doxygen.png"
alt="doxygen" border="0" style="vertical-align: middle; display:
inline-block; height: 2em"></a> 1.7.5.1</small></address>
</body>
</html>