#46 stubs for LayoutManager
[fanfix.git] / src / jexer / TButton.java
index 33fe73328b1773f9b42225537a70771fc8c8b6d6..82a638922df56ed7ad6086fcfd5ba4aff385e28f 100644 (file)
@@ -32,6 +32,7 @@ import jexer.bits.CellAttributes;
 import jexer.bits.Color;
 import jexer.bits.GraphicsChars;
 import jexer.bits.MnemonicString;
+import jexer.bits.StringUtils;
 import jexer.event.TKeypressEvent;
 import jexer.event.TMouseEvent;
 import static jexer.TKeypress.kbEnter;
@@ -98,7 +99,7 @@ public class TButton extends TWidget {
         setX(x);
         setY(y);
         setHeight(2);
-        setWidth(mnemonic.getRawLabel().length() + 3);
+        setWidth(StringUtils.width(mnemonic.getRawLabel()) + 3);
 
         shadowColor = new CellAttributes();
         shadowColor.setTo(getWindow().getBackground());
@@ -249,12 +250,12 @@ public class TButton extends TWidget {
                     GraphicsChars.CP437[0xDF], shadowColor);
             }
         }
-        if (mnemonic.getShortcutIdx() >= 0) {
+        if (mnemonic.getScreenShortcutIdx() >= 0) {
             if (inButtonPress) {
-                putCharXY(2 + mnemonic.getShortcutIdx(), 0,
+                putCharXY(2 + mnemonic.getScreenShortcutIdx(), 0,
                     mnemonic.getShortcut(), menuMnemonicColor);
             } else {
-                putCharXY(1 + mnemonic.getShortcutIdx(), 0,
+                putCharXY(1 + mnemonic.getScreenShortcutIdx(), 0,
                     mnemonic.getShortcut(), menuMnemonicColor);
             }
         }