summaryrefslogtreecommitdiff
path: root/noncore/apps/tinykate/mainwindow/cgotoline.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/tinykate/mainwindow/cgotoline.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tinykate/mainwindow/cgotoline.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/noncore/apps/tinykate/mainwindow/cgotoline.cpp b/noncore/apps/tinykate/mainwindow/cgotoline.cpp
new file mode 100644
index 0000000..97f2ea5
--- a/dev/null
+++ b/noncore/apps/tinykate/mainwindow/cgotoline.cpp
@@ -0,0 +1,23 @@
+#include "cgotoline.h"
+#include <qspinbox.h>
+// copyright 2003 Craig Graham <cgraham@accessdevices.co.uk>
+
+CGotoLine::CGotoLine(int l) : CGotoBase(0,0,true)
+{
+ mLine->setValue(l+1);
+}
+
+int CGotoLine::line()
+{
+ return mLine->value()-1;
+}
+
+void CGotoLine::keyPressEvent(QKeyEvent *e)
+{
+ if((e->key()==Key_Return)||(e->key()==Key_Enter))
+ {
+ accept();
+ }else{
+ QDialog::keyPressEvent(e);
+ }
+}