#50 additional mouse pointer options
[fanfix.git] / src / jexer / TWindow.java
index b8513c44298e01819e12d2cf5dbf07a18a1bdd02..2855209eda870bb5a5bc44c9d2670585f7400d89 100644 (file)
@@ -34,6 +34,7 @@ import java.util.Set;
 import jexer.backend.Screen;
 import jexer.bits.CellAttributes;
 import jexer.bits.GraphicsChars;
+import jexer.bits.StringUtils;
 import jexer.event.TCommandEvent;
 import jexer.event.TKeypressEvent;
 import jexer.event.TMenuEvent;
@@ -886,10 +887,11 @@ public class TWindow extends TWidget {
             true);
 
         // Draw the title
-        int titleLeft = (getWidth() - title.length() - 2) / 2;
+        int titleLength = StringUtils.width(title);
+        int titleLeft = (getWidth() - titleLength - 2) / 2;
         putCharXY(titleLeft, 0, ' ', border);
-        putStringXY(titleLeft + 1, 0, title);
-        putCharXY(titleLeft + title.length() + 1, 0, ' ', border);
+        putStringXY(titleLeft + 1, 0, title, border);
+        putCharXY(titleLeft + titleLength + 1, 0, ' ', border);
 
         if (isActive()) {
 
@@ -1382,7 +1384,7 @@ public class TWindow extends TWidget {
      * @return true if this window does not want the application-wide mouse
      * cursor drawn over it
      */
-    public final boolean hasHiddenMouse() {
+    public boolean hasHiddenMouse() {
         return hideMouse;
     }