File: qwt__counter_8h-source.html

package info (click to toggle)
libqwt 4.2.0-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 9,832 kB
  • ctags: 5,512
  • sloc: cpp: 22,973; ansic: 244; makefile: 64
file content (107 lines) | stat: -rw-r--r-- 9,787 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Qwt User&apos;s Guide: qwt_counter.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.8 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<h1>qwt_counter.h</h1><pre class="fragment"><div>00001 <span class="comment">/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************</span>
00002 <span class="comment"> * Qwt Widget Library</span>
00003 <span class="comment"> * Copyright (C) 1997   Josef Wilgen</span>
00004 <span class="comment"> * Copyright (C) 2002   Uwe Rathmann</span>
00005 <span class="comment"> * </span>
00006 <span class="comment"> * This library is free software; you can redistribute it and/or</span>
00007 <span class="comment"> * modify it under the terms of the Qwt License, Version 1.0</span>
00008 <span class="comment"> *****************************************************************************/</span>
00009 
00010 <span class="comment">// vim: expandtab</span>
00011 
00012 <span class="preprocessor">#ifndef QWT_COUNTER_H</span>
00013 <span class="preprocessor"></span><span class="preprocessor">#define QWT_COUNTER_H</span>
00014 <span class="preprocessor"></span>
00015 <span class="preprocessor">#include &lt;qwidget.h&gt;</span>
00016 <span class="preprocessor">#include "qwt_global.h"</span>
00017 <span class="preprocessor">#include "qwt_drange.h"</span>
00018 
00019 <span class="keyword">class </span><a class="code" href="class_qwt_arrow_button.html">QwtArrowButton</a>;
00020 <span class="keyword">class </span>QLineEdit;
00021 
<a name="l00063"></a><a class="code" href="class_qwt_counter.html">00063</a> <span class="keyword">class </span>QWT_EXPORT QwtCounter : <span class="keyword">public</span> QWidget, <span class="keyword">public</span> <a class="code" href="class_qwt_dbl_range.html">QwtDblRange</a>
00064 {
00065     Q_OBJECT
00066 
00067     Q_PROPERTY( <span class="keywordtype">int</span> numButtons READ numButtons WRITE setNumButtons )
00068     Q_PROPERTY( <span class="keywordtype">double</span> basicstep READ step WRITE setStep )
00069     Q_PROPERTY( <span class="keywordtype">double</span> minValue READ minVal WRITE setMinValue )
00070     Q_PROPERTY( <span class="keywordtype">double</span> maxValue READ maxVal WRITE setMaxValue )
00071     Q_PROPERTY( <span class="keywordtype">int</span> stepButton1 READ stepButton1 WRITE setStepButton1 )
00072     Q_PROPERTY( <span class="keywordtype">int</span> stepButton2 READ stepButton2 WRITE setStepButton2 )
00073     Q_PROPERTY( <span class="keywordtype">int</span> stepButton3 READ stepButton3 WRITE setStepButton3 )
00074     Q_PROPERTY( <span class="keywordtype">double</span> value READ value WRITE setValue )
00075 
00076 <span class="keyword">public</span>:
<a name="l00081"></a><a class="code" href="class_qwt_counter.html#w4">00081</a>     <span class="keyword">enum</span> Button { Button1, Button2, Button3, ButtonCnt };
00082 
00083     QwtCounter(QWidget *parent = 0, <span class="keyword">const</span> <span class="keywordtype">char</span> *name = 0);
00084 
<a name="l00086"></a><a class="code" href="class_qwt_counter.html#a1">00086</a>     <span class="keywordtype">double</span> <a class="code" href="class_qwt_dbl_range.html#a10">step</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_qwt_dbl_range.html#a10">QwtDblRange::step</a>();}
<a name="l00088"></a><a class="code" href="class_qwt_counter.html#a2">00088</a>     <span class="keywordtype">void</span> <a class="code" href="class_qwt_dbl_range.html#a9">setStep</a>(<span class="keywordtype">double</span> s) {<a class="code" href="class_qwt_dbl_range.html#a9">QwtDblRange::setStep</a>(s);}
<a name="l00090"></a><a class="code" href="class_qwt_counter.html#a3">00090</a>     <span class="keywordtype">double</span> minVal()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_qwt_dbl_range.html#a12">minValue</a>();}
<a name="l00092"></a><a class="code" href="class_qwt_counter.html#a4">00092</a>     <span class="keywordtype">void</span> setMinValue(<span class="keywordtype">double</span> m) { <a class="code" href="class_qwt_dbl_range.html#a2">setRange</a>(m, <a class="code" href="class_qwt_dbl_range.html#a11">maxValue</a>(), <a class="code" href="class_qwt_dbl_range.html#a10">step</a>());}
<a name="l00094"></a><a class="code" href="class_qwt_counter.html#a5">00094</a>     <span class="keywordtype">double</span> maxVal()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_qwt_dbl_range.html#a11">QwtDblRange::maxValue</a>();}
<a name="l00096"></a><a class="code" href="class_qwt_counter.html#a6">00096</a>     <span class="keywordtype">void</span> setMaxValue(<span class="keywordtype">double</span> m) {<a class="code" href="class_qwt_dbl_range.html#a2">setRange</a>(<a class="code" href="class_qwt_dbl_range.html#a12">minValue</a>(), m, <a class="code" href="class_qwt_dbl_range.html#a10">step</a>());}
<a name="l00098"></a><a class="code" href="class_qwt_counter.html#a7">00098</a>     <span class="keywordtype">void</span> setStepButton1(<span class="keywordtype">int</span> nSteps) {setIncSteps(Button1, nSteps);}
<a name="l00100"></a><a class="code" href="class_qwt_counter.html#a8">00100</a>     <span class="keywordtype">int</span> stepButton1()<span class="keyword"> const </span>{<span class="keywordflow">return</span> incSteps(Button1);}
<a name="l00102"></a><a class="code" href="class_qwt_counter.html#a9">00102</a>     <span class="keywordtype">void</span> setStepButton2(<span class="keywordtype">int</span> nSteps) {setIncSteps(Button2, nSteps);}
<a name="l00104"></a><a class="code" href="class_qwt_counter.html#a10">00104</a>     <span class="keywordtype">int</span> stepButton2()<span class="keyword"> const </span>{<span class="keywordflow">return</span> incSteps(Button2);}
<a name="l00106"></a><a class="code" href="class_qwt_counter.html#a11">00106</a>     <span class="keywordtype">void</span> setStepButton3(<span class="keywordtype">int</span> nSteps) {setIncSteps(Button3, nSteps);}
<a name="l00108"></a><a class="code" href="class_qwt_counter.html#a12">00108</a>     <span class="keywordtype">int</span> stepButton3()<span class="keyword"> const </span>{<span class="keywordflow">return</span> incSteps(Button3);}
<a name="l00109"></a><a class="code" href="class_qwt_counter.html#a13">00109</a>     <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="class_qwt_dbl_range.html#a6">value</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_qwt_dbl_range.html#a6">QwtDblRange::value</a>();}
00110  
00111     <span class="keywordtype">void</span> setNumButtons(<span class="keywordtype">int</span> n);
00112     <span class="keywordtype">int</span> numButtons() const;
00113     
00114     <span class="keywordtype">void</span> setIncSteps(QwtCounter::Button btn, <span class="keywordtype">int</span> nSteps);
00115     <span class="keywordtype">int</span> incSteps(QwtCounter::Button btn) const;
00116 
00117     virtual <span class="keywordtype">void</span> setValue(<span class="keywordtype">double</span>);
00118     virtual QSizePolicy sizePolicy() const;
00119     virtual QSize sizeHint() const;
00120 
00121     virtual <span class="keywordtype">bool</span> eventFilter(QObject *, QEvent *);
00122 
00123 signals:
00128     <span class="keywordtype">void</span> buttonReleased (<span class="keywordtype">double</span> value);  
00129 
00134     <span class="keywordtype">void</span> valueChanged (<span class="keywordtype">double</span> value);
00135 
00136 protected:
00137     virtual <span class="keywordtype">void</span> rangeChange();
00138     virtual <span class="keywordtype">void</span> fontChange(const QFont &amp;f);
00139 
00140 private slots:
00141     <span class="keywordtype">void</span> btnReleased();
00142     <span class="keywordtype">void</span> btnClicked();
00143 
00144 private:
00145     <span class="keywordtype">void</span> updateButtons();
00146     <span class="keywordtype">void</span> showNum(<span class="keywordtype">double</span>);
00147     virtual <span class="keywordtype">void</span> valueChange();
00148 
00149     <a class="code" href="class_qwt_arrow_button.html">QwtArrowButton</a> *d_buttonDown[ButtonCnt];
00150     <a class="code" href="class_qwt_arrow_button.html">QwtArrowButton</a> *d_buttonUp[ButtonCnt];
00151     QLineEdit *d_valueEdit;
00152 
00153     <span class="keywordtype">int</span> d_increment[ButtonCnt];
00154     <span class="keywordtype">int</span> d_nButtons;
00155 
00156     <span class="keywordtype">bool</span> d_blockKeys;
00157     <span class="keywordtype">bool</span> d_keyPressed;
00158 };
00159 
00160 #endif
</div></pre><hr size="1"><address style="align: right;"><small>Generated on Tue Nov 16 21:12:20 2004 for Qwt User's Guide by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.8 </small></address>
</body>
</html>