📄 classwgui_1_1cwindow.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::CWindow 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::CWindow Class Reference</h1>A base class with all the basic properties needed by a window. <a href="#_details">More...</a><p><code>#include <<a class="el" href="wg__window_8h-source.html">wg_window.h</a>></code><p><p>Inheritance diagram for wGui::CWindow:<p><center><img src="classwGui_1_1CWindow.png" usemap="#wGui::CWindow_map" border="0" alt=""></center><map name="wGui::CWindow_map"><area href="classwGui_1_1CMessageClient.html" alt="wGui::CMessageClient" shape="rect" coords="0,0,138,24"><area href="classwGui_1_1CButton.html" alt="wGui::CButton" shape="rect" coords="148,112,286,136"><area href="classwGui_1_1CCheckBox.html" alt="wGui::CCheckBox" shape="rect" coords="148,168,286,192"><area href="classwGui_1_1CDropDown.html" alt="wGui::CDropDown" shape="rect" coords="148,224,286,248"><area href="classwGui_1_1CEditBox.html" alt="wGui::CEditBox" shape="rect" coords="148,280,286,304"><area href="classwGui_1_1CFrame.html" alt="wGui::CFrame" shape="rect" coords="148,336,286,360"><area href="classwGui_1_1CGroupBox.html" alt="wGui::CGroupBox" shape="rect" coords="148,392,286,416"><area href="classwGui_1_1CLabel.html" alt="wGui::CLabel" shape="rect" coords="148,448,286,472"><area href="classwGui_1_1CListBox.html" alt="wGui::CListBox" shape="rect" coords="148,504,286,528"><area href="classwGui_1_1CMenuBase.html" alt="wGui::CMenuBase" shape="rect" coords="148,560,286,584"><area href="classwGui_1_1CPicture.html" alt="wGui::CPicture" shape="rect" coords="148,616,286,640"><area href="classwGui_1_1CProgress.html" alt="wGui::CProgress" shape="rect" coords="148,672,286,696"><area href="classwGui_1_1CScrollBar.html" alt="wGui::CScrollBar" shape="rect" coords="148,728,286,752"><area href="classwGui_1_1CToolBar.html" alt="wGui::CToolBar" shape="rect" coords="148,784,286,808"><area href="classwGui_1_1CToolTip.html" alt="wGui::CToolTip" shape="rect" coords="148,840,286,864"><area href="classwGui_1_1CView.html" alt="wGui::CView" shape="rect" coords="148,896,286,920"></map><h2>Public Types</h2><ul><li>enum <a class="el" href="classwGui_1_1CWindow.html#s2">EAncestor</a> { <a class="el" href="classwGui_1_1CWindow.html#s2s0">PARENT</a>, <a class="el" href="classwGui_1_1CWindow.html#s2s1">ROOT</a> }<dl class="el"><dd><font size=-1><em>Describes the ancestor that is desired.</em> <a href="#s2">More...</a><em><br><br></em></font></dl></ul><h2>Public Methods</h2><ul><li><a class="el" href="classwGui_1_1CWindow.html#a0">CWindow</a> (const <a class="el" href="classwGui_1_1CRect.html">CRect</a> &WindowRect, CWindow *pParent)<li><a name="a1" doxytag="wGui::CWindow::~CWindow"></a>virtual <a class="el" href="classwGui_1_1CWindow.html#a1">~CWindow</a> (void)<dl class="el"><dd><font size=-1><em>The <a class="el" href="classwGui_1_1CWindow.html">CWindow</a> destructor will automatically deregister itself with it's parent (if it had one).<br><br></em></font></dl><li>virtual void <a class="el" href="classwGui_1_1CWindow.html#a2">SetWindowRect</a> (const <a class="el" href="classwGui_1_1CRect.html">CRect</a> &WindowRect)<li><a name="a3" doxytag="wGui::CWindow::GetWindowRect"></a>virtual <a class="el" href="classwGui_1_1CRect.html">CRect</a> <a class="el" href="classwGui_1_1CWindow.html#a3">GetWindowRect</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>A copy of the <a class="el" href="classwGui_1_1CRect.html">CRect</a> that the window represents</dl><br><br></em></font></dl><li>virtual void <a class="el" href="classwGui_1_1CWindow.html#a4">MoveWindow</a> (const <a class="el" href="classwGui_1_1CPoint.html">CPoint</a> &MoveDistance)<li>virtual <a class="el" href="classwGui_1_1CRect.html">CRect</a> <a class="el" href="classwGui_1_1CWindow.html#a5">GetClientRect</a> (void) const<li>virtual void <a class="el" href="classwGui_1_1CWindow.html#a6">SetBGColor</a> (const <a class="el" href="classwGui_1_1CRGBColor.html">CRGBColor</a> &Color)<li>virtual <a class="el" href="classwGui_1_1CRGBColor.html">CRGBColor</a> <a class="el" href="classwGui_1_1CWindow.html#a7">GetBGColor</a> (void)<li>virtual CWindow * <a class="el" href="classwGui_1_1CWindow.html#a8">GetAncestor</a> (<a class="el" href="classwGui_1_1CWindow.html#s2">EAncestor</a> eAncestor) const<li>virtual bool <a class="el" href="classwGui_1_1CWindow.html#a9">IsChildOf</a> (CWindow *pWindow) const<li>virtual bool <a class="el" href="classwGui_1_1CWindow.html#a10">IsVisible</a> (void)<li>virtual void <a class="el" href="classwGui_1_1CWindow.html#a11">SetVisible</a> (bool bVisible)<li><a name="a12" doxytag="wGui::CWindow::GetSDLSurface"></a>virtual SDL_Surface * <a class="el" href="classwGui_1_1CWindow.html#a12">GetSDLSurface</a> (void)<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>A pointer to the window's SDL surface</dl><br><br></em></font></dl><li>virtual <a class="el" href="classwGui_1_1CRect.html">CRect</a> <a class="el" href="classwGui_1_1CWindow.html#a13">ClientToScreen</a> (const <a class="el" href="classwGui_1_1CRect.html">CRect</a> &Rect) const<li>virtual <a class="el" href="classwGui_1_1CPoint.html">CPoint</a> <a class="el" href="classwGui_1_1CWindow.html#a14">ClientToScreen</a> (const <a class="el" href="classwGui_1_1CPoint.html">CPoint</a> &Point) const<li>virtual void <a class="el" href="classwGui_1_1CWindow.html#a15">SetWindowText</a> (const std::string &sText)<li>virtual std::string <a class="el" href="classwGui_1_1CWindow.html#a16">GetWindowText</a> (void)<li>virtual const std::string & <a class="el" href="classwGui_1_1CWindow.html#a17">GetClassName</a> (void)<li>virtual void <a class="el" href="classwGui_1_1CWindow.html#a18">DrawProc</a> (void) const<li>virtual void <a class="el" href="classwGui_1_1CWindow.html#a19">DrawBG</a> (void) const<li><a name="a20" doxytag="wGui::CWindow::Draw"></a>virtual void <a class="el" href="classwGui_1_1CWindow.html#a20">Draw</a> (void) const<dl class="el"><dd><font size=-1><em>Render the control itself.<br><br></em></font></dl><li><a name="a21" doxytag="wGui::CWindow::DrawChildren"></a>virtual void <a class="el" href="classwGui_1_1CWindow.html#a21">DrawChildren</a> (void) const<dl class="el"><dd><font size=-1><em>Call <a class="el" href="classwGui_1_1CWindow.html#a18">DrawProc()</a> for any children of the current windows.<br><br></em></font></dl><li><a name="a22" doxytag="wGui::CWindow::DrawPostChild"></a>virtual void <a class="el" href="classwGui_1_1CWindow.html#a22">DrawPostChild</a> (void) const<dl class="el"><dd><font size=-1><em>The last chance to do any further drawing.<br><br></em></font></dl><li><a name="a23" doxytag="wGui::CWindow::StartDrawProc"></a>virtual void <a class="el" href="classwGui_1_1CWindow.html#a23">StartDrawProc</a> (void) const<dl class="el"><dd><font size=-1><em>This calls DrawProc, then updates the relevant screen area.<br><br></em></font></dl><li>virtual void <a class="el" href="classwGui_1_1CWindow.html#a24">SetNewParent</a> (CWindow *pNewParent)<li>virtual bool <a class="el" href="classwGui_1_1CWindow.html#a25">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_1CWindow.html#a26">OnMouseButtonUp</a> (<a class="el" href="classwGui_1_1CPoint.html">CPoint</a> Point, unsigned int Button)<li>virtual bool <a class="el" href="classwGui_1_1CWindow.html#a27">HandleMessage</a> (<a class="el" href="classwGui_1_1CMessage.html">CMessage</a> *pMessage)</ul><h2>Protected Methods</h2><ul><li>virtual void <a class="el" href="classwGui_1_1CWindow.html#b0">RegisterChildWindow</a> (CWindow *pWindow)<li>virtual void <a class="el" href="classwGui_1_1CWindow.html#b1">DeregisterChildWindow</a> (CWindow *pWindow)</ul><h2>Protected Attributes</h2><ul><li><a name="n0" doxytag="wGui::CWindow::m_sWindowText"></a>std::string <a class="el" href="classwGui_1_1CWindow.html#n0">m_sWindowText</a><dl class="el"><dd><font size=-1><em>The Window Text (not directly used by <a class="el" href="classwGui_1_1CWindow.html">CWindow</a>).<br><br></em></font></dl><li><a name="n1" doxytag="wGui::CWindow::m_WindowRect"></a><a class="el" href="classwGui_1_1CRect.html">CRect</a> <a class="el" href="classwGui_1_1CWindow.html#n1">m_WindowRect</a><dl class="el"><dd><font size=-1><em>The area the control occupies.<br><br></em></font></dl><li><a name="n2" doxytag="wGui::CWindow::m_BGColor"></a><a class="el" href="classwGui_1_1CRGBColor.html">CRGBColor</a> <a class="el" href="classwGui_1_1CWindow.html#n2">m_BGColor</a><dl class="el"><dd><font size=-1><em>Background color of the window.<br><br></em></font></dl><li><a name="n3" doxytag="wGui::CWindow::m_ClientRect"></a><a class="el" href="classwGui_1_1CRect.html">CRect</a> <a class="el" href="classwGui_1_1CWindow.html#n3">m_ClientRect</a><dl class="el"><dd><font size=-1><em>The client area of the window, represented in the window's coordinates where (0,0) is the top left corner of the window.<br><br></em></font></dl><li><a name="n4" doxytag="wGui::CWindow::m_pParentWindow"></a>CWindow * <a class="el" href="classwGui_1_1CWindow.html#n4">m_pParentWindow</a><dl class="el"><dd><font size=-1><em>Pointer to the parent window.<br><br></em></font></dl><li><a name="n5" doxytag="wGui::CWindow::m_ChildWindows"></a>std::list< CWindow * > <a class="el" href="classwGui_1_1CWindow.html#n5">m_ChildWindows</a><dl class="el"><dd><font size=-1><em>A list of child windows.<br><br></em></font></dl><li><a name="n6" doxytag="wGui::CWindow::m_pSDLSurface"></a>SDL_Surface * <a class="el" href="classwGui_1_1CWindow.html#n6">m_pSDLSurface</a><dl class="el"><dd><font size=-1><em>A pointer to the SDL surface that the window exists on, and should use for drawing itself.<br><br></em></font></dl><li><a name="n7" doxytag="wGui::CWindow::m_bVisible"></a>bool <a class="el" href="classwGui_1_1CWindow.html#n7">m_bVisible</a><dl class="el"><dd><font size=-1><em>If this is false, the control will not draw itself.<br><br></em></font></dl><li><a name="n8" doxytag="wGui::CWindow::m_sClassName"></a>std::string <a class="el" href="classwGui_1_1CWindow.html#n8">m_sClassName</a><dl class="el"><dd><font size=-1><em>A string that identifies the class.<br><br></em></font></dl></ul><hr><a name="_details"></a><h2>Detailed Description</h2>A base class with all the basic properties needed by a window.<p><a class="el" href="classwGui_1_1CWindow.html">CWindow</a> i inherits from the <a class="el" href="classwGui_1_1CMessageClient.html">CMessageClient</a> class so that any 'window' can recieve messages <a class="el" href="classwGui_1_1CWindow.html">CWindow</a> provides the basic properties and methods needed to define a window Almost all controls and views will be derived from this <p><p>Definition at line <a class="el" href="wg__window_8h-source.html#l00045">45</a> of file <a class="el" href="wg__window_8h-source.html">wg_window.h</a>.<hr><h2>Member Enumeration Documentation</h2><a name="s2" doxytag="wGui::CWindow::EAncestor"></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"> enum wGui::CWindow::EAncestor </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Describes the ancestor that is desired.<p><dl compact><dt><b>Enumeration values: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em><a name="s2s0" doxytag="PARENT"></a><em>PARENT</em></em> </td><td>return the direct parent of the window</td></tr><tr><td valign=top><em><a name="s2s1" doxytag="ROOT"></a><em>ROOT</em></em> </td><td>climb the parent chain all the way until the root and return it</td></tr></table></dl><p>Definition at line <a class="el" href="wg__window_8h-source.html#l00084">84</a> of file <a class="el" href="wg__window_8h-source.html">wg_window.h</a>. </td> </tr></table><hr><h2>Constructor & Destructor Documentation</h2><a name="a0" doxytag="wGui::CWindow::CWindow"></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::CWindow::CWindow </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>CWindow * </td> <td class="mdname" nowrap> <em>pParent</em></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>The constructor will automatically register the new window with the specified parent as a child (if a parent is given) The parent is then responsible for destroying the window <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></table></dl><p>Definition at line <a class="el" href="wg__window_8cpp-source.html#l00039">39</a> of file <a class="el" href="wg__window_8cpp-source.html">wg_window.cpp</a>.<p>References <a class="el" href="wg__window_8cpp-source.html#l00223">SetNewParent()</a>. </td> </tr></table><hr><h2>Member Function Documentation</h2><a name="a14" doxytag="wGui::CWindow::ClientToScreen"></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 <a class="el" href="classwGui_1_1CPoint.html">CPoint</a> wGui::CWindow::ClientToScreen </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classwGui_1_1CPoint.html">CPoint</a> & </td> <td class="mdname1" valign="top" nowrap> <em>Point</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const<code> [inline, virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Translate the given <a class="el" href="classwGui_1_1CPoint.html">CPoint</a> into screen coordinates <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>Point</em> </td><td>A <a class="el" href="classwGui_1_1CPoint.html">CPoint</a> in client coordinates </td></tr></table></dl><p>Definition at line <a class="el" href="wg__window_8h-source.html#l00115">115</a> of file <a class="el" href="wg__window_8h-source.html">wg_window.h</a>.<p>References <a class="el" href="wg__window_8cpp-source.html#l00096">GetClientRect()</a>, and <a class="el" href="wg__rect_8h-source.html#l00094">wGui::CRect::TopLeft()</a>. </td> </tr></table><a name="a13" doxytag="wGui::CWindow::ClientToScreen"></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 <a class="el" href="classwGui_1_1CRect.html">CRect</a> wGui::CWindow::ClientToScreen </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="mdname1" valign="top" nowrap> <em>Rect</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const<code> [inline, virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Translate the given <a class="el" href="classwGui_1_1CRect.html">CRect</a> into screen coordinates <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>Rect</em> </td><td>A <a class="el" href="classwGui_1_1CRect.html">CRect</a> in client coordinates </td></tr></table></dl><p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -