⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wg__button_8h-source.html

📁 一个小巧的嵌入式图形系统wGUI, 可以用VC编译
💻 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>wg_button.h Source File</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> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Data Structures</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Data Fields</a> &nbsp; </center><hr><h1>wg_button.h</h1><div class="fragment"><pre>00001 <span class="comment">// wg_button.h</span>00002 <span class="comment">//</span>00003 <span class="comment">// CButton interface</span>00004 <span class="comment">//</span>00005 <span class="comment">//</span>00006 <span class="comment">// Copyright (c) 2002 Rob Wiskow</span>00007 <span class="comment">// rob-dev@boxedchaos.com</span>00008 <span class="comment">//</span>00009 <span class="comment">// This library is free software; you can redistribute it and/or</span>00010 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>00011 <span class="comment">// License as published by the Free Software Foundation; either</span>00012 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>00013 <span class="comment">//</span>00014 <span class="comment">// This library is distributed in the hope that it will be useful,</span>00015 <span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span>00016 <span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>00017 <span class="comment">// Lesser General Public License for more details.</span>00018 <span class="comment">//</span>00019 <span class="comment">// You should have received a copy of the GNU Lesser General Public</span>00020 <span class="comment">// License along with this library; if not, write to the Free Software</span>00021 <span class="comment">// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span>00022 <span class="comment">//</span>00023 00024 00025 <span class="preprocessor">#ifndef _WG_BUTTON_H_</span>00026 <span class="preprocessor"></span><span class="preprocessor">#define _WG_BUTTON_H_</span>00027 <span class="preprocessor"></span>00028 <span class="preprocessor">#include "wg_window.h"</span>00029 <span class="preprocessor">#include "wg_painter.h"</span>00030 <span class="preprocessor">#include "wg_renderedstring.h"</span>00031 <span class="preprocessor">#include "wg_picture.h"</span>00032 <span class="preprocessor">#include &lt;memory&gt;</span>00033 00034 00035 <span class="keyword">namespace </span>wGui00036 {00037 00039 00041 <a name="l00042"></a><a class="code" href="classwGui_1_1CButton.html">00042</a> <span class="keyword">class </span><a class="code" href="classwGui_1_1CButton.html">CButton</a> : <span class="keyword">public</span> <a class="code" href="classwGui_1_1CWindow.html">CWindow</a>00043 {00044 <span class="keyword">public</span>:00051      <a class="code" href="classwGui_1_1CButton.html#a0">CButton</a>(<span class="keyword">const</span> <a class="code" href="classwGui_1_1CRect.html">CRect</a>&amp; WindowRect, <a class="code" href="classwGui_1_1CWindow.html">CWindow</a>* pParent, std::string sText, <a class="code" href="classwGui_1_1CFontEngine.html">CFontEngine</a>* pFontEngine = 0);00052 00054      <span class="keyword">virtual</span> <a class="code" href="classwGui_1_1CButton.html#a1">~CButton</a>(<span class="keywordtype">void</span>);00055 <a name="l00057"></a><a class="code" href="classwGui_1_1CButton.html#s3">00057</a>      <span class="keyword">enum</span> <a class="code" href="classwGui_1_1CButton.html#s3">EState</a> {00058           <a class="code" href="classwGui_1_1CButton.html#s3s0">UP</a>,  00059           <a class="code" href="classwGui_1_1CButton.html#s3s1">DOWN</a>,  00060           <a class="code" href="classwGui_1_1CButton.html#s3s2">DISABLED</a>  00061      };00062 <a name="l00064"></a><a class="code" href="classwGui_1_1CButton.html#a2">00064</a>      <a class="code" href="classwGui_1_1CButton.html#s3">EState</a> <a class="code" href="classwGui_1_1CButton.html#a2">GetButtonState</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classwGui_1_1CButton.html#n2">m_eButtonState</a>; }00065 00068      <span class="keywordtype">void</span> <a class="code" href="classwGui_1_1CButton.html#a3">SetButtonState</a>(<a class="code" href="classwGui_1_1CButton.html#s3">EState</a> eState);00069 00070 00071      <span class="comment">// CWindow overrides</span>00073 <span class="comment">     virtual void Draw(void) const;</span>00074 00077      <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classwGui_1_1CButton.html#a5">SetWindowText</a>(<span class="keyword">const</span> std::string&amp; sWindowText);00078 00084      <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classwGui_1_1CButton.html#a6">OnMouseButtonDown</a>(CPoint Point, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> Button);00085 00091      <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classwGui_1_1CButton.html#a7">OnMouseButtonUp</a>(CPoint Point, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> Button);00092 00093 00094      <span class="comment">// CMessageClient overrides</span>00097 <span class="comment">     virtual bool HandleMessage(CMessage* pMessage);</span>00098 00099 00100 <span class="keyword">protected</span>:<a name="l00101"></a><a class="code" href="classwGui_1_1CButton.html#n0">00101</a>      <a class="code" href="classwGui_1_1CFontEngine.html">CFontEngine</a>* <a class="code" href="classwGui_1_1CButton.html#n0">m_pFontEngine</a>;  <a name="l00102"></a><a class="code" href="classwGui_1_1CButton.html#n1">00102</a>      std::auto_ptr&lt;CRenderedString&gt; <a class="code" href="classwGui_1_1CButton.html#n1">m_pRenderedString</a>;  <a name="l00103"></a><a class="code" href="classwGui_1_1CButton.html#n2">00103</a>      <a class="code" href="classwGui_1_1CButton.html#s3">EState</a> <a class="code" href="classwGui_1_1CButton.html#n2">m_eButtonState</a>;  <a name="l00104"></a><a class="code" href="classwGui_1_1CButton.html#n3">00104</a>      <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classwGui_1_1CButton.html#n3">m_MouseButton</a>;  00105 00106 <span class="keyword">private</span>:00107      <span class="keywordtype">void</span> operator=(<a class="code" href="classwGui_1_1CButton.html">CButton</a>) { }  00108 };00109 00110 00112 <a name="l00113"></a><a class="code" href="classwGui_1_1CPictureButton.html">00113</a> <span class="keyword">class </span><a class="code" href="classwGui_1_1CPictureButton.html">CPictureButton</a> : <span class="keyword">public</span> <a class="code" href="classwGui_1_1CButton.html">CButton</a>00114 {00115 <span class="keyword">public</span>:00120      <a class="code" href="classwGui_1_1CPictureButton.html#a0">CPictureButton</a>(<span class="keyword">const</span> <a class="code" href="classwGui_1_1CRect.html">CRect</a>&amp; WindowRect, <a class="code" href="classwGui_1_1CWindow.html">CWindow</a>* pParent, std::string sPictureFile);00121 00126      <a class="code" href="classwGui_1_1CPictureButton.html#a0">CPictureButton</a>(<span class="keyword">const</span> <a class="code" href="classwGui_1_1CRect.html">CRect</a>&amp; WindowRect, <a class="code" href="classwGui_1_1CWindow.html">CWindow</a>* pParent, <span class="keyword">const</span> <a class="code" href="classwGui_1_1CBitmapResourceHandle.html">CBitmapResourceHandle</a>&amp; hBitmap);00127 00129      <span class="keyword">virtual</span> <a class="code" href="classwGui_1_1CPictureButton.html#a2">~CPictureButton</a>(<span class="keywordtype">void</span>);00130 00131 00134      <span class="keywordtype">void</span> <a class="code" href="classwGui_1_1CPictureButton.html#a3">SetPicture</a>(std::string sPictureFile);00135 00138      <span class="keywordtype">void</span> <a class="code" href="classwGui_1_1CPictureButton.html#a3">SetPicture</a>(<span class="keyword">const</span> <a class="code" href="classwGui_1_1CBitmapResourceHandle.html">CBitmapResourceHandle</a>&amp; hBitmap);00139 00140 00141      <span class="comment">// CWindow overrides</span>00143 <span class="comment">     virtual void Draw(void) const;</span>00144 00145 <span class="keyword">private</span>:00146      std::auto_ptr&lt;CBitmapResourceHandle&gt; m_phBitmap;  00147      <span class="keywordtype">void</span> operator=(<a class="code" href="classwGui_1_1CPictureButton.html">CPictureButton</a>) { }  00148 };00149 00150 }00151 00152 <span class="preprocessor">#endif  // _WG_BUTTON_H_</span>00153 <span class="preprocessor"></span>00154 </pre></div><hr><address style="align: right;"><small>Generated on Sat Oct 25 12:43:21 2003 for wGui by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -