<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>Irrlicht Engine: IGUIContextMenu.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <table class="irrlicht" > <tr valign="middle"> <td><font size="2"><a class="qindex" href="index.html"><font color="#FFFFFF">Home</font></a> | <a class="qindex" href="namespaces.html"><font color="#FFFFFF">Namespaces</font></a> | <a class="qindex" href="hierarchy.html"><font color="#FFFFFF">Hierarchy</font></a> | <a class="qindex" href="classes.html"><font color="#FFFFFF">Alphabetical List</font></a> | <a class="qindex" href="annotated.html"><font color="#FFFFFF"> Class list</font></a> | <a class="qindex" href="files.html"><font color="#FFFFFF">Files</font></a> | <a class="qindex" href="namespacemembers.html"><font color="#FFFFFF"> Namespace Members</font></a> | <a class="qindex" href="functions.html"><font color="#FFFFFF">Class members</font></a> | <a class="qindex" href="globals.html"><font color="#FFFFFF">File members</font></a> | <a class="qindex" href="pages.html"><font color="#FFFFFF">Tutorials</font></a></font> </td> </tr> </table> <!-- Generated by Doxygen 1.6.2 --> <h1>IGUIContextMenu.h</h1><a href="_i_g_u_i_context_menu_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (C) 2002-2010 Nikolaus Gebhardt</span> <a name="l00002"></a>00002 <span class="comment">// This file is part of the "Irrlicht Engine".</span> <a name="l00003"></a>00003 <span class="comment">// For conditions of distribution and use, see copyright notice in irrlicht.h</span> <a name="l00004"></a>00004 <a name="l00005"></a>00005 <span class="preprocessor">#ifndef __I_GUI_CONTEXT_MENU_H_INCLUDED__</span> <a name="l00006"></a>00006 <span class="preprocessor"></span><span class="preprocessor">#define __I_GUI_CONTEXT_MENU_H_INCLUDED__</span> <a name="l00007"></a>00007 <span class="preprocessor"></span> <a name="l00008"></a>00008 <span class="preprocessor">#include "<a class="code" href="_i_g_u_i_element_8h.html">IGUIElement.h</a>"</span> <a name="l00009"></a>00009 <a name="l00010"></a>00010 <span class="keyword">namespace </span>irr <a name="l00011"></a>00011 { <a name="l00012"></a>00012 <span class="keyword">namespace </span>gui <a name="l00013"></a>00013 { <a name="l00016"></a><a class="code" href="namespaceirr_1_1gui.html#a0868ffd1ff3d3fc1e2db2fcd118e320d">00016</a> <span class="keyword">enum</span> <a class="code" href="namespaceirr_1_1gui.html#a0868ffd1ff3d3fc1e2db2fcd118e320d">ECONTEXT_MENU_CLOSE</a> <a name="l00017"></a>00017 { <a name="l00019"></a><a class="code" href="namespaceirr_1_1gui.html#a0868ffd1ff3d3fc1e2db2fcd118e320da701af827d28b95af5669b2f4f6f62730">00019</a> <a class="code" href="namespaceirr_1_1gui.html#a0868ffd1ff3d3fc1e2db2fcd118e320da701af827d28b95af5669b2f4f6f62730" title="do nothing - menu stays open">ECMC_IGNORE</a> = 0, <a name="l00020"></a>00020 <a name="l00022"></a><a class="code" href="namespaceirr_1_1gui.html#a0868ffd1ff3d3fc1e2db2fcd118e320dac9ff67f50d9d60e65b769b25a0773765">00022</a> <a class="code" href="namespaceirr_1_1gui.html#a0868ffd1ff3d3fc1e2db2fcd118e320dac9ff67f50d9d60e65b769b25a0773765" title="remove the gui element">ECMC_REMOVE</a> = 1, <a name="l00023"></a>00023 <a name="l00025"></a><a class="code" href="namespaceirr_1_1gui.html#a0868ffd1ff3d3fc1e2db2fcd118e320da0a2d4fd9048d80e357d1b8a14f7716d0">00025</a> <a class="code" href="namespaceirr_1_1gui.html#a0868ffd1ff3d3fc1e2db2fcd118e320da0a2d4fd9048d80e357d1b8a14f7716d0" title="call setVisible(false)">ECMC_HIDE</a> = 2 <a name="l00026"></a>00026 <a name="l00027"></a>00027 <span class="comment">// note to implementors - this is planned as bitset, so continue with 4 if you need to add further flags.</span> <a name="l00028"></a>00028 }; <a name="l00029"></a>00029 <a name="l00031"></a><a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html">00031</a> <span class="keyword">class </span><a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html" title="GUI Context menu interface.">IGUIContextMenu</a> : <span class="keyword">public</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_element.html" title="Base class of all GUI elements.">IGUIElement</a> <a name="l00032"></a>00032 { <a name="l00033"></a>00033 <span class="keyword">public</span>: <a name="l00034"></a>00034 <a name="l00036"></a><a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#ab7201b420431830aaaf8f9a0a831c859">00036</a> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#ab7201b420431830aaaf8f9a0a831c859" title="constructor">IGUIContextMenu</a>(<a class="code" href="classirr_1_1gui_1_1_i_g_u_i_environment.html" title="GUI Environment. Used as factory and manager of all other GUI elements.">IGUIEnvironment</a>* environment, <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_element.html" title="Base class of all GUI elements.">IGUIElement</a>* parent, <a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> <span class="keywordtype">id</span>, <a class="code" href="classirr_1_1core_1_1rect.html">core::rect<s32></a> rectangle) <a name="l00037"></a>00037 : <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_element.html" title="Base class of all GUI elements.">IGUIElement</a>(<a class="code" href="namespaceirr_1_1gui.html#ae4d66df0ecf4117cdbcf9f22404bd254afb21ae969935037a13fea69e0e3558f4" title="A context menu (IGUIContextMenu).">EGUIET_CONTEXT_MENU</a>, environment, parent, id, rectangle) {} <a name="l00038"></a>00038 <a name="l00040"></a>00040 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#ae58a13dc73dffc7d30a907b76111a36d" title="set behaviour when menus are closed">setCloseHandling</a>(<a class="code" href="namespaceirr_1_1gui.html#a0868ffd1ff3d3fc1e2db2fcd118e320d">ECONTEXT_MENU_CLOSE</a> onClose) = 0; <a name="l00041"></a>00041 <a name="l00043"></a>00043 <span class="keyword">virtual</span> <a class="code" href="namespaceirr_1_1gui.html#a0868ffd1ff3d3fc1e2db2fcd118e320d">ECONTEXT_MENU_CLOSE</a> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#ac9f46b106a1732ab474f3b38bf564edb" title="get current behaviour when the menu will be closed">getCloseHandling</a>() <span class="keyword">const</span> = 0; <a name="l00044"></a>00044 <a name="l00046"></a>00046 <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#a3e65b423c67002b64d6271072b19a829" title="Get amount of menu items.">getItemCount</a>() <span class="keyword">const</span> = 0; <a name="l00047"></a>00047 <a name="l00049"></a>00049 <a name="l00060"></a>00060 <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#afa25240cb37816c3f8941ccc0f2c14ea" title="Adds a menu item.">addItem</a>(<span class="keyword">const</span> <span class="keywordtype">wchar_t</span>* text, <a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> commandId=-1, <span class="keywordtype">bool</span> enabled=<span class="keyword">true</span>, <a name="l00061"></a>00061 <span class="keywordtype">bool</span> hasSubMenu=<span class="keyword">false</span>, <span class="keywordtype">bool</span> checked=<span class="keyword">false</span>, <span class="keywordtype">bool</span> autoChecking=<span class="keyword">false</span>) = 0; <a name="l00062"></a>00062 <a name="l00064"></a>00064 <a name="l00077"></a>00077 <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#ad4695f88c63ffc09690c5ff682c3aabc" title="Insert a menu item at specified position.">insertItem</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> idx, <span class="keyword">const</span> <span class="keywordtype">wchar_t</span>* text, <a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> commandId=-1, <span class="keywordtype">bool</span> enabled=<span class="keyword">true</span>, <a name="l00078"></a>00078 <span class="keywordtype">bool</span> hasSubMenu=<span class="keyword">false</span>, <span class="keywordtype">bool</span> checked=<span class="keyword">false</span>, <span class="keywordtype">bool</span> autoChecking=<span class="keyword">false</span>) = 0; <a name="l00079"></a>00079 <a name="l00081"></a>00081 <a name="l00085"></a>00085 <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#ae7b399d9940ebe566b928517aa150383" title="Find an item by it&#39;s CommandID.">findItemWithCommandId</a>(<a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> commandId, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> idxStartSearch=0) <span class="keyword">const</span> = 0; <a name="l00086"></a>00086 <a name="l00088"></a>00088 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#a36e2edf23c88eed23d32af1d534d5bfc" title="Adds a separator item to the menu.">addSeparator</a>() = 0; <a name="l00089"></a>00089 <a name="l00091"></a>00091 <a name="l00092"></a>00092 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">wchar_t</span>* <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#a18cf836d001f425f617c5a36db3d1ae6" title="Get text of the menu item.">getItemText</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> idx) <span class="keyword">const</span> = 0; <a name="l00093"></a>00093 <a name="l00095"></a>00095 <a name="l00097"></a>00097 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#a20d0e53213a2915a8a62c54b5aa2ff08" title="Sets text of the menu item.">setItemText</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> idx, <span class="keyword">const</span> <span class="keywordtype">wchar_t</span>* text) = 0; <a name="l00098"></a>00098 <a name="l00100"></a>00100 <a name="l00101"></a>00101 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#a0064345c63e1f8e124e64ca96eb486e2" title="Check if a menu item is enabled.">isItemEnabled</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> idx) <span class="keyword">const</span> = 0; <a name="l00102"></a>00102 <a name="l00104"></a>00104 <a name="l00106"></a>00106 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#aa3c36d6cd990f3b488be2c7f419b89ee" title="Sets if the menu item should be enabled.">setItemEnabled</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> idx, <span class="keywordtype">bool</span> enabled) = 0; <a name="l00107"></a>00107 <a name="l00109"></a>00109 <a name="l00111"></a>00111 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#a8abbd1587dcc462f60660d7e606e954e" title="Sets if the menu item should be checked.">setItemChecked</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> idx, <span class="keywordtype">bool</span> enabled) = 0; <a name="l00112"></a>00112 <a name="l00114"></a>00114 <a name="l00115"></a>00115 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#a0ff910b79e5581a97aee8ec9a0679160" title="Check if a menu item is checked.">isItemChecked</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> idx) <span class="keyword">const</span> = 0; <a name="l00116"></a>00116 <a name="l00118"></a>00118 <a name="l00119"></a>00119 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#af8cc0fc0f430044a318d4597f8535e9b" title="Removes a menu item.">removeItem</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> idx) = 0; <a name="l00120"></a>00120 <a name="l00122"></a>00122 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#ac06b8d80fb076c6bed3aef2a17fb01f9" title="Removes all menu items.">removeAllItems</a>() = 0; <a name="l00123"></a>00123 <a name="l00125"></a>00125 <a name="l00126"></a>00126 <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#ae6cd391cf56d4454a855e19feddf8fdc" title="Get the selected item in the menu.">getSelectedItem</a>() <span class="keyword">const</span> = 0; <a name="l00127"></a>00127 <a name="l00129"></a>00129 <a name="l00130"></a>00130 <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#a5edfede62ed558acd68b06eeea0682c3" title="Get the command id of a menu item.">getItemCommandId</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> idx) <span class="keyword">const</span> = 0; <a name="l00131"></a>00131 <a name="l00133"></a>00133 <a name="l00136"></a>00136 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#a1380ff56d8c4c5b8de8d221062464654" title="Sets the command id of a menu item.">setItemCommandId</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> idx, <a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> <span class="keywordtype">id</span>) = 0; <a name="l00137"></a>00137 <a name="l00139"></a>00139 <a name="l00142"></a>00142 <span class="keyword">virtual</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html" title="GUI Context menu interface.">IGUIContextMenu</a>* <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#a296cfd0c4944b2c0bfb88973401fb824" title="Get a pointer to the submenu of an item.">getSubMenu</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> idx) <span class="keyword">const</span> = 0; <a name="l00143"></a>00143 <a name="l00145"></a>00145 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#ab393d00ca81ee9482c5a81d19cc6e79e" title="should the element change the checked status on clicking">setItemAutoChecking</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> idx, <span class="keywordtype">bool</span> autoChecking) = 0; <a name="l00146"></a>00146 <a name="l00148"></a>00148 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#ae1c7364f115e633bcfc040864e30f4c1" title="does the element change the checked status on clicking">getItemAutoChecking</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> idx) <span class="keyword">const</span> = 0; <a name="l00149"></a>00149 <a name="l00151"></a>00151 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_context_menu.html#a2d87831a224817fc9c9dd8f41c69ac0a" title="When an eventparent is set it receives events instead of the usual parent element...">setEventParent</a>(<a class="code" href="classirr_1_1gui_1_1_i_g_u_i_element.html" title="Base class of all GUI elements.">IGUIElement</a> *parent) = 0; <a name="l00152"></a>00152 }; <a name="l00153"></a>00153 <a name="l00154"></a>00154 } <span class="comment">// end namespace gui</span> <a name="l00155"></a>00155 } <span class="comment">// end namespace irr</span> <a name="l00156"></a>00156 <a name="l00157"></a>00157 <span class="preprocessor">#endif</span> <a name="l00158"></a>00158 <span class="preprocessor"></span> </pre></div></div> <hr size="1"> <address style="align: right;"> <small> </small> </address> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td width="0"> <div align="left"><small><a href="http://irrlicht.sourceforge.net" target="_blank"><img src="irrlicht.png" alt="The Irrlicht Engine" align="middle" border=0 width=88 height=31></a></small></div></td> <td> <div align="left"><small><em><font size="2">The <a href="http://irrlicht.sourceforge.net" target="_blank">Irrlicht Engine</a> Documentation © 2003-2010 by Nikolaus Gebhardt. Generated on Sun Oct 24 12:41:56 2010 by <a href="http://www.doxygen.org" target="_blank">Doxygen</a> (1.6.2)</font></em></small></div></td> </tr> </table> <address style="align: right;"> </address> </body> </html>