1
/***************************************************************************
2
kpoti.h - Potentiometer Widget
4
begin : Wed Apr 28 23:05:05 MEST 1999
6
copyright : (C) 1999 by Martin Lorenz
7
email : lorenz@ch.tum.de
8
***************************************************************************/
10
/***************************************************************************
12
* This program is free software; you can redistribute it and/or modify *
13
* it under the terms of the GNU General Public License as published by *
14
* the Free Software Foundation; either version 2 of the License, or *
15
* (at your option) any later version. *
17
***************************************************************************/
30
class KPoti : public QWidget, public QRangeControl
35
KPoti( QWidget *parent=0, const char *name=0 );
36
KPoti( int minValue, int maxValue, int step, int value,
37
QWidget *parent=0, const char *name=0 );
39
void setTracking( bool enable );
40
bool tracking() const;
42
void setPalette( const QPalette & );
43
void setColor( const QColor & );
45
virtual void setTickmarks( bool );
46
virtual void setLabel( bool );
47
bool tickmarks() const { return ticks; }
49
virtual void setTickInterval( int );
50
int tickInterval() const { return tickInt; }
58
void valueChanged( int value );
60
void potiMoved( int value );
62
void mouseEntered(int value);
65
void resizeEvent( QResizeEvent * );
66
void paintEvent( QPaintEvent * );
68
void keyPressEvent( QKeyEvent * );
70
void mousePressEvent( QMouseEvent * );
71
void mouseReleaseEvent( QMouseEvent * );
72
void mouseMoveEvent( QMouseEvent * );
73
void enterEvent( QEvent *);
75
void focusInEvent( QFocusEvent *e );
80
virtual void paintPoti( QPainter * );
81
void drawButton( QPainter *);
82
void drawTicks( QPainter *, int, int, int=1 ) const;
84
virtual void wheelEvent(QWheelEvent *e);
89
enum State { Idle, Dragging, TimingUp, TimingDown };
91
void init(int value=0);
92
float positionFromValue( int ) const;
93
int valueFromPosition( float ) const;
94
void movePoti( float );
95
void reallyMovePoti( float );
97
int potiRadius() const;
108
int tickInt, space, buttonRadius, fontHeight;
110
private: // Disabled copy constructor and operator=
111
// KPoti( const KPoti & ) {}
112
//KPoti &operator=( const KPoti & ) { return *this; }
115
inline bool KPoti::tracking() const