Diffstat (limited to 'inputmethods/pickboard/pickboardpicks.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | inputmethods/pickboard/pickboardpicks.cpp | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/inputmethods/pickboard/pickboardpicks.cpp b/inputmethods/pickboard/pickboardpicks.cpp index a80bbf8..b9d9928 100644 --- a/inputmethods/pickboard/pickboardpicks.cpp +++ b/inputmethods/pickboard/pickboardpicks.cpp | |||
@@ -1,84 +1,86 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of 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 "pickboardpicks.h" | 20 | #include "pickboardpicks.h" |
21 | #include "pickboardcfg.h" | 21 | #include "pickboardcfg.h" |
22 | 22 | ||
23 | #include <qpe/global.h> | 23 | #include <qpe/global.h> |
24 | 24 | ||
25 | #include <qpainter.h> | 25 | #include <qpainter.h> |
26 | #include <qlist.h> | 26 | #include <qlist.h> |
27 | #include <qbitmap.h> | 27 | #include <qbitmap.h> |
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #include <qvbox.h> | 29 | #include <qvbox.h> |
30 | #include <qdialog.h> | 30 | #include <qdialog.h> |
31 | #include <qscrollview.h> | 31 | #include <qscrollview.h> |
32 | #include <qpopupmenu.h> | 32 | #include <qpopupmenu.h> |
33 | #include <qhbuttongroup.h> | 33 | #include <qhbuttongroup.h> |
34 | #include <qpushbutton.h> | 34 | #include <qpushbutton.h> |
35 | #include <qmessagebox.h> | 35 | #include <qmessagebox.h> |
36 | #ifdef QWS | ||
36 | #include <qwindowsystem_qws.h> | 37 | #include <qwindowsystem_qws.h> |
38 | #endif | ||
37 | 39 | ||
38 | void PickboardPicks::doMenu() | 40 | void PickboardPicks::doMenu() |
39 | { | 41 | { |
40 | QWidget* cause = (QWidget*)sender(); // evil | 42 | QWidget* cause = (QWidget*)sender(); // evil |
41 | 43 | ||
42 | QPopupMenu popup(this); | 44 | QPopupMenu popup(this); |
43 | config()->fillMenu(popup); | 45 | config()->fillMenu(popup); |
44 | 46 | ||
45 | QPoint pos = cause->mapToGlobal(cause->rect().topRight()); | 47 | QPoint pos = cause->mapToGlobal(cause->rect().topRight()); |
46 | QSize sz = popup.sizeHint(); | 48 | QSize sz = popup.sizeHint(); |
47 | pos.ry() -= sz.height(); | 49 | pos.ry() -= sz.height(); |
48 | pos.rx() -= sz.width(); | 50 | pos.rx() -= sz.width(); |
49 | popup.move(pos); | 51 | popup.move(pos); |
50 | config()->doMenu(popup.exec()); | 52 | config()->doMenu(popup.exec()); |
51 | } | 53 | } |
52 | 54 | ||
53 | static const char *BS_xpm[] = { | 55 | static const char *BS_xpm[] = { |
54 | "5 7 2 1", | 56 | "5 7 2 1", |
55 | "a c #000000", | 57 | "a c #000000", |
56 | ". c None", | 58 | ". c None", |
57 | "...aa", | 59 | "...aa", |
58 | "..aaa", | 60 | "..aaa", |
59 | ".aaaa", | 61 | ".aaaa", |
60 | "aaaaa", | 62 | "aaaaa", |
61 | ".aaaa", | 63 | ".aaaa", |
62 | "..aaa", | 64 | "..aaa", |
63 | "...aa", | 65 | "...aa", |
64 | }; | 66 | }; |
65 | static const char *Del_xpm[] = { | 67 | static const char *Del_xpm[] = { |
66 | "14 7 2 1", | 68 | "14 7 2 1", |
67 | "a c #000000", | 69 | "a c #000000", |
68 | ". c None", | 70 | ". c None", |
69 | "aaa..aaaa.a...", | 71 | "aaa..aaaa.a...", |
70 | "a..a.a....a...", | 72 | "a..a.a....a...", |
71 | "a..a.a....a...", | 73 | "a..a.a....a...", |
72 | "a..a.aaa..a...", | 74 | "a..a.aaa..a...", |
73 | "a..a.a....a...", | 75 | "a..a.a....a...", |
74 | "a..a.a....a...", | 76 | "a..a.a....a...", |
75 | "aaa..aaaa.aaaa" | 77 | "aaa..aaaa.aaaa" |
76 | }; | 78 | }; |
77 | static const char *Home_xpm[] = { | 79 | static const char *Home_xpm[] = { |
78 | "20 7 2 1", | 80 | "20 7 2 1", |
79 | "a c #000000", | 81 | "a c #000000", |
80 | ". c None", | 82 | ". c None", |
81 | "a..a..aa..a...a.aaaa", | 83 | "a..a..aa..a...a.aaaa", |
82 | "a..a.a..a.aa.aa.a...", | 84 | "a..a.a..a.aa.aa.a...", |
83 | "a..a.a..a.a.a.a.a...", | 85 | "a..a.a..a.a.a.a.a...", |
84 | "aaaa.a..a.a.a.a.aaa.", | 86 | "aaaa.a..a.a.a.a.aaa.", |
@@ -203,120 +205,117 @@ static const char *Right_xpm[] = { | |||
203 | ".....a.", | 205 | ".....a.", |
204 | "aaaaaaa", | 206 | "aaaaaaa", |
205 | ".....a.", | 207 | ".....a.", |
206 | "....a..", | 208 | "....a..", |
207 | "...a..." | 209 | "...a..." |
208 | }; | 210 | }; |
209 | static const char *BackTab_xpm[] = { | 211 | static const char *BackTab_xpm[] = { |
210 | "8 7 2 1", | 212 | "8 7 2 1", |
211 | "a c #000000", | 213 | "a c #000000", |
212 | ". c None", | 214 | ". c None", |
213 | "a.......", | 215 | "a.......", |
214 | "a..a....", | 216 | "a..a....", |
215 | "a.aa....", | 217 | "a.aa....", |
216 | "aaaaaaaa", | 218 | "aaaaaaaa", |
217 | "a.aa....", | 219 | "a.aa....", |
218 | "a..a....", | 220 | "a..a....", |
219 | "a......." | 221 | "a......." |
220 | }; | 222 | }; |
221 | static const char *Tab_xpm[] = { | 223 | static const char *Tab_xpm[] = { |
222 | "8 7 2 1", | 224 | "8 7 2 1", |
223 | "a c #000000", | 225 | "a c #000000", |
224 | ". c None", | 226 | ". c None", |
225 | ".......a", | 227 | ".......a", |
226 | "....a..a", | 228 | "....a..a", |
227 | "....aa.a", | 229 | "....aa.a", |
228 | "aaaaaaaa", | 230 | "aaaaaaaa", |
229 | "....aa.a", | 231 | "....aa.a", |
230 | "....a..a", | 232 | "....a..a", |
231 | ".......a" | 233 | ".......a" |
232 | }; | 234 | }; |
233 | static const char *Space_xpm[] = { | 235 | static const char *Space_xpm[] = { |
234 | "9 9 2 1", | 236 | "9 9 2 1", |
235 | "a c #000000", | 237 | "a c #000000", |
236 | ". c None", | 238 | ". c None", |
237 | "aaaaaaaaa", | 239 | "aaaaaaaaa", |
238 | "a.......a", | 240 | "a.......a", |
239 | "a.......a", | 241 | "a.......a", |
240 | "a.......a", | 242 | "a.......a", |
241 | "a.......a", | 243 | "a.......a", |
242 | "a.......a", | 244 | "a.......a", |
243 | "a.......a", | 245 | "a.......a", |
244 | "a.......a", | 246 | "a.......a", |
245 | "aaaaaaaaa" | 247 | "aaaaaaaaa" |
246 | }; | 248 | }; |
247 | 249 | ||
248 | PickboardPicks::PickboardPicks(QWidget* parent, const char* name, WFlags f ) : | 250 | PickboardPicks::PickboardPicks(QWidget* parent, const char* name, WFlags f ) : |
249 | QFrame(parent,name,f) | 251 | QFrame(parent,name,f) |
250 | { | 252 | { |
253 | configs.setAutoDelete( TRUE ); | ||
251 | } | 254 | } |
252 | 255 | ||
253 | void PickboardPicks::initialise(void) | 256 | void PickboardPicks::initialise(void) |
254 | { | 257 | { |
255 | setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); | 258 | setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); |
256 | mode = 0; | 259 | mode = 0; |
257 | 260 | ||
258 | DictFilterConfig* dc = new DictFilterConfig(this); | 261 | DictFilterConfig* dc = new DictFilterConfig(this); |
259 | dc->addSet("ABC"); | 262 | QStringList sets_a = QStringList::split(' ',tr("ABC DEF GHI JKL MNO PQR STU VWX YZ-'")); |
260 | dc->addSet("DEF"); | 263 | QStringList sets = QStringList::split(' ', |
261 | dc->addSet("GHI"); | 264 | tr("ABC%/1iso8859-15 DEF%/1iso8859-15 GHI%/1iso8859-15 JKL MNO%/1iso8859-15 PQR%/1iso8859-15 STU%/1iso8859-15 VWX YZ-'%/1iso8859-15")); |
262 | dc->addSet("JKL"); | 265 | for (QStringList::ConstIterator it = sets.begin(), it_a = sets_a.begin(); it!=sets.end(); ++it,++it_a) |
263 | dc->addSet("MNO"); | 266 | dc->addSet(*it_a,*it); |
264 | dc->addSet("PQR"); | ||
265 | dc->addSet("STU"); | ||
266 | dc->addSet("VWX"); | ||
267 | dc->addSet("YZ-'"); | ||
268 | dc->addMode("123"); | 267 | dc->addMode("123"); |
269 | dc->addMode("@*!?"); | 268 | dc->addMode("@*!?"); |
270 | dc->addMode("KEY"); | 269 | dc->addMode(tr("KEY")); |
271 | dc->addMode("Space"); | 270 | dc->addMode(tr("Space")); |
272 | dc->addMode("Back"); | 271 | dc->addMode(tr("Back")); |
273 | dc->addMode("Enter"); | 272 | dc->addMode(tr("Enter")); |
274 | dc->addMode("Shift"); | 273 | dc->addMode(tr("Shift")); |
275 | configs.append(dc); | 274 | configs.append(dc); |
276 | 275 | ||
277 | CharStringConfig* number = new CharStringConfig(this); | 276 | CharStringConfig* number = new CharStringConfig(this); |
278 | number->addChar("0"); | 277 | number->addChar("0"); |
279 | number->addChar("1"); | 278 | number->addChar("1"); |
280 | number->addChar("2"); | 279 | number->addChar("2"); |
281 | number->addChar("3"); | 280 | number->addChar("3"); |
282 | number->addChar("4"); | 281 | number->addChar("4"); |
283 | number->addChar("5"); | 282 | number->addChar("5"); |
284 | number->addChar("6"); | 283 | number->addChar("6"); |
285 | number->addChar("7"); | 284 | number->addChar("7"); |
286 | number->addChar("8"); | 285 | number->addChar("8"); |
287 | number->addChar("9"); | 286 | number->addChar("9"); |
288 | number->addChar("."); // #### or "," in some locales | 287 | number->addChar("."); // #### or "," in some locales |
289 | configs.append(number); | 288 | configs.append(number); |
290 | 289 | ||
291 | CharConfig* punc = new CharConfig(this); | 290 | CharConfig* punc = new CharConfig(this); |
292 | 291 | ||
293 | punc->addChar(0,"\""); | 292 | punc->addChar(0,"\""); |
294 | punc->addChar(0,"`"); | 293 | punc->addChar(0,"`"); |
295 | punc->addChar(0,"'"); | 294 | punc->addChar(0,"'"); |
296 | punc->addChar(0,"\253"); | 295 | punc->addChar(0,"\253"); |
297 | punc->addChar(0,"\273"); | 296 | punc->addChar(0,"\273"); |
298 | punc->addChar(0,"\277"); | 297 | punc->addChar(0,"\277"); |
299 | punc->addChar(1,"("); | 298 | punc->addChar(1,"("); |
300 | punc->addChar(1,")"); | 299 | punc->addChar(1,")"); |
301 | punc->addChar(1,"["); | 300 | punc->addChar(1,"["); |
302 | punc->addChar(1,"]"); | 301 | punc->addChar(1,"]"); |
303 | punc->addChar(1,"{"); | 302 | punc->addChar(1,"{"); |
304 | punc->addChar(1,"}"); | 303 | punc->addChar(1,"}"); |
305 | 304 | ||
306 | punc->addChar(0,"+"); | 305 | punc->addChar(0,"+"); |
307 | punc->addChar(0,"-"); | 306 | punc->addChar(0,"-"); |
308 | punc->addChar(0,"*"); | 307 | punc->addChar(0,"*"); |
309 | punc->addChar(0,"/"); | 308 | punc->addChar(0,"/"); |
310 | punc->addChar(0,"="); | 309 | punc->addChar(0,"="); |
311 | punc->addChar(0,"_"); | 310 | punc->addChar(0,"_"); |
312 | punc->addChar(0,"$"); | 311 | punc->addChar(0,"$"); |
313 | punc->addChar(0,"&"); | 312 | punc->addChar(0,"&"); |
314 | punc->addChar(1,"|"); | 313 | punc->addChar(1,"|"); |
315 | punc->addChar(1,"@"); | 314 | punc->addChar(1,"@"); |
316 | punc->addChar(1,"\\"); | 315 | punc->addChar(1,"\\"); |
317 | punc->addChar(1,"#"); | 316 | punc->addChar(1,"#"); |
318 | punc->addChar(1,"^"); | 317 | punc->addChar(1,"^"); |
319 | punc->addChar(1,"~"); | 318 | punc->addChar(1,"~"); |
320 | punc->addChar(1,"<"); | 319 | punc->addChar(1,"<"); |
321 | punc->addChar(1,">"); | 320 | punc->addChar(1,">"); |
322 | 321 | ||