summaryrefslogtreecommitdiff
path: root/inputmethods/pickboard
Unidiff
Diffstat (limited to 'inputmethods/pickboard') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/pickboard/pickboard.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/inputmethods/pickboard/pickboard.cpp b/inputmethods/pickboard/pickboard.cpp
index 1611cb0..e5365ba 100644
--- a/inputmethods/pickboard/pickboard.cpp
+++ b/inputmethods/pickboard/pickboard.cpp
@@ -1,110 +1,115 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 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 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 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include "pickboard.h" 20#include "pickboard.h"
21#include "pickboardpicks.h" 21#include "pickboardpicks.h"
22#include "pickboardcfg.h" 22#include "pickboardcfg.h"
23 23
24#include <qpe/global.h> 24#include <qpe/global.h>
25 25#include <qpe/config.h>
26#include <qpainter.h> 26#include <qpainter.h>
27#include <qlist.h> 27#include <qlist.h>
28#include <qbitmap.h> 28#include <qbitmap.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qvbox.h> 30#include <qvbox.h>
31#include <qdialog.h> 31#include <qdialog.h>
32#include <qscrollview.h> 32#include <qscrollview.h>
33#include <qpopupmenu.h> 33#include <qpopupmenu.h>
34#include <qhbuttongroup.h> 34#include <qhbuttongroup.h>
35#include <qpushbutton.h> 35#include <qpushbutton.h>
36#include <qmessagebox.h> 36#include <qmessagebox.h>
37#ifdef QWS 37#ifdef QWS
38#include <qwindowsystem_qws.h> 38#include <qwindowsystem_qws.h>
39#endif 39#endif
40 40
41/*! \class Pickboard 41/*! \class Pickboard
42 \brief The Pickboard class provides an input method 42 \brief The Pickboard class provides an input method
43 based on a virtual keyboard combined with word-completion. 43 based on a virtual keyboard combined with word-completion.
44 44
45 This version of Pickboard is Dual Licensed Software. However, for you to be 45 This version of Pickboard is Dual Licensed Software. However, for you to be
46 able to license the technology to others, you may require a T9(R) Text 46 able to license the technology to others, you may require a T9(R) Text
47 Input license from Tegic Communications Corporation. More information can 47 Input license from Tegic Communications Corporation. More information can
48 be found at http://www.t9.com/. 48 be found at http://www.t9.com/.
49 49
50 \legalese 50 \legalese
51 This version of Pickboard is Dual Licensed Software. However, for you to be 51 This version of Pickboard is Dual Licensed Software. However, for you to be
52 able to license the technology to others, you may require a T9(R) Text 52 able to license the technology to others, you may require a T9(R) Text
53 Input license from Tegic Communications Corporation. More information can 53 Input license from Tegic Communications Corporation. More information can
54 be found at http://www.t9.com/. 54 be found at http://www.t9.com/.
55*/ 55*/
56 56
57/* XPM */ 57/* XPM */
58static const char * const menu_xpm[]={ 58static const char * const menu_xpm[]={
59"9 9 2 1", 59"9 9 2 1",
60"a c #000000", 60"a c #000000",
61". c None", 61". c None",
62".........", 62".........",
63".........", 63".........",
64".........", 64".........",
65"....a....", 65"....a....",
66"...aaa...", 66"...aaa...",
67"..aaaaa..", 67"..aaaaa..",
68".aaaaaaa.", 68".aaaaaaa.",
69".........", 69".........",
70"........."}; 70"........."};
71 71
72class PickboardPrivate { 72class PickboardPrivate {
73public: 73public:
74 PickboardPrivate(Pickboard* parent) 74 PickboardPrivate(Pickboard* parent)
75 { 75 {
76 picks = new PickboardPicks(parent); 76 picks = new PickboardPicks(parent);
77 picks->initialise(); 77 picks->initialise();
78 menu = new QPushButton(parent); 78 menu = new QPushButton(parent);
79 menu->setSizePolicy(QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Expanding)); 79 menu->setSizePolicy(QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Expanding));
80 menu->setPixmap(QPixmap((const char **)menu_xpm)); 80 menu->setPixmap(QPixmap((const char **)menu_xpm));
81 QObject::connect(menu,SIGNAL(clicked()),picks,SLOT(doMenu())); 81 QObject::connect(menu,SIGNAL(clicked()),picks,SLOT(doMenu()));
82 QObject::connect(picks,SIGNAL(key(ushort,ushort,ushort,bool,bool)), 82 QObject::connect(picks,SIGNAL(key(ushort,ushort,ushort,bool,bool)),
83 parent,SIGNAL(key(ushort,ushort,ushort,bool,bool))); 83 parent,SIGNAL(key(ushort,ushort,ushort,bool,bool)));
84 } 84 }
85 85
86 PickboardPicks* picks; 86 PickboardPicks* picks;
87 QPushButton* menu; 87 QPushButton* menu;
88}; 88};
89 89
90Pickboard::Pickboard(QWidget* parent, const char* name, WFlags f) : 90Pickboard::Pickboard(QWidget* parent, const char* name, WFlags f) :
91 QFrame(parent,name,f) 91 QFrame(parent,name,f)
92{ 92{
93 (new QHBoxLayout(this))->setAutoAdd(TRUE); 93 (new QHBoxLayout(this))->setAutoAdd(TRUE);
94 d = new PickboardPrivate(this); 94 d = new PickboardPrivate(this);
95// under Win32 we may not have smallsmooth font 95
96#ifndef Q_OS_WIN32 96 // get the default font
97 setFont( QFont( "smallsmooth", 9 ) ); 97 Config *config = new Config( "qpe" );
98#endif 98 config->setGroup( "Appearance" );
99 QString familyStr = config->readEntry( "FontFamily", "smallsmooth" );
100 int fontSize = config->readNumEntry( "FontSize", 10 );
101 delete config;
102
103 setFont( QFont( familyStr, fontSize ) );
99} 104}
100 105
101Pickboard::~Pickboard() 106Pickboard::~Pickboard()
102{ 107{
103 delete d; 108 delete d;
104} 109}
105 110
106void Pickboard::resetState() 111void Pickboard::resetState()
107{ 112{
108 d->picks->resetState(); 113 d->picks->resetState();
109} 114}
110 115