author | harlekin <harlekin> | 2002-10-17 22:49:55 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-17 22:49:55 (UTC) |
commit | 51dbf76486cb81a7cb34c07483b344c8ea7a8a24 (patch) (unidiff) | |
tree | 422713323f2631e6432cfe3e07e735206446e7fc /noncore/apps/opie-console/quick_button.cpp | |
parent | 943c09096f11827470b9cd3e311329ac422aaf20 (diff) | |
download | opie-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.cpp | 67 |
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 @@ | |||
1 | #include <qevent.h> | ||
2 | #include <qapplication.h> | ||
3 | #include <qaction.h> | ||
4 | |||
5 | #include <qpe/resource.h> | ||
6 | #include "quick_button.h" | ||
7 | |||
8 | QuickButton::QuickButton(QWidget *parent) : QFrame(parent) { | ||
9 | |||
10 | QAction *a; | ||
11 | |||
12 | // Button Commands | ||
13 | a = new QAction( tr("Enter"), Resource::loadPixmap( "console/enter" ), QString::null, 0, this, 0 ); | ||
14 | connect( a, SIGNAL( activated() ), this, SLOT( hitEnter() ) ); | ||
15 | a->addTo( parent ); | ||
16 | a = new QAction( tr("Space"), Resource::loadPixmap( "console/space" ), QString::null, 0, this, 0 ); | ||
17 | connect( a, SIGNAL( activated() ), this, SLOT( hitSpace() ) ); | ||
18 | a->addTo( parent ); | ||
19 | a = new QAction( tr("Tab"), Resource::loadPixmap( "console/tab" ), QString::null, 0, this, 0 ); | ||
20 | connect( a, SIGNAL( activated() ), this, SLOT( hitTab() ) ); | ||
21 | a->addTo( parent ); | ||
22 | a = new QAction( tr("Up"), Resource::loadPixmap( "console/up" ), QString::null, 0, this, 0 ); | ||
23 | connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); | ||
24 | a->addTo( parent ); | ||
25 | a = new QAction( tr("Down"), Resource::loadPixmap( "console/down" ), QString::null, 0, this, 0 ); | ||
26 | connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); | ||
27 | a->addTo( parent ); | ||
28 | a = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 ); | ||
29 | connect( a, SIGNAL( activated() ), this, SLOT( hitPaste() ) ); | ||
30 | a->addTo( parent ); | ||
31 | |||
32 | |||
33 | } | ||
34 | |||
35 | QuickButton::~QuickButton() { | ||
36 | } | ||
37 | |||
38 | |||
39 | void QuickButton::hitEnter() { | ||
40 | emit keyPressed( QKeyEvent::KeyPress, Qt::Key_Enter, 0, 1, 0); | ||
41 | } | ||
42 | |||
43 | void QuickButton::hitSpace() { | ||
44 | emit keyPressed( QKeyEvent::KeyPress, Qt::Key_Space, 0, 1, 0); | ||
45 | } | ||
46 | |||
47 | void QuickButton::hitTab() { | ||
48 | emit keyPressed( QKeyEvent::KeyPress, Qt::Key_Tab, 0, 1, 0); | ||
49 | } | ||
50 | |||
51 | void QuickButton::hitPaste() { | ||
52 | /* | ||
53 | TEWidget* te = getTe(); | ||
54 | if (te != 0) { | ||
55 | te->pasteClipboard(); | ||
56 | } | ||
57 | */ | ||
58 | } | ||
59 | |||
60 | void QuickButton::hitUp() { | ||
61 | emit keyPressed( QKeyEvent::KeyPress, Qt::Key_Up, 0, 1, 0); | ||
62 | } | ||
63 | |||
64 | void QuickButton::hitDown() { | ||
65 | emit keyPressed( QKeyEvent::KeyPress, Qt::Key_Down, 0, 1, 0); | ||
66 | } | ||
67 | |||