📄 classwgui_1_1cpopupmenu.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::CPopupMenu 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::CPopupMenu Class Reference</h1>Popup menus are used for both context menus, and as the popups when a <a class="el" href="classwGui_1_1CMenu.html">CMenu</a> item is clicked that has a submenu. <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::CPopupMenu:<p><center><img src="classwGui_1_1CPopupMenu.png" usemap="#wGui::CPopupMenu_map" border="0" alt=""></center><map name="wGui::CPopupMenu_map"><area href="classwGui_1_1CMenuBase.html" alt="wGui::CMenuBase" shape="rect" coords="0,112,138,136"><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_1CPopupMenu.html#a0">CPopupMenu</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::CPopupMenu::~CPopupMenu"></a>virtual <a class="el" href="classwGui_1_1CPopupMenu.html#a1">~CPopupMenu</a> (void)<dl class="el"><dd><font size=-1><em>Standard destructor.<br><br></em></font></dl><li>void <a class="el" href="classwGui_1_1CPopupMenu.html#a2">Show</a> (<a class="el" href="classwGui_1_1CPoint.html">CPoint</a> Position)<li><a name="a3" doxytag="wGui::CPopupMenu::Hide"></a>void <a class="el" href="classwGui_1_1CPopupMenu.html#a3">Hide</a> (void)<dl class="el"><dd><font size=-1><em>Hide the popup and any popups hanging off of it.<br><br></em></font></dl><li>void <a class="el" href="classwGui_1_1CPopupMenu.html#a4">HideAll</a> (void)<li><a name="a5" doxytag="wGui::CPopupMenu::IsInsideChild"></a>bool <a class="el" href="classwGui_1_1CPopupMenu.html#a5">IsInsideChild</a> (<a class="el" href="classwGui_1_1CPoint.html">CPoint</a> &Point)<dl class="el"><dd><font size=-1><em>Tests to see if any children are hit by the point.<br><br></em></font></dl><li><a name="a6" doxytag="wGui::CPopupMenu::IsRootPopup"></a>bool <a class="el" href="classwGui_1_1CPopupMenu.html#a6">IsRootPopup</a> (void)<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>true is the Popup menu doesn't have any popup parents</dl><br><br></em></font></dl><li>void <a class="el" href="classwGui_1_1CPopupMenu.html#a7">SetParentMenu</a> (<a class="el" href="classwGui_1_1CMenu.html">CMenu</a> *pParentMenu)<li>virtual void <a class="el" href="classwGui_1_1CPopupMenu.html#a8">Draw</a> (void) const<li>virtual bool <a class="el" href="classwGui_1_1CPopupMenu.html#a9">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_1CPopupMenu.html#a10">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::CPopupMenu::UpdateCachedRects"></a>virtual void <a class="el" href="classwGui_1_1CPopupMenu.html#b0">UpdateCachedRects</a> (void) const<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_1CPopupMenu.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)</ul><h2>Protected Attributes</h2><ul><li><a class="el" href="classwGui_1_1CMenu.html">CMenu</a> * <a class="el" href="classwGui_1_1CPopupMenu.html#n0">m_pParentMenu</a></ul><hr><a name="_details"></a><h2>Detailed Description</h2>Popup menus are used for both context menus, and as the popups when a <a class="el" href="classwGui_1_1CMenu.html">CMenu</a> item is clicked that has a submenu.<p><p>Definition at line <a class="el" href="wg__menu_8h-source.html#l00203">203</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::CPopupMenu::CPopupMenu"></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::CPopupMenu::CPopupMenu </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 Popup Menu <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#l00368">368</a> of file <a class="el" href="wg__menu_8cpp-source.html">wg_menu.cpp</a>.<p>References <a class="el" href="wg__window_8h-source.html#l00209">wGui::CWindow::m_bVisible</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="a8" doxytag="wGui::CPopupMenu::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"> void wGui::CPopupMenu::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> [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>Implements <a class="el" href="classwGui_1_1CMenuBase.html#a7">wGui::CMenuBase</a>.<p>Definition at line <a class="el" href="wg__menu_8cpp-source.html#l00455">455</a> of file <a class="el" href="wg__menu_8cpp-source.html">wg_menu.cpp</a>.<p>References <a class="el" href="wg__resource__handle_8cpp-source.html#l00088">wGui::CBitmapResourceHandle::Bitmap()</a>, <a class="el" href="wg__rect_8h-source.html#l00091">wGui::CRect::Bottom()</a>, <a class="el" href="wg__painter_8cpp-source.html#l00066">wGui::CPainter::DrawHLine()</a>, <a class="el" href="wg__painter_8cpp-source.html#l00122">wGui::CPainter::DrawRect()</a>, <a class="el" href="wg__painter_8cpp-source.html#l00094">wGui::CPainter::DrawVLine()</a>, <a class="el" href="wg__rect_8cpp-source.html#l00090">wGui::CRect::Grow()</a>, <a class="el" href="wg__rect_8h-source.html#l00130">wGui::CRect::Height()</a>, <a class="el" href="wg__rect_8h-source.html#l00085">wGui::CRect::Left()</a>, <a class="el" href="wg__menu_8h-source.html#l00138">wGui::CMenuBase::m_HighlightColor</a>, <a class="el" href="wg__menu_8h-source.html#l00137">wGui::CMenuBase::m_hRightArrowBitmap</a>, <a class="el" href="wg__menu_8h-source.html#l00133">wGui::CMenuBase::m_MenuItems</a>, <a class="el" href="wg__menu_8h-source.html#l00134">wGui::CMenuBase::m_pHighlightedItem</a>, <a class="el" href="wg__window_8h-source.html#l00206">wGui::CWindow::m_pSDLSurface</a>, <a class="el" href="wg__window_8h-source.html#l00191">wGui::CWindow::m_WindowRect</a>, <a class="el" href="wg__rect_8h-source.html#l00088">wGui::CRect::Right()</a>, <a class="el" href="wg__rect_8h-source.html#l00071">wGui::CRect::SetLeft()</a>, <a class="el" href="wg__rect_8h-source.html#l00082">wGui::CRect::Top()</a>, <a class="el" href="wg__rect_8h-source.html#l00094">wGui::CRect::TopLeft()</a>, and <a class="el" href="wg__menu_8cpp-source.html#l00595">UpdateCachedRects()</a>. </td> </tr></table><a name="a10" doxytag="wGui::CPopupMenu::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::CPopupMenu::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_1CMenuBase.html#a9">wGui::CMenuBase</a>.<p>Definition at line <a class="el" href="wg__menu_8cpp-source.html#l00538">538</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__window_8cpp-source.html#l00104">wGui::CWindow::GetAncestor()</a>, <a class="el" href="wg__window_8cpp-source.html#l00096">wGui::CWindow::GetClientRect()</a>, <a class="el" href="wg__window_8h-source.html#l00062">wGui::CWindow::GetWindowRect()</a>, <a class="el" href="wg__menu_8cpp-source.html#l00086">wGui::CMenuBase::HideActivePopup()</a>, <a class="el" href="wg__menu_8cpp-source.html#l00419">HideAll()</a>, <a class="el" href="wg__rect_8cpp-source.html#l00167">wGui::CRect::HitTest()</a>, <a class="el" href="wg__menu_8cpp-source.html#l00441">IsInsideChild()</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">wGui::CMenuBase::m_MenuItems</a>, <a class="el" href="wg__menu_8h-source.html#l00136">wGui::CMenuBase::m_pActivePopup</a>, <a class="el" href="wg__menu_8h-source.html#l00134">wGui::CMenuBase::m_pHighlightedItem</a>, <a class="el" href="wg__menu_8h-source.html#l00269">m_pParentMenu</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#l00060">wGui::SMenuItem::pPopup</a>, <a class="el" href="classwGui_1_1CWindow.html#s2s1">wGui::CWindow::ROOT</a>, and <a class="el" href="wg__menu_8cpp-source.html#l00626">ShowActivePopup()</a>. </td> </tr></table><a name="a4" doxytag="wGui::CPopupMenu::HideAll"></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::CPopupMenu::HideAll </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></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Hide the popup, along with it's popup parents and children This method just searches for the root popup, and then calls <a class="el" href="classwGui_1_1CPopupMenu.html#a3">Hide()</a> on it <p>Definition at line <a class="el" href="wg__menu_8cpp-source.html#l00419">419</a> of file <a class="el" href="wg__menu_8cpp-source.html">wg_menu.cpp</a>.<p>References <a class="el" href="wg__menu_8cpp-source.html#l00409">Hide()</a>, and <a class="el" href="wg__menu_8cpp-source.html#l00086">wGui::CMenuBase::HideActivePopup()</a>.<p>Referenced by <a class="el" href="wg__menu_8cpp-source.html#l00538">HandleMessage()</a>, and <a class="el" href="wg__menu_8cpp-source.html#l00501">OnMouseButtonDown()</a>. </td> </tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -