X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTSpinner.java;h=61fac65983ab4ddb9b106f14710747c00795ec62;hb=12b90437b5f22c2ae6e9b9b14c3b62b60f6143e5;hp=cdc5c0f4ed9b5bee9d9dda45e708e0cd471c56f8;hpb=051e29138b18fb4b731a72f8727475b10e4c74e4;p=fanfix.git diff --git a/src/jexer/TSpinner.java b/src/jexer/TSpinner.java index cdc5c0f..61fac65 100644 --- a/src/jexer/TSpinner.java +++ b/src/jexer/TSpinner.java @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (C) 2017 Kevin Lamonte + * Copyright (C) 2019 Kevin Lamonte * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -35,7 +35,7 @@ import jexer.event.TMouseEvent; import static jexer.TKeypress.*; /** - * TSpinner implements a simple up/down spinner. Values can be numer + * TSpinner implements a simple up/down spinner. */ public class TSpinner extends TWidget { @@ -89,7 +89,7 @@ public class TSpinner extends TWidget { */ private boolean mouseOnUpArrow(final TMouseEvent mouse) { if ((mouse.getY() == 0) - && (mouse.getX() == getWidth() - 1) + && (mouse.getX() == getWidth() - 2) ) { return true; } @@ -104,7 +104,7 @@ public class TSpinner extends TWidget { */ private boolean mouseOnDownArrow(final TMouseEvent mouse) { if ((mouse.getY() == 0) - && (mouse.getX() == getWidth() - 2) + && (mouse.getX() == getWidth() - 1) ) { return true; } @@ -162,10 +162,8 @@ public class TSpinner extends TWidget { spinnerColor = getTheme().getColor("tspinner.inactive"); } - getScreen().putCharXY(getWidth() - 2, 0, GraphicsChars.UPARROW, - spinnerColor); - getScreen().putCharXY(getWidth() - 1, 0, GraphicsChars.DOWNARROW, - spinnerColor); + putCharXY(getWidth() - 2, 0, GraphicsChars.UPARROW, spinnerColor); + putCharXY(getWidth() - 1, 0, GraphicsChars.DOWNARROW, spinnerColor); } // ------------------------------------------------------------------------ @@ -177,7 +175,7 @@ public class TSpinner extends TWidget { */ private void up() { if (upAction != null) { - upAction.DO(); + upAction.DO(this); } } @@ -186,7 +184,7 @@ public class TSpinner extends TWidget { */ private void down() { if (downAction != null) { - downAction.DO(); + downAction.DO(this); } }