<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>Qwt User's Guide: qwt_counter.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.3 --> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Qwt User's Guide <span id="projectnumber">6.0.1</span></div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> </ul> </div> <div class="header"> <div class="headertitle"> <h1>qwt_counter.h</h1> </div> </div> <div class="contents"> <div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************</span> <a name="l00002"></a>00002 <span class="comment"> * Qwt Widget Library</span> <a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1997 Josef Wilgen</span> <a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002 Uwe Rathmann</span> <a name="l00005"></a>00005 <span class="comment"> *</span> <a name="l00006"></a>00006 <span class="comment"> * This library is free software; you can redistribute it and/or</span> <a name="l00007"></a>00007 <span class="comment"> * modify it under the terms of the Qwt License, Version 1.0</span> <a name="l00008"></a>00008 <span class="comment"> *****************************************************************************/</span> <a name="l00009"></a>00009 <a name="l00010"></a>00010 <span class="preprocessor">#ifndef QWT_COUNTER_H</span> <a name="l00011"></a>00011 <span class="preprocessor"></span><span class="preprocessor">#define QWT_COUNTER_H</span> <a name="l00012"></a>00012 <span class="preprocessor"></span> <a name="l00013"></a>00013 <span class="preprocessor">#include "qwt_global.h"</span> <a name="l00014"></a>00014 <span class="preprocessor">#include "qwt_double_range.h"</span> <a name="l00015"></a>00015 <span class="preprocessor">#include <qwidget.h></span> <a name="l00016"></a>00016 <a name="l00058"></a><a class="code" href="class_qwt_counter.html">00058</a> <span class="keyword">class </span>QWT_EXPORT <a class="code" href="class_qwt_counter.html" title="The Counter Widget.">QwtCounter</a> : <span class="keyword">public</span> QWidget, <span class="keyword">public</span> <a class="code" href="class_qwt_double_range.html" title="A class which controls a value within an interval.">QwtDoubleRange</a> <a name="l00059"></a>00059 { <a name="l00060"></a>00060 Q_OBJECT <a name="l00061"></a>00061 <a name="l00062"></a>00062 Q_PROPERTY( <span class="keywordtype">int</span> numButtons READ numButtons WRITE setNumButtons ) <a name="l00063"></a>00063 Q_PROPERTY( <span class="keywordtype">double</span> basicstep READ step WRITE setStep ) <a name="l00064"></a>00064 Q_PROPERTY( <span class="keywordtype">double</span> minValue READ minValue WRITE setMinValue ) <a name="l00065"></a>00065 Q_PROPERTY( <span class="keywordtype">double</span> maxValue READ maxValue WRITE setMaxValue ) <a name="l00066"></a>00066 Q_PROPERTY( <span class="keywordtype">int</span> stepButton1 READ stepButton1 WRITE setStepButton1 ) <a name="l00067"></a>00067 Q_PROPERTY( <span class="keywordtype">int</span> stepButton2 READ stepButton2 WRITE setStepButton2 ) <a name="l00068"></a>00068 Q_PROPERTY( <span class="keywordtype">int</span> stepButton3 READ stepButton3 WRITE setStepButton3 ) <a name="l00069"></a>00069 Q_PROPERTY( <span class="keywordtype">double</span> value READ value WRITE setValue ) <a name="l00070"></a>00070 Q_PROPERTY( <span class="keywordtype">bool</span> editable READ editable WRITE setEditable ) <a name="l00071"></a>00071 <a name="l00072"></a>00072 <span class="keyword">public</span>: <a name="l00074"></a><a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374">00074</a> <span class="keyword">enum</span> <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374" title="Button index.">Button</a> <a name="l00075"></a>00075 { <a name="l00077"></a><a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374a1b29fe43c7d59986eb5854ddaf6f7179">00077</a> <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374a1b29fe43c7d59986eb5854ddaf6f7179" title="Button intended for minor steps.">Button1</a>, <a name="l00078"></a>00078 <a name="l00080"></a><a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374a6015e556fcb8c4d45126dee5435b478d">00080</a> <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374a6015e556fcb8c4d45126dee5435b478d" title="Button intended for medium steps.">Button2</a>, <a name="l00081"></a>00081 <a name="l00083"></a><a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374a30b64d40b31283807f1a4f3d57af0e74">00083</a> <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374a30b64d40b31283807f1a4f3d57af0e74" title="Button intended for large steps.">Button3</a>, <a name="l00084"></a>00084 <a name="l00086"></a><a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374aca8e93a2d129f7cc91f54f5f4da20c5f">00086</a> ButtonCnt <a name="l00087"></a>00087 }; <a name="l00088"></a>00088 <a name="l00089"></a>00089 <span class="keyword">explicit</span> <a class="code" href="class_qwt_counter.html" title="The Counter Widget.">QwtCounter</a>( QWidget *parent = NULL ); <a name="l00090"></a>00090 <span class="keyword">virtual</span> ~<a class="code" href="class_qwt_counter.html" title="The Counter Widget.">QwtCounter</a>(); <a name="l00091"></a>00091 <a name="l00092"></a>00092 <span class="keywordtype">bool</span> editable() <span class="keyword">const</span>; <a name="l00093"></a>00093 <span class="keywordtype">void</span> setEditable( <span class="keywordtype">bool</span> ); <a name="l00094"></a>00094 <a name="l00095"></a>00095 <span class="keywordtype">void</span> setNumButtons( <span class="keywordtype">int</span> n ); <a name="l00096"></a>00096 <span class="keywordtype">int</span> numButtons() <span class="keyword">const</span>; <a name="l00097"></a>00097 <a name="l00098"></a>00098 <span class="keywordtype">void</span> setIncSteps( <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374" title="Button index.">QwtCounter::Button</a> btn, <span class="keywordtype">int</span> nSteps ); <a name="l00099"></a>00099 <span class="keywordtype">int</span> incSteps( <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374" title="Button index.">QwtCounter::Button</a> btn ) <span class="keyword">const</span>; <a name="l00100"></a>00100 <a name="l00101"></a>00101 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_qwt_double_range.html#af6a3aa74c970a2bef29f0c1af99720e8" title="Set a new value without adjusting to the step raster.">setValue</a>( <span class="keywordtype">double</span> ); <a name="l00102"></a>00102 <span class="keyword">virtual</span> QSize sizeHint() <span class="keyword">const</span>; <a name="l00103"></a>00103 <a name="l00104"></a>00104 <span class="comment">// a set of dummies to help the designer</span> <a name="l00105"></a>00105 <a name="l00106"></a>00106 <span class="keywordtype">double</span> <a class="code" href="class_qwt_double_range.html#a0cb8cc60548c10cb1d98e54387961967">step</a>() <span class="keyword">const</span>; <a name="l00107"></a>00107 <span class="keywordtype">void</span> <a class="code" href="class_qwt_double_range.html#a29ed5fc66439def424a8ad773eea285d" title="Change the step raster.">setStep</a>( <span class="keywordtype">double</span> s ); <a name="l00108"></a>00108 <a name="l00109"></a>00109 <span class="keywordtype">double</span> <a class="code" href="class_qwt_double_range.html#a8b8650a6f8a96144d3af21207ee71637" title="Returns the value at the first border of the range.">minValue</a>() <span class="keyword">const</span>; <a name="l00110"></a>00110 <span class="keywordtype">void</span> setMinValue( <span class="keywordtype">double</span> m ); <a name="l00111"></a>00111 <a name="l00112"></a>00112 <span class="keywordtype">double</span> <a class="code" href="class_qwt_double_range.html#a215275a1a8b4218a424ee8444c7fe409" title="Returns the value of the second border of the range.">maxValue</a>() <span class="keyword">const</span>; <a name="l00113"></a>00113 <span class="keywordtype">void</span> setMaxValue( <span class="keywordtype">double</span> m ); <a name="l00114"></a>00114 <a name="l00115"></a>00115 <span class="keywordtype">void</span> setStepButton1( <span class="keywordtype">int</span> nSteps ); <a name="l00116"></a>00116 <span class="keywordtype">int</span> stepButton1() <span class="keyword">const</span>; <a name="l00117"></a>00117 <a name="l00118"></a>00118 <span class="keywordtype">void</span> setStepButton2( <span class="keywordtype">int</span> nSteps ); <a name="l00119"></a>00119 <span class="keywordtype">int</span> stepButton2() <span class="keyword">const</span>; <a name="l00120"></a>00120 <a name="l00121"></a>00121 <span class="keywordtype">void</span> setStepButton3( <span class="keywordtype">int</span> nSteps ); <a name="l00122"></a>00122 <span class="keywordtype">int</span> stepButton3() <span class="keyword">const</span>; <a name="l00123"></a>00123 <a name="l00124"></a>00124 <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="class_qwt_double_range.html#a7777cf257c812579c4891512f1b6cad0" title="Returns the current value.">value</a>() <span class="keyword">const</span>; <a name="l00125"></a>00125 <a name="l00126"></a>00126 Q_SIGNALS: <a name="l00131"></a>00131 <span class="keywordtype">void</span> buttonReleased ( <span class="keywordtype">double</span> value ); <a name="l00132"></a>00132 <a name="l00137"></a>00137 <span class="keywordtype">void</span> valueChanged ( <span class="keywordtype">double</span> value ); <a name="l00138"></a>00138 <a name="l00139"></a>00139 <span class="keyword">protected</span>: <a name="l00140"></a>00140 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> event( QEvent * ); <a name="l00141"></a>00141 <span class="keyword">virtual</span> <span class="keywordtype">void</span> wheelEvent( QWheelEvent * ); <a name="l00142"></a>00142 <span class="keyword">virtual</span> <span class="keywordtype">void</span> keyPressEvent( QKeyEvent * ); <a name="l00143"></a>00143 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_qwt_double_range.html#a3583134a1ac32706aa4742088bb9d4dc" title="Notify a change of the range.">rangeChange</a>(); <a name="l00144"></a>00144 <a name="l00145"></a>00145 <span class="keyword">private</span> Q_SLOTS: <a name="l00146"></a>00146 <span class="keywordtype">void</span> btnReleased(); <a name="l00147"></a>00147 <span class="keywordtype">void</span> btnClicked(); <a name="l00148"></a>00148 <span class="keywordtype">void</span> textChanged(); <a name="l00149"></a>00149 <a name="l00150"></a>00150 <span class="keyword">private</span>: <a name="l00151"></a>00151 <span class="keywordtype">void</span> initCounter(); <a name="l00152"></a>00152 <span class="keywordtype">void</span> updateButtons(); <a name="l00153"></a>00153 <span class="keywordtype">void</span> showNum( <span class="keywordtype">double</span> ); <a name="l00154"></a>00154 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_qwt_double_range.html#a1d50398342d6aa1d9cd86650ee29aff8" title="Notify a change of value.">valueChange</a>(); <a name="l00155"></a>00155 <a name="l00156"></a>00156 <span class="keyword">class </span>PrivateData; <a name="l00157"></a>00157 PrivateData *d_data; <a name="l00158"></a>00158 }; <a name="l00159"></a>00159 <a name="l00160"></a>00160 <span class="preprocessor">#endif</span> </pre></div></div> </div> <hr class="footer"/><address class="footer"><small>Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address> </body> </html>