author | eric <eric> | 2003-02-21 10:39:29 (UTC) |
---|---|---|
committer | eric <eric> | 2003-02-21 10:39:29 (UTC) |
commit | 2d77abb5ff37abf61e04657431d7e0e1f5138d94 (patch) (side-by-side diff) | |
tree | c78d34380cb9e1722f41c56cda0bbbea394e2a1a /noncore/tools/euroconv/calckeypad.cpp | |
parent | d25a16d1fd34374e4d2815dec4d11b25b2049432 (diff) | |
download | opie-2d77abb5ff37abf61e04657431d7e0e1f5138d94.zip opie-2d77abb5ff37abf61e04657431d7e0e1f5138d94.tar.gz opie-2d77abb5ff37abf61e04657431d7e0e1f5138d94.tar.bz2 |
- Improve look 'n feel.
- fix a bug in '=' operation.
Diffstat (limited to 'noncore/tools/euroconv/calckeypad.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/tools/euroconv/calckeypad.cpp | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/noncore/tools/euroconv/calckeypad.cpp b/noncore/tools/euroconv/calckeypad.cpp index 4156570..f1d61c0 100644 --- a/noncore/tools/euroconv/calckeypad.cpp +++ b/noncore/tools/euroconv/calckeypad.cpp @@ -23,2 +23,4 @@ KeyPad::KeyPad(LCDDisplay *lcd, QWidget *parent, const char *name ) +int i; +QButton *btnButton; @@ -72,2 +74,8 @@ grpbtnDigits->insert(btn9, 9); +// set appearance of buttons +for(i=0; i<10; i++){ + btnButton = grpbtnDigits->find(i); + btnButton->setFixedSize(30,30); +} + // Operator key @@ -79,2 +87,13 @@ grpbtnOperators->insert(btnDivide,4); grpbtnOperators->insert(btnEqual,5); +// set appearance of buttons +for(i=1; i<6; i++){ + btnButton = grpbtnOperators->find(i); + btnButton->setFixedSize(30,30); +} +btnClear->setFixedSize(30,30); +btnClear->setPalette(QPalette( QColor(255, 99, 71) ) ); +btnDot->setFixedSize(30,30); +btnPercent->setFixedSize(30,30); +btnF1->setFixedSize(30,30); +btnAbout->setFixedSize(30,30); @@ -137,18 +156,11 @@ if(iPreviousOperator){ } -if(i == 5){ - // key '=' pressed - dPreviousValue = 0; - iPreviousOperator = 0; - // We don't want to add digits - iLenCurrent = 100; -}else{ - dPreviousValue = dCurrent; - iPreviousOperator = i; - // reset LCD for next digit - dCurrent = 0; - iLenCurrent = 1; - bIsDec = false; - dDecCurrent = 0; -} +dPreviousValue = dCurrent; +iPreviousOperator = i; + +// reset LCD for next digit +dCurrent = 0; +iLenCurrent = 1; +bIsDec = false; +dDecCurrent = 0; } @@ -189,3 +201,7 @@ QMessageBox::about( this, "About Euroconv", "Written by Eric Santonacci for Opie\n" - "http://opie.handhelds.org\n" ); + "http://opie.handhelds.org\n\n" + "Version 0.2\n\n" + "Any comment or feedback to:\n" + "Eric.Santonacci@talc.fr\n"); + } |