chalk

kis_double_widget.h
1/*
2 * kis_double_widget.h - part of Chalk
3 *
4 * Copyright (c) 1999 Carsten Pfeiffer <pfeiffer@kde.org>
5 * Copyright (c) 2004 Adrian Page <adrian@pagenet.plus.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 */
21
22#ifndef KIS_DOUBLE_WIDGET_H
23#define KIS_DOUBLE_WIDGET_H
24
25#include <tqwidget.h>
26#include <tqslider.h>
27
28class TQHBoxLayout;
29class KDoubleSpinBox;
30
31class KisDoubleWidget : public TQWidget
32{
33 TQ_OBJECT
34
35
36 typedef TQWidget super;
37public:
38 KisDoubleWidget(TQWidget* parent = 0, const char* name = 0);
39 KisDoubleWidget(double min, double max, TQWidget* parent = 0, const char* name = 0);
40 ~KisDoubleWidget();
41
42 double value() const;
43 void setRange(double min, double max);
44
45 void setTickmarks(TQSlider::TickSetting tickMarks);
46 void setTickInterval(double tickInterval);
47 double tickInterval() const;
48
49 void setPrecision(int precision);
50 void setLineStep(double step);
51 void setPageStep(double step);
52
53 void setTracking(bool tracking);
54 bool tracking() const;
55
56signals:
57 void valueChanged(double);
58 void sliderPressed();
59 void sliderReleased();
60
61public slots:
62 void setValue(double value);
63
64protected slots:
65 void setSliderValue(double);
66 void sliderValueChanged(int);
67
68private:
69 void init(double min, double max);
70
71protected:
72 TQHBoxLayout* m_layout;
73 TQSlider* m_slider;
74 KDoubleSpinBox *m_spinBox;
75};
76
77#endif // KIS_DOUBLE_WIDGET_H
78