1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-29 09:09:43 +02:00

Converted public fields of Touchscreen to private.

This commit is contained in:
Maarten ter Huurne 2010-07-26 05:24:55 +02:00
parent ea7b4ec002
commit b78ffa704a
3 changed files with 13 additions and 7 deletions

View File

@ -1332,10 +1332,12 @@ void GMenu2X::contextMenu() {
if (ts.released()) {
if (!ts.inRect(box))
close = true;
else if (ts.x>=selbox.x && ts.x<=selbox.x+selbox.w)
else if (ts.getX() >= selbox.x
&& ts.getX() <= selbox.x + selbox.w)
for (i=0; i<voices.size(); i++) {
selbox.y = box.y+4+(h+2)*i;
if (ts.y>=selbox.y && ts.y<=selbox.y+selbox.h) {
if (ts.getY() >= selbox.y
&& ts.getY() <= selbox.y + selbox.h) {
voices[i].action();
close = true;
i = voices.size();
@ -1344,7 +1346,8 @@ void GMenu2X::contextMenu() {
} else if (ts.pressed() && ts.inRect(box)) {
for (i=0; i<voices.size(); i++) {
selbox.y = box.y+4+(h+2)*i;
if (ts.y>=selbox.y && ts.y<=selbox.y+selbox.h) {
if (ts.getY() >= selbox.y
&& ts.getY() <= selbox.y + selbox.h) {
sel = i;
i = voices.size();
}

View File

@ -299,8 +299,9 @@ int InputDialog::drawVirtualKeyboard() {
gmenu2x->s->write(gmenu2x->font, gmenu2x->tr["OK"], (int)(160+kbLength*KEY_WIDTH/4), KB_TOP+kb->size()*KEY_HEIGHT+KEY_HEIGHT/2, SFontHAlignCenter, SFontVAlignMiddle);
//if ts released
if (gmenu2x->f200 && gmenu2x->ts.wasPressed && !gmenu2x->ts.pressed() && gmenu2x->ts.inRect(kbRect))
if (gmenu2x->f200 && gmenu2x->ts.released() && gmenu2x->ts.inRect(kbRect)) {
action = ID_ACTION_SELECT;
}
return action;
}

View File

@ -40,13 +40,12 @@ private:
bool calibrated, _handled;
TS_EVENT event;
int calibX, calibY;
int x, y, startX, startY;
bool wasPressed;
void calibrate(/*TS_EVENT event*/);
public:
int x,y, startX,startY;
bool wasPressed;
Touchscreen();
~Touchscreen();
@ -65,6 +64,9 @@ public:
bool inRect(int x, int y, int w, int h);
bool startedInRect(SDL_Rect r);
bool startedInRect(int x, int y, int w, int h);
int getX() { return x; }
int getY() { return y; }
};
#endif