File: qwt__slider_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 (117 lines) | stat: -rw-r--r-- 8,456 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
<!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_slider.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_slider.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_SLIDER_H</span>
00013 <span class="preprocessor"></span><span class="preprocessor">#define QWT_SLIDER_H</span>
00014 <span class="preprocessor"></span>
00015 <span class="preprocessor">#include "qwt_global.h"</span>
00016 <span class="preprocessor">#include "qwt_sclif.h"</span>
00017 <span class="preprocessor">#include "qwt_sldbase.h"</span>
00018 
<a name="l00029"></a><a class="code" href="class_qwt_slider.html">00029</a> <span class="keyword">class </span>QWT_EXPORT QwtSlider : <span class="keyword">public</span> <a class="code" href="class_qwt_slider_base.html">QwtSliderBase</a>, <span class="keyword">public</span> <a class="code" href="class_qwt_scale_if.html">QwtScaleIf</a>
00030 {
00031     Q_OBJECT
00032     Q_ENUMS( ScalePos )
00033     Q_ENUMS( BGSTYLE )
00034     Q_PROPERTY( ScalePos scalePosition READ scalePosition
00035     WRITE setScalePosition )
00036     Q_PROPERTY( BGSTYLE bgStyle READ bgStyle WRITE setBgStyle )
00037     Q_PROPERTY( <span class="keywordtype">int</span> thumbLength READ thumbLength WRITE setThumbLength )
00038     Q_PROPERTY( <span class="keywordtype">int</span> thumbWidth READ thumbWidth WRITE setThumbWidth )
00039     Q_PROPERTY( <span class="keywordtype">int</span> borderWidth READ borderWidth WRITE setBorderWidth )
00040  
00041 <span class="keyword">public</span>:
00042 
<a name="l00051"></a><a class="code" href="class_qwt_slider.html#w8">00051</a>     <span class="keyword">enum</span> ScalePos { None, Left, Right, Top, Bottom };
00052 
<a name="l00057"></a><a class="code" href="class_qwt_slider.html#w9">00057</a>     <span class="keyword">enum</span> BGSTYLE { BgTrough = 0x1, BgSlot = 0x2, BgBoth = BgTrough | BgSlot};
00058 
00059     QwtSlider(QWidget *parent, <span class="keyword">const</span> <span class="keywordtype">char</span> *name = 0,
00060           Qt::Orientation = Qt::Horizontal,
00061           ScalePos = None, BGSTYLE bgStyle = BgTrough);
00062     
00063     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_qwt_slider_base.html#a7">setOrientation</a>(Qt::Orientation); 
00064 
<a name="l00068"></a><a class="code" href="class_qwt_slider.html#a2">00068</a>     <span class="keywordtype">void</span> setBgStyle(BGSTYLE st) {d_bgStyle = st; layoutSlider();}
<a name="l00072"></a><a class="code" href="class_qwt_slider.html#a3">00072</a>     BGSTYLE bgStyle()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> d_bgStyle; }
00073     
<a name="l00077"></a><a class="code" href="class_qwt_slider.html#a4">00077</a>     <span class="keywordtype">void</span> setScalePos(ScalePos s) { setScalePosition(s); }
<a name="l00081"></a><a class="code" href="class_qwt_slider.html#a5">00081</a>     ScalePos scalePos()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> d_scalePos; }
00082 
00083     <span class="keywordtype">void</span> setScalePosition(ScalePos s);
00084     ScalePos scalePosition() const;
00085 
<a name="l00089"></a><a class="code" href="class_qwt_slider.html#a8">00089</a>     <span class="keywordtype">int</span> thumbLength()<span class="keyword"> const </span>{<span class="keywordflow">return</span> d_thumbLength;}
<a name="l00093"></a><a class="code" href="class_qwt_slider.html#a9">00093</a>     <span class="keywordtype">int</span> thumbWidth()<span class="keyword"> const </span>{<span class="keywordflow">return</span> d_thumbWidth;}
<a name="l00097"></a><a class="code" href="class_qwt_slider.html#a10">00097</a>     <span class="keywordtype">int</span> borderWidth()<span class="keyword"> const </span>{<span class="keywordflow">return</span> d_borderWidth;}
00098 
00099     <span class="keywordtype">void</span> setThumbLength(<span class="keywordtype">int</span> l);
00100     <span class="keywordtype">void</span> setThumbWidth(<span class="keywordtype">int</span> w);
00101     <span class="keywordtype">void</span> setBorderWidth(<span class="keywordtype">int</span> bw);
00102     <span class="keywordtype">void</span> setMargins(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y);
00103 
00104     <span class="keyword">virtual</span> QSize sizeHint() const;
00105     virtual QSize minimumSizeHint() const;
00106     virtual QSizePolicy sizePolicy() const;
00107     
00108 protected:
00109     virtual <span class="keywordtype">double</span> getValue(const QPoint &amp;p);
00110     virtual <span class="keywordtype">void</span> getScrollMode(const QPoint &amp;p, 
00111         <span class="keywordtype">int</span> &amp;scrollMode, <span class="keywordtype">int</span> &amp;direction);
00112 
00113     <span class="keywordtype">void</span> draw(QPainter *p, const QRect&amp; update_rect);
00114     virtual <span class="keywordtype">void</span> drawSlider (QPainter *p, const QRect &amp;r);
00115     virtual <span class="keywordtype">void</span> drawThumb(QPainter *p, const QRect &amp;, <span class="keywordtype">int</span> pos);
00116 
00117     virtual <span class="keywordtype">void</span> resizeEvent(QResizeEvent *e);
00118     virtual <span class="keywordtype">void</span> paintEvent (QPaintEvent *e);
00119 
00120     virtual <span class="keywordtype">void</span> valueChange();
00121     virtual <span class="keywordtype">void</span> rangeChange();
00122     virtual <span class="keywordtype">void</span> scaleChange();
00123     virtual <span class="keywordtype">void</span> fontChange(const QFont &amp;oldFont);
00124 
00125     <span class="keywordtype">void</span> layoutSlider( <span class="keywordtype">bool</span> update = TRUE );
00126     <span class="keywordtype">int</span> xyPosition(<span class="keywordtype">double</span> v) const;
00127 
00128 private:
00129     QRect d_sliderRect;
00130 
00131     <span class="keywordtype">int</span> d_thumbLength;
00132     <span class="keywordtype">int</span> d_thumbWidth;
00133     <span class="keywordtype">int</span> d_borderWidth;
00134     <span class="keywordtype">int</span> d_scaleDist;
00135     <span class="keywordtype">int</span> d_xMargin;
00136     <span class="keywordtype">int</span> d_yMargin;
00137     
00138     ScalePos d_scalePos;
00139     BGSTYLE d_bgStyle;
00140 };
00141 
00142 #endif
00143 
00144 <span class="comment">// Local Variables:</span>
00145 <span class="comment">// mode: C++</span>
00146 <span class="comment">// c-file-style: "stroustrup"</span>
00147 <span class="comment">// indent-tabs-mode: nil</span>
00148 <span class="comment">// End:</span>
</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>