author | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
commit | 15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff) | |
tree | c2fa0399a2c47fda8e2cd0092c73a809d17f68eb /inputmethods/pickboard/pickboard.cpp | |
download | opie-15318cad33835e4e2dc620d033e43cd930676cdd.zip opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2 |
Initial revision
Diffstat (limited to 'inputmethods/pickboard/pickboard.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | inputmethods/pickboard/pickboard.cpp | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/inputmethods/pickboard/pickboard.cpp b/inputmethods/pickboard/pickboard.cpp new file mode 100644 index 0000000..087144e --- a/dev/null +++ b/inputmethods/pickboard/pickboard.cpp | |||
@@ -0,0 +1,89 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | #include "pickboard.h" | ||
21 | #include "pickboardpicks.h" | ||
22 | #include "pickboardcfg.h" | ||
23 | |||
24 | #include <qpe/global.h> | ||
25 | |||
26 | #include <qpainter.h> | ||
27 | #include <qlist.h> | ||
28 | #include <qbitmap.h> | ||
29 | #include <qlayout.h> | ||
30 | #include <qvbox.h> | ||
31 | #include <qdialog.h> | ||
32 | #include <qscrollview.h> | ||
33 | #include <qpopupmenu.h> | ||
34 | #include <qhbuttongroup.h> | ||
35 | #include <qpushbutton.h> | ||
36 | #include <qmessagebox.h> | ||
37 | #include <qwindowsystem_qws.h> | ||
38 | |||
39 | /* XPM */ | ||
40 | static const char * const menu_xpm[]={ | ||
41 | "9 9 2 1", | ||
42 | "a c #000000", | ||
43 | ". c None", | ||
44 | ".........", | ||
45 | ".........", | ||
46 | ".........", | ||
47 | "....a....", | ||
48 | "...aaa...", | ||
49 | "..aaaaa..", | ||
50 | ".aaaaaaa.", | ||
51 | ".........", | ||
52 | "........."}; | ||
53 | |||
54 | class PickboardPrivate { | ||
55 | public: | ||
56 | PickboardPrivate(Pickboard* parent) | ||
57 | { | ||
58 | picks = new PickboardPicks(parent); | ||
59 | picks->initialise(); | ||
60 | menu = new QPushButton(parent); | ||
61 | menu->setSizePolicy(QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Expanding)); | ||
62 | menu->setPixmap(QPixmap((const char **)menu_xpm)); | ||
63 | QObject::connect(menu,SIGNAL(clicked()),picks,SLOT(doMenu())); | ||
64 | QObject::connect(picks,SIGNAL(key(ushort,ushort,ushort,bool,bool)), | ||
65 | parent,SIGNAL(key(ushort,ushort,ushort,bool,bool))); | ||
66 | } | ||
67 | |||
68 | PickboardPicks* picks; | ||
69 | QPushButton* menu; | ||
70 | }; | ||
71 | |||
72 | Pickboard::Pickboard(QWidget* parent, const char* name, WFlags f) : | ||
73 | QFrame(parent,name,f) | ||
74 | { | ||
75 | (new QHBoxLayout(this))->setAutoAdd(TRUE); | ||
76 | d = new PickboardPrivate(this); | ||
77 | setFont( QFont( "smallsmooth", 9 ) ); | ||
78 | } | ||
79 | |||
80 | Pickboard::~Pickboard() | ||
81 | { | ||
82 | delete d; | ||
83 | } | ||
84 | |||
85 | void Pickboard::resetState() | ||
86 | { | ||
87 | d->picks->resetState(); | ||
88 | } | ||
89 | |||