git://git.nikiroo.be
/
fanfix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
#47 setfont only in swing thread
[fanfix.git]
/
src
/
jexer
/
menu
/
TMenu.java
diff --git
a/src/jexer/menu/TMenu.java
b/src/jexer/menu/TMenu.java
index 1d6a6ad34179c7325d7ed4d457e828059de4b09b..9983580ac1ff02b5742be5342ec4c0edcb218342 100644
(file)
--- 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.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.*;
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;
// 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;
// File menu
public static final int MID_NEW = 10;
@@
-132,6
+133,10
@@
public class TMenu extends TWindow {
public static final int MID_TABLE_FILE_SAVE_CSV = 116;
public static final int MID_TABLE_FILE_SAVE_TEXT = 117;
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 --------------------------------------------------------------
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
// Variables --------------------------------------------------------------
// ------------------------------------------------------------------------
@@
-177,7
+182,7
@@
public class TMenu extends TWindow {
assert (mnemonic.getShortcutIdx() >= 0);
// Recompute width and height to reflect an empty menu
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);
setHeight(2);
setActive(false);
@@
-564,8
+569,8
@@
public class TMenu extends TWindow {
label = i18n.getString("menuViewImage");
break;
label = i18n.getString("menuViewImage");
break;
- case MID_
CHANGE_FONT
:
- label = i18n.getString("menu
ChangeFont
");
+ case MID_
SCREEN_OPTIONS
:
+ label = i18n.getString("menu
ScreenOptions
");
break;
case MID_NEW:
break;
case MID_NEW:
@@
-771,6
+776,13
@@
public class TMenu extends TWindow {
label = i18n.getString("menuTableFileSaveText");
break;
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);
}
default:
throw new IllegalArgumentException("Invalid menu ID: " + id);
}