diff --git a/src/nmania/ui/ng/NumberBox.java b/src/nmania/ui/ng/NumberBox.java index 1cb64b29..01fb6fa4 100644 --- a/src/nmania/ui/ng/NumberBox.java +++ b/src/nmania/ui/ng/NumberBox.java @@ -57,7 +57,7 @@ public void Paint(Graphics g, int w, int h) { g.drawString(sign ? "0" : "-0", w - fh - (fh >> 1), 10, Graphics.TOP | Graphics.RIGHT); else g.drawString(String.valueOf(value), w - fh - (fh >> 1), 10, Graphics.TOP | Graphics.RIGHT); - PaintPad(g, w, 10+fh+10); + PaintPad(g, w, fh + 20); } private final void PaintPad(Graphics g, int w, int y) { @@ -105,5 +105,36 @@ private void ApplySign() { } public void OnTouch(IDisplay d, int s, int x, int y, int dx, int dy, int w, int h) { + if (s == 1) { + int fh = num.getHeight(); + y -= fh + 20; + if (y < 0) + return; + if (y < fh + 2) { + OnKey(d, '1'+(x*3/w)); + return; + } + y -= fh + 2; + if (y < fh + 2) { + OnKey(d, '4'+(x*3/w)); + return; + } + y -= fh + 2; + if (y < fh + 2) { + OnKey(d, '7'+(x*3/w)); + return; + } + y -= fh + 2; + if (y < fh + 2) { + if (x < w/3) { + OnKey(d, Canvas.KEY_STAR); + } else if (x < w*2/3) { + OnKey(d, '0'); + } else { + OnKey(d, Canvas.KEY_POUND); + } + return; + } + } } }