📄 classwgui_1_1cdropdown.html
字号:
<!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>wGui::CDropDown class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Data Structures</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Data Fields</a> </center><hr><h1>wGui::CDropDown Class Reference</h1>A dropdown control, which combines an edit control and a listbox control The <a class="el" href="classwGui_1_1CDropDown.html">CDropDown</a> will generate CTRL_VALUECHANGE messages every time the text changes. <a href="#_details">More...</a><p><code>#include <<a class="el" href="wg__dropdown_8h-source.html">wg_dropdown.h</a>></code><p><p>Inheritance diagram for wGui::CDropDown:<p><center><img src="classwGui_1_1CDropDown.png" usemap="#wGui::CDropDown_map" border="0" alt=""></center><map name="wGui::CDropDown_map"><area href="classwGui_1_1CWindow.html" alt="wGui::CWindow" shape="rect" coords="0,56,138,80"><area href="classwGui_1_1CMessageClient.html" alt="wGui::CMessageClient" shape="rect" coords="0,0,138,24"></map><h2>Public Methods</h2><ul><li><a class="el" href="classwGui_1_1CDropDown.html#a0">CDropDown</a> (const <a class="el" href="classwGui_1_1CRect.html">CRect</a> &WindowRect, <a class="el" href="classwGui_1_1CWindow.html">CWindow</a> *pParent, bool bAllowEdit=true, unsigned int iItemHeight=15, <a class="el" href="classwGui_1_1CFontEngine.html">CFontEngine</a> *pFontEngine=0)<li><a name="a1" doxytag="wGui::CDropDown::~CDropDown"></a>virtual <a class="el" href="classwGui_1_1CDropDown.html#a1">~CDropDown</a> (void)<dl class="el"><dd><font size=-1><em>Standard destructor.<br><br></em></font></dl><li>virtual void <a class="el" href="classwGui_1_1CDropDown.html#a2">SetWindowText</a> (std::string sWindowText)<li>int <a class="el" href="classwGui_1_1CDropDown.html#a3">AddItem</a> (<a class="el" href="structwGui_1_1SListItem.html">SListItem</a> ListItem)<li><a class="el" href="structwGui_1_1SListItem.html">SListItem</a> & <a class="el" href="classwGui_1_1CDropDown.html#a4">GetItem</a> (int iItemIndex)<li>void <a class="el" href="classwGui_1_1CDropDown.html#a5">RemoveItem</a> (int iItemIndex)<li><a name="a6" doxytag="wGui::CDropDown::ClearItems"></a>void <a class="el" href="classwGui_1_1CDropDown.html#a6">ClearItems</a> (void)<dl class="el"><dd><font size=-1><em>Remove all items from the list.<br><br></em></font></dl><li><a name="a7" doxytag="wGui::CDropDown::Size"></a>int <a class="el" href="classwGui_1_1CDropDown.html#a7">Size</a> (void)<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>The number of items in the list</dl><br><br></em></font></dl><li>bool <a class="el" href="classwGui_1_1CDropDown.html#a8">IsSelected</a> (int iItemIndex)<li>void <a class="el" href="classwGui_1_1CDropDown.html#a9">SetSelection</a> (int iItemIndex, bool bSelected)<li>void <a class="el" href="classwGui_1_1CDropDown.html#a10">SetAllSelections</a> (bool bSelected)<li>virtual bool <a class="el" href="classwGui_1_1CDropDown.html#a11">HandleMessage</a> (<a class="el" href="classwGui_1_1CMessage.html">CMessage</a> *pMessage)</ul><h2>Protected Methods</h2><ul><li><a name="b0" doxytag="wGui::CDropDown::ShowListBox"></a>void <a class="el" href="classwGui_1_1CDropDown.html#b0">ShowListBox</a> (void)<dl class="el"><dd><font size=-1><em>Shows the drop down listbox.<br><br></em></font></dl><li><a name="b1" doxytag="wGui::CDropDown::HideListBox"></a>void <a class="el" href="classwGui_1_1CDropDown.html#b1">HideListBox</a> (void)<dl class="el"><dd><font size=-1><em>Hides the drop down listbox.<br><br></em></font></dl></ul><h2>Protected Attributes</h2><ul><li><a name="n0" doxytag="wGui::CDropDown::m_pEditBox"></a><a class="el" href="classwGui_1_1CEditBox.html">CEditBox</a> * <a class="el" href="classwGui_1_1CDropDown.html#n0">m_pEditBox</a><dl class="el"><dd><font size=-1><em>A pointer to the drop down's edit box.<br><br></em></font></dl><li><a name="n1" doxytag="wGui::CDropDown::m_pListBox"></a><a class="el" href="classwGui_1_1CListBox.html">CListBox</a> * <a class="el" href="classwGui_1_1CDropDown.html#n1">m_pListBox</a><dl class="el"><dd><font size=-1><em>A pointer to teh drop down's list box.<br><br></em></font></dl><li><a name="n2" doxytag="wGui::CDropDown::m_pDropButton"></a><a class="el" href="classwGui_1_1CPictureButton.html">CPictureButton</a> * <a class="el" href="classwGui_1_1CDropDown.html#n2">m_pDropButton</a><dl class="el"><dd><font size=-1><em>A pointer to the drop down's drop button.<br><br></em></font></dl><li><a name="n3" doxytag="wGui::CDropDown::m_bAllowEdit"></a>bool <a class="el" href="classwGui_1_1CDropDown.html#n3">m_bAllowEdit</a><dl class="el"><dd><font size=-1><em>If false, the edit box will be read only, and the value can only be changed via the drop-down list.<br><br></em></font></dl></ul><hr><a name="_details"></a><h2>Detailed Description</h2>A dropdown control, which combines an edit control and a listbox control The <a class="el" href="classwGui_1_1CDropDown.html">CDropDown</a> will generate CTRL_VALUECHANGE messages every time the text changes.<p><p>Definition at line <a class="el" href="wg__dropdown_8h-source.html#l00042">42</a> of file <a class="el" href="wg__dropdown_8h-source.html">wg_dropdown.h</a>.<hr><h2>Constructor & Destructor Documentation</h2><a name="a0" doxytag="wGui::CDropDown::CDropDown"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> wGui::CDropDown::CDropDown </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classwGui_1_1CRect.html">CRect</a> & </td> <td class="mdname" nowrap> <em>WindowRect</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="classwGui_1_1CWindow.html">CWindow</a> * </td> <td class="mdname" nowrap> <em>pParent</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>bool </td> <td class="mdname" nowrap> <em>bAllowEdit</em> = true, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>unsigned int </td> <td class="mdname" nowrap> <em>iItemHeight</em> = 15, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="classwGui_1_1CFontEngine.html">CFontEngine</a> * </td> <td class="mdname" nowrap> <em>pFontEngine</em> = 0</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Construct a new DropDown control <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>WindowRect</em> </td><td>A <a class="el" href="classwGui_1_1CRect.html">CRect</a> that defines the outer limits of the control (this only controls the dimensions of the edit control portion of the drop down) </td></tr><tr><td valign=top><em>pParent</em> </td><td>A pointer to the parent window </td></tr><tr><td valign=top><em>bAllowEdit</em> </td><td>If false, the edit box will be read only, and the value can only be changed via the drop-down list (true by default) </td></tr><tr><td valign=top><em>iItemHeight</em> </td><td>The height of the items in the listbox portion of the control, defaults to 15 </td></tr><tr><td valign=top><em>pFontEngine</em> </td><td>A pointer to the font engine to use when drawing the control If this is left out (or set to 0) it will use the default font engine specified by the <a class="el" href="classwGui_1_1CApplication.html">CApplication</a> (which must be set before instantiating this object) </td></tr></table></dl><p>Definition at line <a class="el" href="wg__dropdown_8cpp-source.html#l00034">34</a> of file <a class="el" href="wg__dropdown_8cpp-source.html">wg_dropdown.cpp</a>.<p>References <a class="el" href="wg__rect_8h-source.html#l00091">wGui::CRect::Bottom()</a>, <a class="el" href="wg__rect_8h-source.html#l00100">wGui::CRect::BottomLeft()</a>, <a class="el" href="wg__rect_8h-source.html#l00103">wGui::CRect::BottomRight()</a>, <a class="el" href="wg__window_8cpp-source.html#l00104">wGui::CWindow::GetAncestor()</a>, <a class="el" href="wg__rect_8h-source.html#l00130">wGui::CRect::Height()</a>, <a class="el" href="wg__dropdown_8h-source.html#l00112">m_bAllowEdit</a>, <a class="el" href="wg__dropdown_8h-source.html#l00111">m_pDropButton</a>, <a class="el" href="wg__dropdown_8h-source.html#l00109">m_pEditBox</a>, <a class="el" href="wg__dropdown_8h-source.html#l00110">m_pListBox</a>, <a class="el" href="wg__window_8h-source.html#l00212">wGui::CWindow::m_sClassName</a>, <a class="el" href="wg__rect_8h-source.html#l00088">wGui::CRect::Right()</a>, <a class="el" href="classwGui_1_1CWindow.html#s2s1">wGui::CWindow::ROOT</a>, <a class="el" href="wg__window_8h-source.html#l00077">wGui::CWindow::SetBGColor()</a>, <a class="el" href="wg__listbox_8h-source.html#l00114">wGui::CListBox::SetDropDown()</a>, <a class="el" href="wg__editbox_8cpp-source.html#l00067">wGui::CEditBox::SetReadOnly()</a>, <a class="el" href="wg__window_8cpp-source.html#l00151">wGui::CWindow::SetVisible()</a>, <a class="el" href="wg__rect_8h-source.html#l00082">wGui::CRect::Top()</a>, and <a class="el" href="wg__rect_8h-source.html#l00094">wGui::CRect::TopLeft()</a>. </td> </tr></table><hr><h2>Member Function Documentation</h2><a name="a3" doxytag="wGui::CDropDown::AddItem"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int wGui::CDropDown::AddItem </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="structwGui_1_1SListItem.html">SListItem</a> </td> <td class="mdname1" valign="top" nowrap> <em>ListItem</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [inline]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Adds a new item to the list <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>ListItem</em> </td><td>A <a class="el" href="structwGui_1_1SListItem.html">SListItem</a> structure with the data for the item </td></tr></table></dl><dl compact><dt><b>Returns: </b></dt><dd>The index of the added item </dl><p>Definition at line <a class="el" href="wg__dropdown_8h-source.html#l00065">65</a> of file <a class="el" href="wg__dropdown_8h-source.html">wg_dropdown.h</a>.<p>References <a class="el" href="wg__listbox_8cpp-source.html#l00077">wGui::CListBox::AddItem()</a>, and <a class="el" href="wg__dropdown_8h-source.html#l00110">m_pListBox</a>. </td> </tr></table><a name="a4" doxytag="wGui::CDropDown::GetItem"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="structwGui_1_1SListItem.html">SListItem</a>& wGui::CDropDown::GetItem </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">int </td> <td class="mdname1" valign="top" nowrap> <em>iItemIndex</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [inline]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Returns the desired item <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>iItemIndex</em> </td><td>The index of the item to check </td></tr></table></dl><dl compact><dt><b>Returns: </b></dt><dd>A reference to the <a class="el" href="structwGui_1_1SListItem.html">SListItem</a> struct </dl><p>Definition at line <a class="el" href="wg__dropdown_8h-source.html#l00070">70</a> of file <a class="el" href="wg__dropdown_8h-source.html">wg_dropdown.h</a>.<p>References <a class="el" href="wg__listbox_8h-source.html#l00087">wGui::CListBox::GetItem()</a>, and <a class="el" href="wg__dropdown_8h-source.html#l00110">m_pListBox</a>. </td> </tr></table><a name="a11" doxytag="wGui::CDropDown::HandleMessage"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> bool wGui::CDropDown::HandleMessage </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="classwGui_1_1CMessage.html">CMessage</a> * </td> <td class="mdname1" valign="top" nowrap> <em>pMessage</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -