author | sandman <sandman> | 2002-10-22 11:58:33 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-22 11:58:33 (UTC) |
commit | 486280adc2ab5dc383a56d8516c36727eb382812 (patch) (side-by-side diff) | |
tree | 583cf961ec5c62c46137be36fcd9789d7d01158e /inputmethods/handwriting/qimpenhelp.cpp | |
parent | 1ee836bd1bb777dded54810909e508dc0470ada3 (diff) | |
download | opie-486280adc2ab5dc383a56d8516c36727eb382812.zip opie-486280adc2ab5dc383a56d8516c36727eb382812.tar.gz opie-486280adc2ab5dc383a56d8516c36727eb382812.tar.bz2 |
handwriting: qtopia 1.6 merge
all: someone made all inputmethod name()s untranslateable. This cured a
symptom (opie crashing), but it was not real a bug-fix. I have marked them
as translateable again and found no problems doing so.
Diffstat (limited to 'inputmethods/handwriting/qimpenhelp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | inputmethods/handwriting/qimpenhelp.cpp | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/inputmethods/handwriting/qimpenhelp.cpp b/inputmethods/handwriting/qimpenhelp.cpp index 5ee46a2..a294301 100644 --- a/inputmethods/handwriting/qimpenhelp.cpp +++ b/inputmethods/handwriting/qimpenhelp.cpp @@ -1,6 +1,6 @@ /********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. +** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** -** This file is part of Qtopia Environment. +** This file is part of the Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the @@ -136,8 +136,7 @@ HandwritingTrainer::HandwritingTrainer( QIMPenProfile *p, QWidget *parent, const : QWidget( parent, name ), profile(p) { - QGridLayout *gl = new QGridLayout( this, 5, 2, 0, 4 ); - gl->setRowStretch( 1, 1 ); - gl->setRowStretch( 2, 1 ); + QGridLayout *gl = new QGridLayout( this, 4, 2, 0, 4 ); gl->setColStretch( 1, 1 ); + gl->setRowStretch(3, 1); charSetCombo = new QComboBox( this ); @@ -151,18 +150,14 @@ HandwritingTrainer::HandwritingTrainer( QIMPenProfile *p, QWidget *parent, const charList = new QListBox( this ); charList->setHScrollBarMode( QListBox::AlwaysOff ); - charList->setFixedWidth( 80 ); + charList->setFixedWidth(80); connect( charList, SIGNAL(highlighted(int)), this, SLOT(selectChar(int)) ); - gl->addMultiCellWidget( charList, 1, 2, 0, 0 ); - - QLabel *help = new QLabel( this ); - help->setAlignment( AlignLeft | AlignVCenter | WordBreak ); - gl->addWidget( help, 1, 1 ); - help->setText( - tr( "Select a character from the list. The writing area on the left " - "shows the reference character. Practice writing in the area on " - "the right.") ); + gl->addWidget(charList, 1, 0); result = new QLabel( this ); - gl->addMultiCellWidget( result, 2, 3, 1, 1 ); + result->setAlignment(AlignLeft | AlignVCenter | WordBreak); + result->setText( + tr( "Select a reference character from the list. Practice writing in " + "the area on the right.")); + gl->addMultiCellWidget(result, 1, 2, 1, 1); matcher = new QIMPenMatch( this ); @@ -173,5 +168,5 @@ HandwritingTrainer::HandwritingTrainer( QIMPenProfile *p, QWidget *parent, const QHBoxLayout *hb = new QHBoxLayout(); - gl->addLayout( hb, 3, 0 ); + gl->addLayout( hb, 2, 0 ); prevBtn = new QPushButton( this ); prevBtn->setPixmap( QPixmap( (const char **)left_xpm ) ); @@ -186,5 +181,5 @@ HandwritingTrainer::HandwritingTrainer( QIMPenProfile *p, QWidget *parent, const refPw = new QIMPenWidget( this ); refPw->setReadOnly( TRUE ); - gl->addWidget( refPw, 4, 0 ); + gl->addWidget( refPw, 3, 0 ); pracPw = new QIMPenWidget( this ); @@ -198,5 +193,5 @@ HandwritingTrainer::HandwritingTrainer( QIMPenProfile *p, QWidget *parent, const connect( pracPw, SIGNAL(stroke( QIMPenStroke * )), matcher, SLOT(strokeEntered( QIMPenStroke * )) ); - gl->addWidget( pracPw, 4, 1 ); + gl->addWidget( pracPw, 3, 1 ); redrawTimer = new QTimer( this ); @@ -228,5 +223,4 @@ void HandwritingTrainer::setCurrentChar( QIMPenChar *c ) nextBtn->setEnabled( findNext() != 0 ); } - result->setText( "" ); redrawTimer->start( 5000 ); } @@ -234,4 +228,10 @@ void HandwritingTrainer::setCurrentChar( QIMPenChar *c ) void HandwritingTrainer::selectChar( int i ) { + static int last_char = 0; + + if (last_char != i) { + result->setText(""); + } + currentChar = 0; currentCode = ((CharListItem *)charList->item(i))->code(); @@ -253,4 +253,5 @@ void HandwritingTrainer::selectCharSet( int i ) refPw->removeCharSet( 0 ); pracPw->removeCharSet( 0 ); + result->setText(""); } currentSet = profile->charSets().at( i ); @@ -267,5 +268,5 @@ void HandwritingTrainer::selectCharSet( int i ) void HandwritingTrainer::noMatch() { - result->setText( "No match" ); + result->setText( tr("No match") ); } |