summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/quick_button.cpp
authorharlekin <harlekin>2002-10-17 22:49:55 (UTC)
committer harlekin <harlekin>2002-10-17 22:49:55 (UTC)
commit51dbf76486cb81a7cb34c07483b344c8ea7a8a24 (patch) (side-by-side diff)
tree422713323f2631e6432cfe3e07e735206446e7fc /noncore/apps/opie-console/quick_button.cpp
parent943c09096f11827470b9cd3e311329ac422aaf20 (diff)
downloadopie-51dbf76486cb81a7cb34c07483b344c8ea7a8a24.zip
opie-51dbf76486cb81a7cb34c07483b344c8ea7a8a24.tar.gz
opie-51dbf76486cb81a7cb34c07483b344c8ea7a8a24.tar.bz2
buttonbar added
Diffstat (limited to 'noncore/apps/opie-console/quick_button.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/quick_button.cpp67
1 files changed, 67 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/quick_button.cpp b/noncore/apps/opie-console/quick_button.cpp
new file mode 100644
index 0000000..09df901
--- a/dev/null
+++ b/noncore/apps/opie-console/quick_button.cpp
@@ -0,0 +1,67 @@
+#include <qevent.h>
+#include <qapplication.h>
+#include <qaction.h>
+
+#include <qpe/resource.h>
+#include "quick_button.h"
+
+QuickButton::QuickButton(QWidget *parent) : QFrame(parent) {
+
+ QAction *a;
+
+ // Button Commands
+ a = new QAction( tr("Enter"), Resource::loadPixmap( "console/enter" ), QString::null, 0, this, 0 );
+ connect( a, SIGNAL( activated() ), this, SLOT( hitEnter() ) );
+ a->addTo( parent );
+ a = new QAction( tr("Space"), Resource::loadPixmap( "console/space" ), QString::null, 0, this, 0 );
+ connect( a, SIGNAL( activated() ), this, SLOT( hitSpace() ) );
+ a->addTo( parent );
+ a = new QAction( tr("Tab"), Resource::loadPixmap( "console/tab" ), QString::null, 0, this, 0 );
+ connect( a, SIGNAL( activated() ), this, SLOT( hitTab() ) );
+ a->addTo( parent );
+ a = new QAction( tr("Up"), Resource::loadPixmap( "console/up" ), QString::null, 0, this, 0 );
+ connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) );
+ a->addTo( parent );
+ a = new QAction( tr("Down"), Resource::loadPixmap( "console/down" ), QString::null, 0, this, 0 );
+ connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) );
+ a->addTo( parent );
+ a = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 );
+ connect( a, SIGNAL( activated() ), this, SLOT( hitPaste() ) );
+ a->addTo( parent );
+
+
+}
+
+QuickButton::~QuickButton() {
+}
+
+
+void QuickButton::hitEnter() {
+ emit keyPressed( QKeyEvent::KeyPress, Qt::Key_Enter, 0, 1, 0);
+}
+
+void QuickButton::hitSpace() {
+ emit keyPressed( QKeyEvent::KeyPress, Qt::Key_Space, 0, 1, 0);
+}
+
+void QuickButton::hitTab() {
+ emit keyPressed( QKeyEvent::KeyPress, Qt::Key_Tab, 0, 1, 0);
+}
+
+void QuickButton::hitPaste() {
+ /*
+ TEWidget* te = getTe();
+ if (te != 0) {
+ te->pasteClipboard();
+ }
+ */
+}
+
+void QuickButton::hitUp() {
+ emit keyPressed( QKeyEvent::KeyPress, Qt::Key_Up, 0, 1, 0);
+}
+
+void QuickButton::hitDown() {
+ emit keyPressed( QKeyEvent::KeyPress, Qt::Key_Down, 0, 1, 0);
+}
+