karbon

vcolorslider.h
1/* This file is part of the KDE project
2 Made by Tomislav Lukman (tomislav.lukman@ck.tel.hr)
3 Copyright (C) 2002, The Karbon Developers
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21/* vcolorslider.h */
22#ifndef VCOLORSLIDER_H
23#define VCOLORSLIDER_H
24
25#include <tqwidget.h>
26
27class TQLabel;
28class KIntSpinBox;
29class KGradientSelector;
30
35class VColorSlider : public TQWidget
36{
37 TQ_OBJECT
38
39public:
46 VColorSlider( TQWidget* parent = 0L, const char* name = 0L );
47
60 VColorSlider( const TQString& label, const TQColor& col1, const TQColor& col2,
61 int min, int max, int value, TQWidget* parent = 0L, const char* name = 0L );
62
65
71 bool isDragging() { return m_isDragging; }
72public slots:
73
79 virtual void setLabel( const TQString& label );
80
87 virtual void setColors( const TQColor& color1, const TQColor& color2 );
88
94 virtual void setValue( int value );
95
101 virtual void setMinValue( int value );
102
108 virtual void setMaxValue( int value );
109
115 int value();
116
117private:
118 void init();
119 bool eventFilter( TQObject *obj, TQEvent *ev );
120 TQLabel* m_label;
121 KIntSpinBox* m_spinBox;
122 KGradientSelector* m_gradientSelect;
123 bool m_isDragging;
124 int m_minValue;
125 int m_maxValue;
126
127signals:
134 void valueChanged( int value );
135
136private slots:
137 void updateFrom_spinBox( int );
138 void updateFrom_gradientSelect( int );
139};
140
141#endif
142
virtual void setMinValue(int value)
Sets the minimum value of the spinbox and slider.
virtual void setValue(int value)
Sets the value of the spinbox (and the value of the vcolorslider).
bool isDragging()
Reflects if the slider is still being dragged while the color changes.
virtual void setMaxValue(int value)
Sets the maximum value of the spinbox and slider.
virtual void setColors(const TQColor &color1, const TQColor &color2)
Sets the colors for the slider.
virtual void setLabel(const TQString &label)
Sets the description of the slider.
VColorSlider(TQWidget *parent=0L, const char *name=0L)
Constructs a new color slider.
void valueChanged(int value)
Is emitted whenever the slider or spinbox value has changed.
int value()
Retrieves the actual value of the spinbox and slider.
~VColorSlider()
Destroys the color slider.