diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2021-02-20 18:41:31 +0900 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2021-02-20 18:42:25 +0900 |
| commit | cf258cdbd6132a549d87abbd285e5aa663130d72 (patch) | |
| tree | 9b8fc9fa9cb3c70ae1b5c65480fe5b6330c95ecc /src/MainWidget.cpp | |
| parent | 543ee0948ccb0138453a99bff403c780b974a79f (diff) | |
| download | kvkbd-cf258cdbd6132a549d87abbd285e5aa663130d72.tar.gz kvkbd-cf258cdbd6132a549d87abbd285e5aa663130d72.zip | |
Simplified code for numpad buttons. This adds on to PR #9.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 47d89f2d15ad750689d6376234b37b85e1ab5704)
Diffstat (limited to 'src/MainWidget.cpp')
| -rw-r--r-- | src/MainWidget.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/MainWidget.cpp b/src/MainWidget.cpp index 43d0516..e57ff39 100644 --- a/src/MainWidget.cpp +++ b/src/MainWidget.cpp @@ -20,6 +20,7 @@ #include "MainWidget.h" #include "VButton.h" +#include "numpadvbutton.h" #include <cstdlib> @@ -417,14 +418,13 @@ MainWidget::MainWidget ( TDEAboutData *about, bool tren, TQWidget *parent, const "End", TQString::fromUtf8("▼"), "Pg\nDn" }; TQString nump[9] = {"7","8","9","4","5","6","1","2","3"}; int val=0; - int nval[9] = {79,80,81,83,84,85,87,88,89}; int cval[9] = {79,80,81,83,84,85,87,88,89}; for (int a=2;a<5;a++){ for (int b=0;b<3;b++){ NumpadVButton *v = new NumpadVButton(this,""); v->move(padx+(b*35),sty+(a*35)); v->res(); - v->setKeyCode(nval[val],cval[val]); + v->setKeyCode(cval[val]); v->setText(txt[val]); v->setShiftText(nump[val]); numl_keys.append(v); @@ -437,7 +437,7 @@ MainWidget::MainWidget ( TDEAboutData *about, bool tren, TQWidget *parent, const ins->move(padx,sty+(5*35)); ins->res(); ins->setText("Ins"); - ins->setKeyCode(90,90); + ins->setKeyCode(90); ins->setShiftText("0"); numl_keys.append(ins); @@ -449,7 +449,7 @@ MainWidget::MainWidget ( TDEAboutData *about, bool tren, TQWidget *parent, const del->res(); del->setText("Del"); del->setShiftText("."); - del->setKeyCode(91,91); + del->setKeyCode(91); numl_keys.append(del); connect ( del, TQT_SIGNAL ( keyClick ( unsigned int ) ), this, TQT_SLOT ( keyPress ( unsigned int ) ) ); @@ -485,7 +485,7 @@ MainWidget::MainWidget ( TDEAboutData *about, bool tren, TQWidget *parent, const ent->resize(30,65); ent->move(padx+70+35,sty+(4*35)); ent->res(); - ent->setText("Ent"); + ent->setText("En\nter"); ent->setKeyCode(104); other_keys.append(ent); connect ( ent, TQT_SIGNAL ( keyClick ( unsigned int ) ), this, TQT_SLOT ( keyPress ( unsigned int ) ) ); |
