mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-25 20:25:54 +02:00
Converted public fields of Touchscreen to private.
This commit is contained in:
parent
ea7b4ec002
commit
b78ffa704a
@ -1332,10 +1332,12 @@ void GMenu2X::contextMenu() {
|
|||||||
if (ts.released()) {
|
if (ts.released()) {
|
||||||
if (!ts.inRect(box))
|
if (!ts.inRect(box))
|
||||||
close = true;
|
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++) {
|
for (i=0; i<voices.size(); i++) {
|
||||||
selbox.y = box.y+4+(h+2)*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();
|
voices[i].action();
|
||||||
close = true;
|
close = true;
|
||||||
i = voices.size();
|
i = voices.size();
|
||||||
@ -1344,7 +1346,8 @@ void GMenu2X::contextMenu() {
|
|||||||
} else if (ts.pressed() && ts.inRect(box)) {
|
} else if (ts.pressed() && ts.inRect(box)) {
|
||||||
for (i=0; i<voices.size(); i++) {
|
for (i=0; i<voices.size(); i++) {
|
||||||
selbox.y = box.y+4+(h+2)*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;
|
sel = i;
|
||||||
i = voices.size();
|
i = voices.size();
|
||||||
}
|
}
|
||||||
|
@ -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);
|
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 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;
|
action = ID_ACTION_SELECT;
|
||||||
|
}
|
||||||
|
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
@ -40,13 +40,12 @@ private:
|
|||||||
bool calibrated, _handled;
|
bool calibrated, _handled;
|
||||||
TS_EVENT event;
|
TS_EVENT event;
|
||||||
int calibX, calibY;
|
int calibX, calibY;
|
||||||
|
int x, y, startX, startY;
|
||||||
|
bool wasPressed;
|
||||||
|
|
||||||
void calibrate(/*TS_EVENT event*/);
|
void calibrate(/*TS_EVENT event*/);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int x,y, startX,startY;
|
|
||||||
bool wasPressed;
|
|
||||||
|
|
||||||
Touchscreen();
|
Touchscreen();
|
||||||
~Touchscreen();
|
~Touchscreen();
|
||||||
|
|
||||||
@ -65,6 +64,9 @@ public:
|
|||||||
bool inRect(int x, int y, int w, int h);
|
bool inRect(int x, int y, int w, int h);
|
||||||
bool startedInRect(SDL_Rect r);
|
bool startedInRect(SDL_Rect r);
|
||||||
bool startedInRect(int x, int y, int w, int h);
|
bool startedInRect(int x, int y, int w, int h);
|
||||||
|
|
||||||
|
int getX() { return x; }
|
||||||
|
int getY() { return y; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user