<!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: IGUIListBox.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>IGUIListBox.h</h1><a href="_i_g_u_i_list_box_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_LIST_BOX_H_INCLUDED__</span> <a name="l00006"></a>00006 <span class="preprocessor"></span><span class="preprocessor">#define __I_GUI_LIST_BOX_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 <span class="preprocessor">#include "<a class="code" href="_s_color_8h.html">SColor.h</a>"</span> <a name="l00010"></a>00010 <a name="l00011"></a>00011 <span class="keyword">namespace </span>irr <a name="l00012"></a>00012 { <a name="l00013"></a>00013 <span class="keyword">namespace </span>gui <a name="l00014"></a>00014 { <a name="l00015"></a>00015 <span class="keyword">class </span>IGUISpriteBank; <a name="l00016"></a>00016 <a name="l00018"></a><a class="code" href="namespaceirr_1_1gui.html#a7da705f0a0b4aa5385e6842adf409cb6">00018</a> <span class="keyword">enum</span> <a class="code" href="namespaceirr_1_1gui.html#a7da705f0a0b4aa5385e6842adf409cb6" title="Enumeration for listbox colors.">EGUI_LISTBOX_COLOR</a> <a name="l00019"></a>00019 { <a name="l00021"></a><a class="code" href="namespaceirr_1_1gui.html#a7da705f0a0b4aa5385e6842adf409cb6a00c51a89e38d9aa4dd3a7f0ab9789ec1">00021</a> <a class="code" href="namespaceirr_1_1gui.html#a7da705f0a0b4aa5385e6842adf409cb6a00c51a89e38d9aa4dd3a7f0ab9789ec1" title="Color of text.">EGUI_LBC_TEXT</a>=0, <a name="l00023"></a><a class="code" href="namespaceirr_1_1gui.html#a7da705f0a0b4aa5385e6842adf409cb6ac8f655274d39f5db72e2243a48aad74a">00023</a> <a class="code" href="namespaceirr_1_1gui.html#a7da705f0a0b4aa5385e6842adf409cb6ac8f655274d39f5db72e2243a48aad74a" title="Color of selected text.">EGUI_LBC_TEXT_HIGHLIGHT</a>, <a name="l00025"></a><a class="code" href="namespaceirr_1_1gui.html#a7da705f0a0b4aa5385e6842adf409cb6ad8ffd444884e984f5a3c47225643c3d9">00025</a> <a class="code" href="namespaceirr_1_1gui.html#a7da705f0a0b4aa5385e6842adf409cb6ad8ffd444884e984f5a3c47225643c3d9" title="Color of icon.">EGUI_LBC_ICON</a>, <a name="l00027"></a><a class="code" href="namespaceirr_1_1gui.html#a7da705f0a0b4aa5385e6842adf409cb6ad98993b3b873d7a568b971ab715c47fa">00027</a> <a class="code" href="namespaceirr_1_1gui.html#a7da705f0a0b4aa5385e6842adf409cb6ad98993b3b873d7a568b971ab715c47fa" title="Color of selected icon.">EGUI_LBC_ICON_HIGHLIGHT</a>, <a name="l00029"></a><a class="code" href="namespaceirr_1_1gui.html#a7da705f0a0b4aa5385e6842adf409cb6aa6f9aa0147c6a9ec081260ce3f095d55">00029</a> <a class="code" href="namespaceirr_1_1gui.html#a7da705f0a0b4aa5385e6842adf409cb6aa6f9aa0147c6a9ec081260ce3f095d55" title="Not used, just counts the number of available colors.">EGUI_LBC_COUNT</a> <a name="l00030"></a>00030 }; <a name="l00031"></a>00031 <a name="l00032"></a>00032 <a name="l00034"></a><a class="code" href="classirr_1_1gui_1_1_i_g_u_i_list_box.html">00034</a> <span class="keyword">class </span><a class="code" href="classirr_1_1gui_1_1_i_g_u_i_list_box.html" title="Default list box GUI element.">IGUIListBox</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="l00035"></a>00035 { <a name="l00036"></a>00036 <span class="keyword">public</span>: <a name="l00038"></a><a class="code" href="classirr_1_1gui_1_1_i_g_u_i_list_box.html#a6f6e6a84f3d2035a0874eb9f4a4d52ef">00038</a> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_list_box.html#a6f6e6a84f3d2035a0874eb9f4a4d52ef" title="constructor">IGUIListBox</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="l00039"></a>00039 : <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#ae4d66df0ecf4117cdbcf9f22404bd254a24135632b105a83bebac7871c704f2d3" title="A list box (IGUIListBox).">EGUIET_LIST_BOX</a>, environment, parent, id, rectangle) {} <a name="l00040"></a>00040 <a name="l00042"></a>00042 <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_list_box.html#a9ae7e4858dd1dee26efab7e7c9c94ab7" title="returns amount of list items">getItemCount</a>() <span class="keyword">const</span> = 0; <a name="l00043"></a>00043 <a name="l00045"></a>00045 <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_list_box.html#af68ea08c93b0959ea464146bc1f4d82f" title="returns string of a list item. the may id be a value from 0 to itemCount-1">getListItem</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <span class="keywordtype">id</span>) <span class="keyword">const</span> = 0; <a name="l00046"></a>00046 <a name="l00048"></a>00048 <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_list_box.html#a298dbba8da28248b563a906c520dc3be" title="adds an list item, returns id of item">addItem</a>(<span class="keyword">const</span> <span class="keywordtype">wchar_t</span>* text) = 0; <a name="l00049"></a>00049 <a name="l00051"></a>00051 <a name="l00054"></a>00054 <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_list_box.html#a298dbba8da28248b563a906c520dc3be" title="adds an list item, returns id of 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> icon) = 0; <a name="l00055"></a>00055 <a name="l00057"></a>00057 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_list_box.html#a6c19c6db0bcf52756d9bb866063a770b" title="Removes an item from the list.">removeItem</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index) = 0; <a name="l00058"></a>00058 <a name="l00060"></a>00060 <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_list_box.html#a8e5f9751a7a1a32dde5a243733b3ddc6" title="Returns the icon of an item.">getIcon</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index) <span class="keyword">const</span> = 0; <a name="l00061"></a>00061 <a name="l00063"></a>00063 <a name="l00067"></a>00067 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_list_box.html#ad139cef6f71bb8d36624b48e8a695ed4" title="Sets the sprite bank which should be used to draw list icons.">setSpriteBank</a>(<a class="code" href="classirr_1_1gui_1_1_i_g_u_i_sprite_bank.html" title="Sprite bank interface.">IGUISpriteBank</a>* bank) = 0; <a name="l00068"></a>00068 <a name="l00070"></a>00070 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_list_box.html#aaffa1f9f823dbb254c1901dba67e31c4" title="clears the list, deletes all items in the listbox">clear</a>() = 0; <a name="l00071"></a>00071 <a name="l00073"></a>00073 <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_list_box.html#a321626d92d63ce5c309466201a02b12d" title="returns id of selected item. returns -1 if no item is selected.">getSelected</a>() <span class="keyword">const</span> = 0; <a name="l00074"></a>00074 <a name="l00076"></a>00076 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_list_box.html#ac981fa5b285115333b67202819230f6f" title="sets the selected item. Set this to -1 if no item should be selected">setSelected</a>(<a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> index) = 0; <a name="l00077"></a>00077 <a name="l00079"></a>00079 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_list_box.html#ac981fa5b285115333b67202819230f6f" title="sets the selected item. Set this to -1 if no item should be selected">setSelected</a>(<span class="keyword">const</span> <span class="keywordtype">wchar_t</span> *item) = 0; <a name="l00080"></a>00080 <a name="l00082"></a>00082 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_list_box.html#a4d8ada56cafff847e98564283b2d06ac" title="set whether the listbox should scroll to newly selected items">setAutoScrollEnabled</a>(<span class="keywordtype">bool</span> scroll) = 0; <a name="l00083"></a>00083 <a name="l00085"></a>00085 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_list_box.html#af04876e1e3173e9c13bb099076743137" title="returns true if automatic scrolling is enabled, false if not.">isAutoScrollEnabled</a>() <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_list_box.html#a894639bed0562e4de647a3b45f08b791" title="set all item colors at given index to color">setItemOverrideColor</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index, <span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">video::SColor</a> &color) = 0; <a name="l00089"></a>00089 <a name="l00091"></a>00091 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_list_box.html#a894639bed0562e4de647a3b45f08b791" title="set all item colors at given index to color">setItemOverrideColor</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index, <a class="code" href="namespaceirr_1_1gui.html#a7da705f0a0b4aa5385e6842adf409cb6" title="Enumeration for listbox colors.">EGUI_LISTBOX_COLOR</a> colorType, <span class="keyword">const</span> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">video::SColor</a> &color) = 0; <a name="l00092"></a>00092 <a name="l00094"></a>00094 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_list_box.html#aca681d4d4814cde0678109e3bce2471e" title="clear all item colors at index">clearItemOverrideColor</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index) = 0; <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_list_box.html#aca681d4d4814cde0678109e3bce2471e" title="clear all item colors at index">clearItemOverrideColor</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index, <a class="code" href="namespaceirr_1_1gui.html#a7da705f0a0b4aa5385e6842adf409cb6" title="Enumeration for listbox colors.">EGUI_LISTBOX_COLOR</a> colorType) = 0; <a name="l00098"></a>00098 <a name="l00100"></a>00100 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_list_box.html#a8399578154c3cbfcdd23f3b7009c448d" title="has the item at index its color overwritten?">hasItemOverrideColor</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index, <a class="code" href="namespaceirr_1_1gui.html#a7da705f0a0b4aa5385e6842adf409cb6" title="Enumeration for listbox colors.">EGUI_LISTBOX_COLOR</a> colorType) <span class="keyword">const</span> = 0; <a name="l00101"></a>00101 <a name="l00103"></a>00103 <span class="keyword">virtual</span> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">video::SColor</a> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_list_box.html#a504c669eae86307521b643288c4ef196" title="return the overwrite color at given item index.">getItemOverrideColor</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index, <a class="code" href="namespaceirr_1_1gui.html#a7da705f0a0b4aa5385e6842adf409cb6" title="Enumeration for listbox colors.">EGUI_LISTBOX_COLOR</a> colorType) <span class="keyword">const</span> = 0; <a name="l00104"></a>00104 <a name="l00106"></a>00106 <span class="keyword">virtual</span> <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">video::SColor</a> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_list_box.html#ae755a88721a458b3255df08519b72e85" title="return the default color which is used for the given colorType">getItemDefaultColor</a>(<a class="code" href="namespaceirr_1_1gui.html#a7da705f0a0b4aa5385e6842adf409cb6" title="Enumeration for listbox colors.">EGUI_LISTBOX_COLOR</a> colorType) <span class="keyword">const</span> = 0; <a name="l00107"></a>00107 <a name="l00109"></a>00109 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_list_box.html#a643ca28110a7de59a378e5ba79b1c37a" title="set the item at the given index">setItem</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index, <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> icon) = 0; <a name="l00110"></a>00110 <a name="l00112"></a>00112 <a name="l00113"></a>00113 <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_list_box.html#a1da5cc33687efee5ff1e33ab9f0d5b26" title="Insert the item at the given index.">insertItem</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index, <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> icon) = 0; <a name="l00114"></a>00114 <a name="l00116"></a>00116 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_list_box.html#accb47d6f72558ea5d3034b3e4e4ccd81" title="Swap the items at the given indices.">swapItems</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index1, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index2) = 0; <a name="l00117"></a>00117 <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_list_box.html#a83fb9c6f32039a39197cf799dd5e0c8f" title="set global itemHeight">setItemHeight</a>( <a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> height ) = 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_list_box.html#ad323fdf0b083dbc1870d7fa5869cff8f" title="Sets whether to draw the background.">setDrawBackground</a>(<span class="keywordtype">bool</span> <a class="code" href="classirr_1_1gui_1_1_i_g_u_i_element.html#a1ef7eeaff67b8a9f4f37cacdc7e54be2" title="Draws the element and its children.">draw</a>) = 0; <a name="l00123"></a>00123 }; <a name="l00124"></a>00124 <a name="l00125"></a>00125 <a name="l00126"></a>00126 } <span class="comment">// end namespace gui</span> <a name="l00127"></a>00127 } <span class="comment">// end namespace irr</span> <a name="l00128"></a>00128 <a name="l00129"></a>00129 <span class="preprocessor">#endif</span> <a name="l00130"></a>00130 <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>