File: qwt__sldbase_8cpp-source.html

package info (click to toggle)
libqwt 4.2.0-4.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 9,832 kB
  • ctags: 5,512
  • sloc: cpp: 22,973; ansic: 244; makefile: 66
file content (434 lines) | stat: -rw-r--r-- 25,722 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
<!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_sldbase.cpp 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_sldbase.cpp</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="preprocessor">#include &lt;qevent.h&gt;</span>
00011 <span class="preprocessor">#include "qwt_sldbase.h"</span>
00012 <span class="preprocessor">#include "<a class="code" href="qwt__math_8h.html">qwt_math.h</a>"</span>
00013 
00014 <span class="preprocessor">#ifndef WHEEL_DELTA</span>
00015 <span class="preprocessor"></span><span class="preprocessor">#define WHEEL_DELTA 120</span>
00016 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
00017 <span class="preprocessor"></span>
<a name="l00019"></a><a class="code" href="class_qwt_slider_base.html#a0">00019</a> <a class="code" href="class_qwt_slider_base.html#a0">QwtSliderBase::QwtSliderBase</a>(Qt::Orientation orient,
00020         QWidget *parent, <span class="keyword">const</span> <span class="keywordtype">char</span> *name, Qt::WFlags f): 
00021     QWidget(parent, name, f),
00022     d_scrollMode(ScrNone),
00023     d_orientation(orient),
00024     d_readOnly(FALSE)
00025 {
00026     d_tmrID = 0;
00027     d_updTime = 150;
00028     d_mass = 0.0;
00029     d_tracking = TRUE;
00030     d_mouseOffset = 0.0;
00031     <a class="code" href="class_qwt_dbl_range.html#a2">setRange</a>(0.0,100.0, 1.0);
00032     <a class="code" href="class_qwt_slider_base.html#i0">setValue</a>(0.0);
00033 
00034     setFocusPolicy(QWidget::TabFocus);
00035 }
00036 
<a name="l00038"></a><a class="code" href="class_qwt_slider_base.html#a1">00038</a> <a class="code" href="class_qwt_slider_base.html#a1">QwtSliderBase::~QwtSliderBase</a>()
00039 {
00040     <span class="keywordflow">if</span>(d_tmrID) 
00041         killTimer(d_tmrID);
00042 }
00043 
<a name="l00053"></a><a class="code" href="class_qwt_slider_base.html#i3">00053</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_slider_base.html#i3">QwtSliderBase::setReadOnly</a>(<span class="keywordtype">bool</span> readOnly)
00054 {
00055     d_readOnly = readOnly;
00056     update();
00057 }
00058 
<a name="l00066"></a><a class="code" href="class_qwt_slider_base.html#a9">00066</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_slider_base.html#a9">QwtSliderBase::isReadOnly</a>()<span class="keyword"> const</span>
00067 <span class="keyword"></span>{
00068     <span class="keywordflow">return</span> d_readOnly;
00069 }
00070 
<a name="l00076"></a><a class="code" href="class_qwt_slider_base.html#a7">00076</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_slider_base.html#a7">QwtSliderBase::setOrientation</a>(Orientation o)
00077 {
00078     d_orientation = o;
00079 }
00080 
<a name="l00085"></a><a class="code" href="class_qwt_slider_base.html#a8">00085</a> Qt::Orientation <a class="code" href="class_qwt_slider_base.html#a8">QwtSliderBase::orientation</a>()<span class="keyword"> const</span>
00086 <span class="keyword"></span>{
00087     <span class="keywordflow">return</span> d_orientation;
00088 }
00089 
00091 
<a name="l00092"></a><a class="code" href="class_qwt_slider_base.html#a3">00092</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_slider_base.html#a3">QwtSliderBase::stopMoving</a>() 
00093 {
00094     <span class="keywordflow">if</span>(d_tmrID)
00095     {
00096         killTimer(d_tmrID);
00097         d_tmrID = 0;
00098     }
00099 }
00100 
<a name="l00106"></a><a class="code" href="class_qwt_slider_base.html#a2">00106</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_slider_base.html#a2">QwtSliderBase::setUpdateTime</a>(<span class="keywordtype">int</span> t) 
00107 {
00108     <span class="keywordflow">if</span> (t &lt; 50) 
00109         t = 50;
00110     d_updTime = t;
00111 }
00112 
00113 
<a name="l00115"></a><a class="code" href="class_qwt_slider_base.html#b3">00115</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_slider_base.html#b3">QwtSliderBase::mousePressEvent</a>(QMouseEvent *e) 
00116 {
00117     <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_slider_base.html#a9">isReadOnly</a>() )
00118     {
00119 <span class="preprocessor">#if QT_VERSION &gt;= 300</span>
00120 <span class="preprocessor"></span>        e-&gt;ignore();
00121 <span class="preprocessor">#endif</span>
00122 <span class="preprocessor"></span>        <span class="keywordflow">return</span>;
00123     }
00124     <span class="keywordflow">if</span> ( !<a class="code" href="class_qwt_slider_base.html#a10">isValid</a>() )
00125         <span class="keywordflow">return</span>;
00126 
00127     <span class="keyword">const</span> QPoint &amp;p = e-&gt;pos();
00128 
00129     d_timerTick = 0;
00130 
00131     <a class="code" href="class_qwt_slider_base.html#b9">getScrollMode</a>(p, d_scrollMode, d_direction);
00132     <a class="code" href="class_qwt_slider_base.html#a3">stopMoving</a>();
00133     
00134     <span class="keywordflow">switch</span>(d_scrollMode)
00135     {
00136         <span class="keywordflow">case</span> ScrPage:
00137         <span class="keywordflow">case</span> ScrTimer:
00138             d_mouseOffset = 0;
00139             d_tmrID = startTimer(qwtMax(250, 2 * d_updTime));
00140             <span class="keywordflow">break</span>;
00141         
00142         <span class="keywordflow">case</span> ScrMouse:
00143             d_time.start();
00144             d_speed = 0;
00145             d_mouseOffset = <a class="code" href="class_qwt_slider_base.html#b8">getValue</a>(p) - <a class="code" href="class_qwt_dbl_range.html#a6">value</a>();
00146             emit <a class="code" href="class_qwt_slider_base.html#l1">sliderPressed</a>();
00147             <span class="keywordflow">break</span>;
00148         
00149         <span class="keywordflow">default</span>:
00150             d_mouseOffset = 0;
00151             d_direction = 0;
00152             <span class="keywordflow">break</span>;
00153     }
00154 }
00155 
00156 
00158 <span class="keywordtype">void</span> QwtSliderBase::buttonReleased()
00159 {
00160     <span class="keywordflow">if</span> ((!d_tracking) || (<a class="code" href="class_qwt_dbl_range.html#a6">value</a>() != <a class="code" href="class_qwt_dbl_range.html#b2">prevValue</a>()))
00161         emit <a class="code" href="class_qwt_slider_base.html#l0">valueChanged</a>(<a class="code" href="class_qwt_dbl_range.html#a6">value</a>());
00162 }
00163 
00164 
<a name="l00166"></a><a class="code" href="class_qwt_slider_base.html#b4">00166</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_slider_base.html#b4">QwtSliderBase::mouseReleaseEvent</a>(QMouseEvent *e)
00167 {
00168     <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_slider_base.html#a9">isReadOnly</a>() )
00169     {
00170 <span class="preprocessor">#if QT_VERSION &gt;= 300</span>
00171 <span class="preprocessor"></span>        e-&gt;ignore();
00172 <span class="preprocessor">#endif</span>
00173 <span class="preprocessor"></span>        <span class="keywordflow">return</span>;
00174     }
00175     <span class="keywordflow">if</span> ( !<a class="code" href="class_qwt_slider_base.html#a10">isValid</a>() )
00176         <span class="keywordflow">return</span>;
00177 
00178     <span class="keyword">const</span> <span class="keywordtype">double</span> inc = <a class="code" href="class_qwt_dbl_range.html#a10">step</a>();
00179     
00180     <span class="keywordflow">switch</span>(d_scrollMode) 
00181     {
00182         <span class="keywordflow">case</span> ScrMouse:
00183         {
00184             <a class="code" href="class_qwt_slider_base.html#b0">setPosition</a>(e-&gt;pos());
00185             d_direction = 0;
00186             d_mouseOffset = 0;
00187             <span class="keywordflow">if</span> (d_mass &gt; 0.0) 
00188             {
00189                 <span class="keyword">const</span> <span class="keywordtype">int</span> ms = d_time.elapsed();
00190                 <span class="keywordflow">if</span> ((fabs(d_speed) &gt;  0.0) &amp;&amp; (ms &lt; 50))
00191                     d_tmrID = startTimer(d_updTime);
00192             }
00193             <span class="keywordflow">else</span>
00194             {
00195                 d_scrollMode = ScrNone;
00196                 buttonReleased();
00197             }
00198             emit <a class="code" href="class_qwt_slider_base.html#l2">sliderReleased</a>();
00199             
00200             <span class="keywordflow">break</span>;
00201         }
00202 
00203         <span class="keywordflow">case</span> ScrDirect:
00204         {
00205             <a class="code" href="class_qwt_slider_base.html#b0">setPosition</a>(e-&gt;pos());
00206             d_direction = 0;
00207             d_mouseOffset = 0;
00208             d_scrollMode = ScrNone;
00209             buttonReleased();
00210             <span class="keywordflow">break</span>;
00211         }
00212 
00213         <span class="keywordflow">case</span> ScrPage:
00214         {
00215             <a class="code" href="class_qwt_slider_base.html#a3">stopMoving</a>();
00216             <span class="keywordflow">if</span> (!d_timerTick)
00217                 <a class="code" href="class_qwt_dbl_range.html#a15">QwtDblRange::incPages</a>(d_direction);
00218             d_timerTick = 0;
00219             buttonReleased();
00220             d_scrollMode = ScrNone;
00221             <span class="keywordflow">break</span>;
00222         }
00223 
00224         <span class="keywordflow">case</span> ScrTimer:
00225         {
00226             <a class="code" href="class_qwt_slider_base.html#a3">stopMoving</a>();
00227             <span class="keywordflow">if</span> (!d_timerTick)
00228                 <a class="code" href="class_qwt_dbl_range.html#a16">QwtDblRange::fitValue</a>(<a class="code" href="class_qwt_dbl_range.html#a6">value</a>() + <span class="keywordtype">double</span>(d_direction) * inc);
00229             d_timerTick = 0;
00230             buttonReleased();
00231             d_scrollMode = ScrNone;
00232             <span class="keywordflow">break</span>;
00233         }
00234 
00235         <span class="keywordflow">default</span>:
00236         {
00237             d_scrollMode = ScrNone;
00238             buttonReleased();
00239         }
00240     }
00241 }
00242 
00243 
<a name="l00248"></a><a class="code" href="class_qwt_slider_base.html#b0">00248</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_slider_base.html#b0">QwtSliderBase::setPosition</a>(<span class="keyword">const</span> QPoint &amp;p) 
00249 {
00250     <a class="code" href="class_qwt_dbl_range.html#a16">QwtDblRange::fitValue</a>(<a class="code" href="class_qwt_slider_base.html#b8">getValue</a>(p) - d_mouseOffset);
00251 }
00252 
00253 
<a name="l00268"></a><a class="code" href="class_qwt_slider_base.html#a4">00268</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_slider_base.html#a4">QwtSliderBase::setTracking</a>(<span class="keywordtype">bool</span> enable)
00269 {
00270     d_tracking = enable;
00271 }
00272 
<a name="l00274"></a><a class="code" href="class_qwt_slider_base.html#b5">00274</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_slider_base.html#b5">QwtSliderBase::mouseMoveEvent</a>(QMouseEvent *e)
00275 {
00276     <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_slider_base.html#a9">isReadOnly</a>() )
00277     {
00278 <span class="preprocessor">#if QT_VERSION &gt;= 300</span>
00279 <span class="preprocessor"></span>        e-&gt;ignore();
00280 <span class="preprocessor">#endif</span>
00281 <span class="preprocessor"></span>        <span class="keywordflow">return</span>;
00282     }
00283 
00284     <span class="keywordflow">if</span> ( !<a class="code" href="class_qwt_slider_base.html#a10">isValid</a>() )
00285         <span class="keywordflow">return</span>;
00286 
00287     <span class="keywordflow">if</span> (d_scrollMode == ScrMouse )
00288     {
00289         <a class="code" href="class_qwt_slider_base.html#b0">setPosition</a>(e-&gt;pos());
00290         <span class="keywordflow">if</span> (d_mass &gt; 0.0) 
00291         {
00292             <span class="keywordtype">double</span> ms = double(d_time.elapsed());
00293             <span class="keywordflow">if</span> (ms &lt; 1.0) 
00294                 ms = 1.0;
00295             d_speed = (<a class="code" href="class_qwt_dbl_range.html#b0">exactValue</a>() - <a class="code" href="class_qwt_dbl_range.html#b1">exactPrevValue</a>()) / ms;
00296             d_time.start();
00297         }
00298         <span class="keywordflow">if</span> (<a class="code" href="class_qwt_dbl_range.html#a6">value</a>() != <a class="code" href="class_qwt_dbl_range.html#b2">prevValue</a>())
00299             emit <a class="code" href="class_qwt_slider_base.html#l3">sliderMoved</a>(<a class="code" href="class_qwt_dbl_range.html#a6">value</a>());
00300     }
00301 }
00302 
<a name="l00304"></a><a class="code" href="class_qwt_slider_base.html#b7">00304</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_slider_base.html#b7">QwtSliderBase::wheelEvent</a>(QWheelEvent *e)
00305 {
00306     <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_slider_base.html#a9">isReadOnly</a>() )
00307     {
00308 <span class="preprocessor">#if QT_VERSION &gt;= 300</span>
00309 <span class="preprocessor"></span>        e-&gt;ignore();
00310 <span class="preprocessor">#endif</span>
00311 <span class="preprocessor"></span>        <span class="keywordflow">return</span>;
00312     }
00313 
00314     <span class="keywordflow">if</span> ( !<a class="code" href="class_qwt_slider_base.html#a10">isValid</a>() )
00315         <span class="keywordflow">return</span>;
00316 
00317     <span class="keywordtype">int</span> mode = ScrNone, direction = 0;
00318 
00319     <span class="comment">// Give derived classes a chance to say ScrNone</span>
00320     <a class="code" href="class_qwt_slider_base.html#b9">getScrollMode</a>(e-&gt;pos(), mode, direction);
00321     <span class="keywordflow">if</span> ( mode != ScrNone )
00322     {
00323         <span class="keyword">const</span> <span class="keywordtype">int</span> inc = e-&gt;delta() / WHEEL_DELTA;
00324         <a class="code" href="class_qwt_dbl_range.html#a15">QwtDblRange::incPages</a>(inc);
00325         <span class="keywordflow">if</span> (<a class="code" href="class_qwt_dbl_range.html#a6">value</a>() != <a class="code" href="class_qwt_dbl_range.html#b2">prevValue</a>())
00326             emit <a class="code" href="class_qwt_slider_base.html#l3">sliderMoved</a>(<a class="code" href="class_qwt_dbl_range.html#a6">value</a>());
00327     }
00328 }
00329 
<a name="l00341"></a><a class="code" href="class_qwt_slider_base.html#b6">00341</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_slider_base.html#b6">QwtSliderBase::keyPressEvent</a>(QKeyEvent *e)
00342 {
00343     <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_slider_base.html#a9">isReadOnly</a>() )
00344     {
00345 <span class="preprocessor">#if QT_VERSION &gt;= 300</span>
00346 <span class="preprocessor"></span>        e-&gt;ignore();
00347 <span class="preprocessor">#endif</span>
00348 <span class="preprocessor"></span>        <span class="keywordflow">return</span>;
00349     }
00350 
00351     <span class="keywordflow">if</span> ( !<a class="code" href="class_qwt_slider_base.html#a10">isValid</a>() )
00352         <span class="keywordflow">return</span>;
00353 
00354     <span class="keywordtype">int</span> increment = 0;
00355     <span class="keywordflow">switch</span> ( e-&gt;key() ) 
00356     {
00357         <span class="keywordflow">case</span> Qt::Key_Down:
00358             <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_slider_base.html#a8">orientation</a>() == Qt::Vertical )
00359                 increment = -1;
00360             <span class="keywordflow">break</span>;
00361         <span class="keywordflow">case</span> Qt::Key_Up:
00362             <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_slider_base.html#a8">orientation</a>() == Qt::Vertical )
00363                 increment = 1;
00364             <span class="keywordflow">break</span>;
00365         <span class="keywordflow">case</span> Qt::Key_Left:
00366             <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_slider_base.html#a8">orientation</a>() == Qt::Horizontal )
00367                 increment = -1;
00368             <span class="keywordflow">break</span>;
00369         <span class="keywordflow">case</span> Qt::Key_Right:
00370             <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_slider_base.html#a8">orientation</a>() == Qt::Horizontal )
00371                 increment = 1;
00372             <span class="keywordflow">break</span>;
00373         <span class="keywordflow">default</span>:;
00374 <span class="preprocessor">#if QT_VERSION &gt;= 300</span>
00375 <span class="preprocessor"></span>            e-&gt;ignore();
00376 <span class="preprocessor">#endif</span>
00377 <span class="preprocessor"></span>    }
00378 
00379     <span class="keywordflow">if</span> ( increment != 0 )
00380     {
00381         <a class="code" href="class_qwt_dbl_range.html#a14">QwtDblRange::incValue</a>(increment);
00382         <span class="keywordflow">if</span> (<a class="code" href="class_qwt_dbl_range.html#a6">value</a>() != <a class="code" href="class_qwt_dbl_range.html#b2">prevValue</a>())
00383             emit <a class="code" href="class_qwt_slider_base.html#l3">sliderMoved</a>(<a class="code" href="class_qwt_dbl_range.html#a6">value</a>());
00384     }
00385 }
00386 
<a name="l00388"></a><a class="code" href="class_qwt_slider_base.html#b2">00388</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_slider_base.html#b2">QwtSliderBase::timerEvent</a>(QTimerEvent *)
00389 {
00390     <span class="keyword">const</span> <span class="keywordtype">double</span> inc = <a class="code" href="class_qwt_dbl_range.html#a10">step</a>();
00391 
00392     <span class="keywordflow">switch</span> (d_scrollMode)
00393     {
00394         <span class="keywordflow">case</span> ScrMouse:
00395         {
00396             <span class="keywordflow">if</span> (d_mass &gt; 0.0)
00397             {
00398                 d_speed *= exp( - <span class="keywordtype">double</span>(d_updTime) * 0.001 / d_mass );
00399                 <span class="keyword">const</span> <span class="keywordtype">double</span> newval = 
00400                     <a class="code" href="class_qwt_dbl_range.html#b0">exactValue</a>() + d_speed * double(d_updTime);
00401                 <a class="code" href="class_qwt_dbl_range.html#a16">QwtDblRange::fitValue</a>(newval);
00402                 <span class="comment">// stop if d_speed &lt; one step per second</span>
00403                 <span class="keywordflow">if</span> (fabs(d_speed) &lt; 0.001 * fabs(<a class="code" href="class_qwt_dbl_range.html#a10">step</a>()))
00404                 {
00405                     d_speed = 0;
00406                     <a class="code" href="class_qwt_slider_base.html#a3">stopMoving</a>();
00407                     buttonReleased();
00408                 }
00409 
00410             }
00411             <span class="keywordflow">else</span>
00412                <a class="code" href="class_qwt_slider_base.html#a3">stopMoving</a>();
00413             <span class="keywordflow">break</span>;
00414         }
00415 
00416         <span class="keywordflow">case</span> ScrPage:
00417         {
00418             <a class="code" href="class_qwt_dbl_range.html#a15">QwtDblRange::incPages</a>(d_direction);
00419             <span class="keywordflow">if</span> (!d_timerTick) 
00420             {
00421                 killTimer(d_tmrID);
00422                 d_tmrID = startTimer(d_updTime);
00423             }
00424             <span class="keywordflow">break</span>;
00425         }
00426         <span class="keywordflow">case</span> ScrTimer:
00427         {
00428             <a class="code" href="class_qwt_dbl_range.html#a16">QwtDblRange::fitValue</a>(<a class="code" href="class_qwt_dbl_range.html#a6">value</a>() +  <span class="keywordtype">double</span>(d_direction) * inc);
00429             <span class="keywordflow">if</span> (!d_timerTick) 
00430             {
00431                 killTimer(d_tmrID);
00432                 d_tmrID = startTimer(d_updTime);
00433             }
00434             <span class="keywordflow">break</span>;
00435         }
00436         <span class="keywordflow">default</span>:
00437         {
00438             <a class="code" href="class_qwt_slider_base.html#a3">stopMoving</a>();
00439             <span class="keywordflow">break</span>;
00440         }
00441     }
00442 
00443     d_timerTick = 1;
00444 }
00445 
00446 
<a name="l00455"></a><a class="code" href="class_qwt_slider_base.html#b1">00455</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_slider_base.html#b1">QwtSliderBase::valueChange</a>() 
00456 {
00457     <span class="keywordflow">if</span> (d_tracking)
00458        emit <a class="code" href="class_qwt_slider_base.html#l0">valueChanged</a>(<a class="code" href="class_qwt_dbl_range.html#a6">value</a>());  
00459 }
00460 
<a name="l00478"></a><a class="code" href="class_qwt_slider_base.html#a5">00478</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_slider_base.html#a5">QwtSliderBase::setMass</a>(<span class="keywordtype">double</span> val)
00479 {
00480     <span class="keywordflow">if</span> (val &lt; 0.001)
00481        d_mass = 0.0;
00482     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (val &gt; 100.0)
00483        d_mass = 100.0;
00484     <span class="keywordflow">else</span>
00485        d_mass = val;
00486 }
00487 
<a name="l00492"></a><a class="code" href="class_qwt_slider_base.html#a6">00492</a> <span class="keywordtype">double</span> <a class="code" href="class_qwt_slider_base.html#a6">QwtSliderBase::mass</a>()<span class="keyword"> const</span>
00493 <span class="keyword"></span>{   
00494     <span class="keywordflow">return</span> d_mass; 
00495 }
00496 
00497 
<a name="l00506"></a><a class="code" href="class_qwt_slider_base.html#i0">00506</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_slider_base.html#i0">QwtSliderBase::setValue</a>(<span class="keywordtype">double</span> val)
00507 {
00508     <span class="keywordflow">if</span> (d_scrollMode == ScrMouse) 
00509         <a class="code" href="class_qwt_slider_base.html#a3">stopMoving</a>();
00510     <a class="code" href="class_qwt_dbl_range.html#a5">QwtDblRange::setValue</a>(val);
00511 }
00512 
00513 
<a name="l00519"></a><a class="code" href="class_qwt_slider_base.html#i1">00519</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_slider_base.html#i1">QwtSliderBase::fitValue</a>(<span class="keywordtype">double</span> val)
00520 {
00521     <span class="keywordflow">if</span> (d_scrollMode == ScrMouse) 
00522         <a class="code" href="class_qwt_slider_base.html#a3">stopMoving</a>();
00523     <a class="code" href="class_qwt_dbl_range.html#a16">QwtDblRange::fitValue</a>(val);
00524 }
00525 
00526 
<a name="l00531"></a><a class="code" href="class_qwt_slider_base.html#i2">00531</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_slider_base.html#i2">QwtSliderBase::incValue</a>(<span class="keywordtype">int</span> steps)
00532 {
00533     <span class="keywordflow">if</span> (d_scrollMode == ScrMouse) 
00534         <a class="code" href="class_qwt_slider_base.html#a3">stopMoving</a>();
00535     <a class="code" href="class_qwt_dbl_range.html#a14">QwtDblRange::incValue</a>(steps);
00536 }
</div></pre><hr size="1"><address style="align: right;"><small>Generated on Tue Nov 16 21:12:21 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>