kalarm/lib

slider.h
1/*
2 * slider.h - slider control with read-only option
3 * Program: kalarm
4 * Copyright © 2004,2006 by David Jarvie <software@astrojar.org.uk>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#ifndef SLIDER_H
22#define SLIDER_H
23
24#include <tqslider.h>
25
26
37class Slider : public TQSlider
38{
39 TQ_OBJECT
40
41 TQ_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
42 public:
47 explicit Slider(TQWidget* parent = 0, const char* name = 0);
53 explicit Slider(TQt::Orientation orient, TQWidget* parent = 0, const char* name = 0);
63 Slider(int minValue, int maxValue, int pageStep, int value, TQt::Orientation orient,
64 TQWidget* parent = 0, const char* name = 0);
66 bool isReadOnly() const { return mReadOnly; }
70 virtual void setReadOnly(bool readOnly);
71 protected:
72 virtual void mousePressEvent(TQMouseEvent*);
73 virtual void mouseReleaseEvent(TQMouseEvent*);
74 virtual void mouseMoveEvent(TQMouseEvent*);
75 virtual void keyPressEvent(TQKeyEvent*);
76 virtual void keyReleaseEvent(TQKeyEvent*);
77 private:
78 bool mReadOnly; // value cannot be changed by the user
79};
80
81#endif // SLIDER_H
A TQSlider with read-only option.
Definition: slider.h:38
virtual void setReadOnly(bool readOnly)
Sets whether the slider is read-only for the user.
Definition: slider.cpp:43
Slider(TQWidget *parent=0, const char *name=0)
Constructor.
Definition: slider.cpp:24
bool isReadOnly() const
Returns true if the slider is read only.
Definition: slider.h:66