X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fmenu%2FTMenu.java;h=9983580ac1ff02b5742be5342ec4c0edcb218342;hb=5ffeabccc177e9fdadb62002c6d3bf1f6ae650fa;hp=a92200de6077c598c767fb5b92969dca870215c4;hpb=2b4274048c2f409b5eba8373ab3018aa75911c73;p=nikiroo-utils.git diff --git a/src/jexer/menu/TMenu.java b/src/jexer/menu/TMenu.java index a92200d..9983580 100644 --- a/src/jexer/menu/TMenu.java +++ b/src/jexer/menu/TMenu.java @@ -37,6 +37,7 @@ import jexer.TWindow; import jexer.bits.CellAttributes; import jexer.bits.GraphicsChars; import jexer.bits.MnemonicString; +import jexer.bits.StringUtils; import jexer.event.TKeypressEvent; import jexer.event.TMouseEvent; import static jexer.TKeypress.*; @@ -61,7 +62,7 @@ public class TMenu extends TWindow { // Tools menu public static final int MID_REPAINT = 1; public static final int MID_VIEW_IMAGE = 2; - public static final int MID_CHANGE_FONT = 3; + public static final int MID_SCREEN_OPTIONS = 3; // File menu public static final int MID_NEW = 10; @@ -128,8 +129,13 @@ public class TMenu extends TWindow { public static final int MID_TABLE_INSERT_BELOW = 107; public static final int MID_TABLE_COLUMN_NARROW = 110; public static final int MID_TABLE_COLUMN_WIDEN = 111; - public static final int MID_TABLE_FILE_SAVE_CSV = 115; - public static final int MID_TABLE_FILE_SAVE_TEXT = 116; + public static final int MID_TABLE_FILE_OPEN_CSV = 115; + public static final int MID_TABLE_FILE_SAVE_CSV = 116; + public static final int MID_TABLE_FILE_SAVE_TEXT = 117; + + // Miscellaneous + public static final int MID_SPLIT_VERTICAL = 200; + public static final int MID_SPLIT_HORIZONTAL = 201; // ------------------------------------------------------------------------ // Variables -------------------------------------------------------------- @@ -176,7 +182,7 @@ public class TMenu extends TWindow { assert (mnemonic.getShortcutIdx() >= 0); // Recompute width and height to reflect an empty menu - setWidth(getTitle().length() + 4); + setWidth(StringUtils.width(getTitle()) + 4); setHeight(2); setActive(false); @@ -563,8 +569,8 @@ public class TMenu extends TWindow { label = i18n.getString("menuViewImage"); break; - case MID_CHANGE_FONT: - label = i18n.getString("menuChangeFont"); + case MID_SCREEN_OPTIONS: + label = i18n.getString("menuScreenOptions"); break; case MID_NEW: @@ -760,6 +766,9 @@ public class TMenu extends TWindow { label = i18n.getString("menuTableColumnWiden"); key = kbShiftRight; break; + case MID_TABLE_FILE_OPEN_CSV: + label = i18n.getString("menuTableFileOpenCsv"); + break; case MID_TABLE_FILE_SAVE_CSV: label = i18n.getString("menuTableFileSaveCsv"); break; @@ -767,6 +776,13 @@ public class TMenu extends TWindow { label = i18n.getString("menuTableFileSaveText"); break; + case MID_SPLIT_VERTICAL: + label = i18n.getString("menuSplitVertical"); + break; + case MID_SPLIT_HORIZONTAL: + label = i18n.getString("menuSplitHorizontal"); + break; + default: throw new IllegalArgumentException("Invalid menu ID: " + id); }