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

📄 q_button.html

📁 QCurses使用手册 QCurses使用手册
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>欢迎光临 QCurses 函数库主页</title>
<link href="css/qcurses.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body,td,th {
	font-family: 宋体;
	font-size: 12px;
}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style7 {font-family: "黑体"}
.style9 {color: #FFFFFF}
.style10 {color: #000000}
-->
</style></head>

<body>
<table width="100%" height="0"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top"><table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="25" bgcolor="EFEFEF">■ <A href="Q_Button.html" target=_blank>Q_Button</A> 按钮类</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table>      
      <table width="600" border="0" align="center" cellpadding="10" cellspacing="0">
        <tr>
          <td valign="top" bgcolor="EFEFEF">     <p>功能介绍:</p>
          <p>按钮类,自由设定标题、颜色等,美观大方。<br>
          </p></td>
        </tr>
    </table>      
      <br>
      <table width="600" border="0" align="center" cellpadding="10" cellspacing="0">
        <tr>
          <td valign="top" bgcolor="EFEFEF"><p>函数、变量:</p>
            <table width="90%"  border="0" align="center" cellpadding="5" cellspacing="1">
              <tr bgcolor="#333333">
                <td width="69%"><div align="center" class="style9">函数、变量声明</div></td>
                <td width="31%"><div align="center" class="style9">功能,含义</div></td>
              </tr>
              <tr bgcolor="#CCCCCC">
                <td valign="top"><p class="style10">Q_Button(WINDOW *vMainWin,<br>
                       int vWidth,<br>
                       int vYBegin,<br>
                       int vXBegin,<br>
                       int vCFront,<br>
                       int vCBack)</p>
                  <p class="style10">参数:<br>
                  操作的父窗口指针、按钮宽度、纵坐标起始点、横坐标起始点、前景色、背景色</p>
                </td>
                <td><div align="center"><span class="style10">构造函数</span></div></td>
              </tr>
              <tr bgcolor="#CCCCCC">
                <td><p class="style10">void Set(const char *format,...)</p>
                    <p class="style10">参数:按钮文字</p></td>
                <td><div align="center"><span class="style10">设置按钮文字</span></div></td>
              </tr>
              <tr bgcolor="#CCCCCC">
                <td>int Get()</td>
                <td><div align="center"><span class="style10">按钮取值</span></div></td>
              </tr>
              <tr bgcolor="#CCCCCC">
                <td>char *Text</td>
                <td><div align="center"><span class="style10">当前按钮文字</span></div></td>
              </tr>
              <tr bgcolor="#CCCCCC">
                <td><span class="style10"></span></td>
                <td><div align="center"><span class="style10"></span></div></td>
              </tr>
              <tr bgcolor="#CCCCCC">
                <td><span class="style10"></span></td>
                <td><div align="center"><span class="style10"></span></div></td>
              </tr>
            </table>            
            <p>&nbsp;              </p>
          </td>
        </tr>
      </table>      
      <br>
      <table width="600" border="0" align="center" cellpadding="10" cellspacing="0">
        <tr>
          <td valign="top" bgcolor="EFEFEF"><p>演示例子:</p>
            <p>#include &quot;qcurses.hpp&quot;</p>
            <p>main()<br>
            {<br>
              initscr();<br>
              start_color();            <br>
              WINDOW *WINDOW = newwin(15,50,5,15);<br>
  Q_Window *Form1 = new Q_Window(WINDOW,15,50,0,0,true,COLOR_WHITE,COLOR_BLUE);<br>
  Form1-&gt;SetCaption(&quot;New Qcurses LIB test &quot;,COLOR_MAGENTA,COLOR_WHITE);<br>
  Form1-&gt;xBorder(4);<br>
<br>
  Q_Button *Button[4]; //按钮控件<br>
  Button[0] = new Q_Button(Form1-&gt;GetHandle(),6,6,20,COLOR_MAGENTA,COLOR_BLUE);<br>
  Button[1] = new Q_Button(Form1-&gt;GetHandle(),6,7,20,COLOR_MAGENTA,COLOR_YELLOW);              <br>
  Button[2] = new Q_Button(Form1-&gt;GetHandle(),6,8,20,COLOR_MAGENTA,COLOR_RED);<br>
  Button[3] = new Q_Button(Form1-&gt;GetHandle(),6,9,20,COLOR_MAGENTA,COLOR_WHITE);<br>
<br>
  Button[0]-&gt;Set(&quot;Win&quot;);<br>
  Button[1]-&gt;Set(&quot;UNIX&quot;);<br>
  Button[2]-&gt;Set(&quot;Linux&quot;);<br>
  Button[3]-&gt;Set(&quot;Dragon&quot;); <br>
<br>
    Button[0]-&gt;Get();<br>
    Button[1]-&gt;Get();<br>
    Button[2]-&gt;Get();<br>
    Button[3]-&gt;Get();  <br>
  <br>
                delete Button[0]; <br>
    delete Button[1];<br>
    delete Button[2];<br>
    delete Button[3];<br>
    delete Form1;<br>
    delwin(WINDOW);<br>
    endwin();<br>
  }</p>
            <p> 说明:<br>
            </p>
            <p>编译 g++ ./libqcurses.so main.cpp -o ctest -lcurses</p>
            <p>此例子将实现以下效果:</p>
            <p align="center"><img src="images/qbutton/1.jpg" width="458" height="251"><br>
              <br>
            </p>
            <p align="center"><img src="images/qbutton/2.jpg" width="450" height="267"> </p></td>
        </tr>
      </table>
      </td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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