📄 classwgui_1_1cmenubase.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::CMenuBase 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::CMenuBase Class Reference</h1>The menu base class. <a href="#_details">More...</a><p><code>#include <<a class="el" href="wg__menu_8h-source.html">wg_menu.h</a>></code><p><p>Inheritance diagram for wGui::CMenuBase:<p><center><img src="classwGui_1_1CMenuBase.png" usemap="#wGui::CMenuBase_map" border="0" alt=""></center><map name="wGui::CMenuBase_map"><area href="classwGui_1_1CWindow.html" alt="wGui::CWindow" shape="rect" coords="74,56,212,80"><area href="classwGui_1_1CMessageClient.html" alt="wGui::CMessageClient" shape="rect" coords="74,0,212,24"><area href="classwGui_1_1CMenu.html" alt="wGui::CMenu" shape="rect" coords="0,168,138,192"><area href="classwGui_1_1CPopupMenu.html" alt="wGui::CPopupMenu" shape="rect" coords="148,168,286,192"></map><h2>Public Methods</h2><ul><li><a class="el" href="classwGui_1_1CMenuBase.html#a0">CMenuBase</a> (const <a class="el" href="classwGui_1_1CRect.html">CRect</a> &WindowRect, <a class="el" href="classwGui_1_1CWindow.html">CWindow</a> *pParent, <a class="el" href="classwGui_1_1CFontEngine.html">CFontEngine</a> *pFontEngine=0)<li><a name="a1" doxytag="wGui::CMenuBase::~CMenuBase"></a>virtual <a class="el" href="classwGui_1_1CMenuBase.html#a1">~CMenuBase</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_1CMenuBase.html#a2">InsertMenuItem</a> (const <a class="el" href="structwGui_1_1SMenuItem.html">SMenuItem</a> &MenuItem, int iPosition=-1)<li>void <a class="el" href="classwGui_1_1CMenuBase.html#a3">RemoveMenuItem</a> (int iPosition)<li><a name="a4" doxytag="wGui::CMenuBase::GetMenuItemCount"></a>int <a class="el" href="classwGui_1_1CMenuBase.html#a4">GetMenuItemCount</a> (void)<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>The number of items in the menu</dl><br><br></em></font></dl><li><a name="a5" doxytag="wGui::CMenuBase::HideActivePopup"></a>void <a class="el" href="classwGui_1_1CMenuBase.html#a5">HideActivePopup</a> (void)<dl class="el"><dd><font size=-1><em>Hides the active popup window.<br><br></em></font></dl><li>void <a class="el" href="classwGui_1_1CMenuBase.html#a6">SetHighlightColor</a> (<a class="el" href="classwGui_1_1CRGBColor.html">CRGBColor</a> HighlightColor)<li>virtual void <a class="el" href="classwGui_1_1CMenuBase.html#a7">Draw</a> (void) const=0<li>virtual bool <a class="el" href="classwGui_1_1CMenuBase.html#a8">OnMouseButtonDown</a> (<a class="el" href="classwGui_1_1CPoint.html">CPoint</a> Point, unsigned int Button)<li>virtual bool <a class="el" href="classwGui_1_1CMenuBase.html#a9">HandleMessage</a> (<a class="el" href="classwGui_1_1CMessage.html">CMessage</a> *pMessage)</ul><h2>Protected Types</h2><ul><li><a name="t0" doxytag="wGui::CMenuBase::t_MenuItemVector"></a>typedef std::vector< std::pair<<br> <a class="el" href="structwGui_1_1SMenuItem.html">SMenuItem</a>, std::pair< <a class="el" href="classwGui_1_1CRenderedString.html">CRenderedString</a>,<br> <a class="el" href="classwGui_1_1CRect.html">CRect</a> > > > <a class="el" href="classwGui_1_1CMenuBase.html#t0">t_MenuItemVector</a><dl class="el"><dd><font size=-1><em>The type for menu items.<br><br></em></font></dl></ul><h2>Protected Methods</h2><ul><li><a name="b0" doxytag="wGui::CMenuBase::UpdateCachedRects"></a>virtual void <a class="el" href="classwGui_1_1CMenuBase.html#b0">UpdateCachedRects</a> (void) const=0<dl class="el"><dd><font size=-1><em>This updates the cached item rects if they are marked as invalid.<br><br></em></font></dl><li>virtual void <a class="el" href="classwGui_1_1CMenuBase.html#b1">ShowActivePopup</a> (const <a class="el" href="classwGui_1_1CRect.html">CRect</a> &ParentRect, const <a class="el" href="classwGui_1_1CRect.html">CRect</a> &BoundingRect)=0</ul><h2>Protected Attributes</h2><ul><li><a name="n0" doxytag="wGui::CMenuBase::m_pFontEngine"></a><a class="el" href="classwGui_1_1CFontEngine.html">CFontEngine</a> * <a class="el" href="classwGui_1_1CMenuBase.html#n0">m_pFontEngine</a><dl class="el"><dd><font size=-1><em>A pointer to the font engine to use to render the text.<br><br></em></font></dl><li><a name="n1" doxytag="wGui::CMenuBase::m_MenuItems"></a><a class="el" href="classwGui_1_1CMenuBase.html#t0">t_MenuItemVector</a> <a class="el" href="classwGui_1_1CMenuBase.html#n1">m_MenuItems</a><dl class="el"><dd><font size=-1><em>The vector of menu items.<br><br></em></font></dl><li><a name="n2" doxytag="wGui::CMenuBase::m_pHighlightedItem"></a><a class="el" href="structwGui_1_1SMenuItem.html">SMenuItem</a> * <a class="el" href="classwGui_1_1CMenuBase.html#n2">m_pHighlightedItem</a><dl class="el"><dd><font size=-1><em>The item that should be highlighted.<br><br></em></font></dl><li><a name="n3" doxytag="wGui::CMenuBase::m_bCachedRectsValid"></a>bool <a class="el" href="classwGui_1_1CMenuBase.html#n3">m_bCachedRectsValid</a><dl class="el"><dd><font size=-1><em>True if the cached item rects are valid.<br><br></em></font></dl><li><a name="n4" doxytag="wGui::CMenuBase::m_pActivePopup"></a><a class="el" href="classwGui_1_1CPopupMenu.html">CPopupMenu</a> * <a class="el" href="classwGui_1_1CMenuBase.html#n4">m_pActivePopup</a><dl class="el"><dd><font size=-1><em>A pointer to the active popup.<br><br></em></font></dl><li><a name="n5" doxytag="wGui::CMenuBase::m_hRightArrowBitmap"></a><a class="el" href="classwGui_1_1CwgBitmapResourceHandle.html">CwgBitmapResourceHandle</a> <a class="el" href="classwGui_1_1CMenuBase.html#n5">m_hRightArrowBitmap</a><dl class="el"><dd><font size=-1><em>A handle to the bitmap for the right arrow.<br><br></em></font></dl><li><a name="n6" doxytag="wGui::CMenuBase::m_HighlightColor"></a><a class="el" href="classwGui_1_1CRGBColor.html">CRGBColor</a> <a class="el" href="classwGui_1_1CMenuBase.html#n6">m_HighlightColor</a><dl class="el"><dd><font size=-1><em>Sets the highlight color to use, defaults to Dark Gray.<br><br></em></font></dl><li><a name="n7" doxytag="wGui::CMenuBase::m_pPopupTimer"></a><a class="el" href="classwGui_1_1CTimer.html">CTimer</a> * <a class="el" href="classwGui_1_1CMenuBase.html#n7">m_pPopupTimer</a><dl class="el"><dd><font size=-1><em>A timer to be used for opening sub menus when the mouse hovers over an item.<br><br></em></font></dl></ul><hr><a name="_details"></a><h2>Detailed Description</h2>The menu base class.<p>The <a class="el" href="classwGui_1_1CMenuBase.html">CMenuBase</a> is the base class for CMenus and CPopupMenus, and shouldn't be instantiated itself Menus will generate CTRL_LCLICK messages when a menu item is selected <p><p>Definition at line <a class="el" href="wg__menu_8h-source.html#l00070">70</a> of file <a class="el" href="wg__menu_8h-source.html">wg_menu.h</a>.<hr><h2>Constructor & Destructor Documentation</h2><a name="a0" doxytag="wGui::CMenuBase::CMenuBase"></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::CMenuBase::CMenuBase </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><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>Constructs a new MenuBase <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 </td></tr><tr><td valign=top><em>pParent</em> </td><td>A pointer to the parent window </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__menu_8cpp-source.html#l00039">39</a> of file <a class="el" href="wg__menu_8cpp-source.html">wg_menu.cpp</a>.<p>References <a class="el" href="wg__menu_8h-source.html#l00131">m_pFontEngine</a>, <a class="el" href="wg__menu_8h-source.html#l00139">m_pPopupTimer</a>, and <a class="el" href="wg__window_8h-source.html#l00212">wGui::CWindow::m_sClassName</a>. </td> </tr></table><hr><h2>Member Function Documentation</h2><a name="a7" doxytag="wGui::CMenuBase::Draw"></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"> virtual void wGui::CMenuBase::Draw </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const<code> [pure virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><a class="el" href="classwGui_1_1CWindow.html">CWindow</a> overrides Draws the menu <p>Reimplemented from <a class="el" href="classwGui_1_1CWindow.html#a20">wGui::CWindow</a>.<p>Implemented in <a class="el" href="classwGui_1_1CMenu.html#a3">wGui::CMenu</a>, and <a class="el" href="classwGui_1_1CPopupMenu.html#a8">wGui::CPopupMenu</a>. </td> </tr></table><a name="a9" doxytag="wGui::CMenuBase::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::CMenuBase::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> <td> </td> <td><p>CMenus handle MOUSE_BUTTONDOWN and MOUSE_BUTTONUP messages <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>pMessage</em> </td><td>A pointer to the message </td></tr></table></dl><p>Reimplemented from <a class="el" href="classwGui_1_1CWindow.html#a27">wGui::CWindow</a>.<p>Reimplemented in <a class="el" href="classwGui_1_1CMenu.html#a5">wGui::CMenu</a>, and <a class="el" href="classwGui_1_1CPopupMenu.html#a10">wGui::CPopupMenu</a>.<p>Definition at line <a class="el" href="wg__menu_8cpp-source.html#l00117">117</a> of file <a class="el" href="wg__menu_8cpp-source.html">wg_menu.cpp</a>.<p>References <a class="el" href="wg__message_8h-source.html#l00081">wGui::CMessage::Destination()</a>, <a class="el" href="wg__rect_8cpp-source.html#l00167">wGui::CRect::HitTest()</a>, <a class="el" href="wg__window_8h-source.html#l00209">wGui::CWindow::m_bVisible</a>, <a class="el" href="wg__menu_8h-source.html#l00133">m_MenuItems</a>, <a class="el" href="wg__menu_8h-source.html#l00134">m_pHighlightedItem</a>, <a class="el" href="wg__window_8h-source.html#l00200">wGui::CWindow::m_pParentWindow</a>, <a class="el" href="wg__menu_8h-source.html#l00139">m_pPopupTimer</a>, <a class="el" href="wg__window_8h-source.html#l00191">wGui::CWindow::m_WindowRect</a>, <a class="el" href="wg__message_8h-source.html#l00078">wGui::CMessage::MessageType()</a>, <a class="el" href="wg__message_8h-source.html#l00156">wGui::CMouseMessage::Point</a>, <a class="el" href="wg__menu_8h-source.html#l00058">wGui::SMenuItem::sItemText</a>, <a class="el" href="wg__window_8cpp-source.html#l00213">wGui::CWindow::StartDrawProc()</a>, <a class="el" href="wg__timer_8cpp-source.html#l00055">wGui::CTimer::StartTimer()</a>, <a class="el" href="wg__timer_8cpp-source.html#l00065">wGui::CTimer::StopTimer()</a>, and <a class="el" href="classwGui_1_1CMenuBase.html#b0">UpdateCachedRects()</a>. </td> </tr></table><a name="a2" doxytag="wGui::CMenuBase::InsertMenuItem"></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"> void wGui::CMenuBase::InsertMenuItem </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="structwGui_1_1SMenuItem.html">SMenuItem</a> & </td> <td class="mdname" nowrap> <em>MenuItem</em>, </td> </tr> <tr> <td></td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -