X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2FSurface.java;h=48eb198b5973e6398f31f4ae471527be0839d7ad;hb=07f137d5694c7d52a6a2c28e051546232b353f5d;hp=383e7a86b6387d1b7d17a5f0b9b127f476898df3;hpb=3591b88b94a6bb378af3d4abe6eb5233ce583104;p=org.ibex.core.git diff --git a/src/org/ibex/Surface.java b/src/org/ibex/Surface.java index 383e7a8..48eb198 100644 --- a/src/org/ibex/Surface.java +++ b/src/org/ibex/Surface.java @@ -88,7 +88,6 @@ public abstract class Surface extends PixelBuffer implements Scheduler.Task { if (button == 1) new Message("_Press1", T, root); else if (button == 2) new Message("_Press2", T, root); else if (button == 3) { - final Box who = root; Scheduler.add(new Scheduler.Task() { public void perform() throws JSExn { Platform.clipboardReadEnabled = true; try { @@ -150,6 +149,11 @@ public abstract class Surface extends PixelBuffer implements Scheduler.Task { Scheduler.add(this); } + protected final void HScroll(int pixels) { new Message("_HScroll", new Integer(pixels), root); } + protected final void VScroll(int pixels) { new Message("_VScroll", new Integer(pixels), root); } + protected final void HScroll(float lines) { new Message("_HScroll", new Float(lines), root); } + protected final void VScroll(float lines) { new Message("_VScroll", new Float(lines), root); } + /** subclasses should invoke this method when the user resizes the window */ protected final void SizeChange(final int width, final int height) { if (pendingWidth == width && pendingHeight == height) return; @@ -301,6 +305,10 @@ public abstract class Surface extends PixelBuffer implements Scheduler.Task { else if (value.toLowerCase().equals("control")) control = false; else if (value.toLowerCase().equals("shift")) shift = false; this.value = value; + } else if (name.equals("_HScroll") || name.equals("_VScroll")) { + // FIXME: technically points != pixels + if (value instanceof Integer) + value = new Float(((Integer)value).intValue() * root.fontSize()); } try { boxContainingMouse.putAndTriggerTrapsAndCatchExceptions(name, value);