Index: /trunk/FACT++/gui/SpinBoxHex.h
===================================================================
--- /trunk/FACT++/gui/SpinBoxHex.h	(revision 10605)
+++ /trunk/FACT++/gui/SpinBoxHex.h	(revision 10605)
@@ -0,0 +1,38 @@
+#ifndef FACT_SpinBoxHex
+#define FACT_SpinBoxHex
+
+#include <QtGui/QSpinBox>
+
+
+class QRegExpValidator;
+
+class SpinBoxHex : public QSpinBox
+{
+public:
+    SpinBoxHex(QWidget *p=0) : QSpinBox(p)
+    {
+    }
+
+protected:
+    QValidator::State validate(QString &txt, int &/*pos*/) const
+    {
+        bool ok;
+        txt.toInt(&ok, 16);
+
+        return ok ? QValidator::Acceptable : QValidator::Invalid;
+    }
+
+    QString textFromValue(int val) const
+    {
+        return QString::number(val, 16).toLower();
+    }
+
+    int valueFromText(const QString &txt) const
+    {
+        bool ok;
+        return txt.toInt(&ok, 16);
+    }
+};
+
+#endif
+
