summaryrefslogtreecommitdiffstats
path: root/kteatime/timeedit.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitae2a03c2941bf92573f89b88ef73f8aa842bea0a (patch)
tree3566563f3fb6ac3cb3496669d8f233062d3091bc /kteatime/timeedit.h
downloadtdetoys-ae2a03c2941bf92573f89b88ef73f8aa842bea0a.tar.gz
tdetoys-ae2a03c2941bf92573f89b88ef73f8aa842bea0a.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdetoys@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kteatime/timeedit.h')
-rw-r--r--kteatime/timeedit.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/kteatime/timeedit.h b/kteatime/timeedit.h
new file mode 100644
index 0000000..cc03f58
--- /dev/null
+++ b/kteatime/timeedit.h
@@ -0,0 +1,72 @@
+/* -------------------------------------------------------------
+
+ timeedit.h
+
+ (C) 2003 by Daniel Teske (teske@bigfoot.com)
+
+ ------------------------------------------------------------- */
+#ifndef TIMEEDIT_H
+#define TIMEEDIT_H
+
+#include <qspinbox.h>
+#include <qwidget.h>
+
+class QBoxLayout;
+
+
+/**
+ * @short A spinbox that wraps around after reaching minValue resp. maxValue.
+ * @author Daniel Teske
+ */
+class WrappingSpinBox : public QSpinBox
+{
+ Q_OBJECT
+
+public:
+ WrappingSpinBox(int minValue, int maxValue, int step = 1, QWidget *parent=0, const char *name=0);
+ ~WrappingSpinBox();
+
+ void stepUp();
+ void stepDown();
+
+signals:
+ void wrapUp();
+ void wrapDown();
+};
+
+
+/**
+ * @short A widget for entering a timeout in minutes and seconds.
+ * @author Daniel Teske
+ */
+class TimeEdit : public QWidget
+{
+ Q_OBJECT
+
+public:
+ TimeEdit(QWidget* parent = 0, const char* name = 0);
+ ~TimeEdit();
+
+ void setValue(int value);
+ int value();
+
+public slots:
+ void setFocus();
+
+private slots:
+ void spinBoxValueChanged(int);
+ void wrappedUp();
+ void wrappedDown();
+
+signals:
+ void valueChanged(int);
+
+
+protected:
+ QSpinBox *minuteBox;
+ WrappingSpinBox *secondBox;
+ QBoxLayout* layout;
+};
+
+#endif
+