box drawing intersections
[fanfix.git] / src / jexer / menu / TMenu.java
index 1bcc80055a63b70e79ac8f9f95da8cb9b05945b6..8a8ec6be752d1443e60969baa5505671a567279f 100644 (file)
@@ -102,26 +102,34 @@ public class TMenu extends TWindow {
     public static final int MID_ABOUT                   = 56;
 
     // Table menu
-    public static final int MID_TABLE_BORDER_NONE               = 60;
-    public static final int MID_TABLE_BORDER_ALL                = 61;
-    public static final int MID_TABLE_BORDER_RIGHT              = 62;
-    public static final int MID_TABLE_BORDER_LEFT               = 63;
-    public static final int MID_TABLE_BORDER_TOP                = 64;
-    public static final int MID_TABLE_BORDER_BOTTOM             = 65;
-    public static final int MID_TABLE_BORDER_DOUBLE_BOTTOM      = 66;
-    public static final int MID_TABLE_BORDER_THICK_BOTTOM       = 67;
-    public static final int MID_TABLE_DELETE_LEFT               = 68;
-    public static final int MID_TABLE_DELETE_UP                 = 69;
-    public static final int MID_TABLE_DELETE_ROW                = 70;
-    public static final int MID_TABLE_DELETE_COLUMN             = 71;
-    public static final int MID_TABLE_INSERT_LEFT               = 72;
-    public static final int MID_TABLE_INSERT_RIGHT              = 73;
-    public static final int MID_TABLE_INSERT_ABOVE              = 74;
-    public static final int MID_TABLE_INSERT_BELOW              = 75;
-    public static final int MID_TABLE_COLUMN_NARROW             = 76;
-    public static final int MID_TABLE_COLUMN_WIDEN              = 77;
-    public static final int MID_TABLE_FILE_SAVE_CSV             = 78;
-    public static final int MID_TABLE_FILE_SAVE_TEXT            = 79;
+    public static final int MID_TABLE_RENAME_ROW                = 60;
+    public static final int MID_TABLE_RENAME_COLUMN             = 61;
+    public static final int MID_TABLE_VIEW_ROW_LABELS           = 70;
+    public static final int MID_TABLE_VIEW_COLUMN_LABELS        = 71;
+    public static final int MID_TABLE_VIEW_HIGHLIGHT_ROW        = 72;
+    public static final int MID_TABLE_VIEW_HIGHLIGHT_COLUMN     = 73;
+    public static final int MID_TABLE_BORDER_NONE               = 80;
+    public static final int MID_TABLE_BORDER_ALL                = 81;
+    public static final int MID_TABLE_BORDER_CELL_NONE          = 82;
+    public static final int MID_TABLE_BORDER_CELL_ALL           = 83;
+    public static final int MID_TABLE_BORDER_RIGHT              = 84;
+    public static final int MID_TABLE_BORDER_LEFT               = 85;
+    public static final int MID_TABLE_BORDER_TOP                = 86;
+    public static final int MID_TABLE_BORDER_BOTTOM             = 87;
+    public static final int MID_TABLE_BORDER_DOUBLE_BOTTOM      = 88;
+    public static final int MID_TABLE_BORDER_THICK_BOTTOM       = 89;
+    public static final int MID_TABLE_DELETE_LEFT               = 100;
+    public static final int MID_TABLE_DELETE_UP                 = 101;
+    public static final int MID_TABLE_DELETE_ROW                = 102;
+    public static final int MID_TABLE_DELETE_COLUMN             = 103;
+    public static final int MID_TABLE_INSERT_LEFT               = 104;
+    public static final int MID_TABLE_INSERT_RIGHT              = 105;
+    public static final int MID_TABLE_INSERT_ABOVE              = 106;
+    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;
 
     // ------------------------------------------------------------------------
     // Variables --------------------------------------------------------------
@@ -530,6 +538,8 @@ public class TMenu extends TWindow {
 
         String label;
         TKeypress key = null;
+        boolean checkable = false;
+        boolean checked = false;
 
         switch (id) {
 
@@ -649,12 +659,39 @@ public class TMenu extends TWindow {
             label = i18n.getString("menuHelpAbout");
             break;
 
+        case MID_TABLE_VIEW_ROW_LABELS:
+            label = i18n.getString("menuTableViewRowLabels");
+            checkable = true;
+            checked = true;
+            break;
+        case MID_TABLE_VIEW_COLUMN_LABELS:
+            label = i18n.getString("menuTableViewColumnLabels");
+            checkable = true;
+            checked = true;
+            break;
+        case MID_TABLE_VIEW_HIGHLIGHT_ROW:
+            label = i18n.getString("menuTableViewHighlightRow");
+            checkable = true;
+            checked = true;
+            break;
+        case MID_TABLE_VIEW_HIGHLIGHT_COLUMN:
+            label = i18n.getString("menuTableViewHighlightColumn");
+            checkable = true;
+            checked = true;
+            break;
+
         case MID_TABLE_BORDER_NONE:
             label = i18n.getString("menuTableBorderNone");
             break;
         case MID_TABLE_BORDER_ALL:
             label = i18n.getString("menuTableBorderAll");
             break;
+        case MID_TABLE_BORDER_CELL_NONE:
+            label = i18n.getString("menuTableBorderCellNone");
+            break;
+        case MID_TABLE_BORDER_CELL_ALL:
+            label = i18n.getString("menuTableBorderCellAll");
+            break;
         case MID_TABLE_BORDER_RIGHT:
             label = i18n.getString("menuTableBorderRight");
             break;
@@ -716,7 +753,9 @@ public class TMenu extends TWindow {
             throw new IllegalArgumentException("Invalid menu ID: " + id);
         }
 
-        return addItemInternal(id, label, key, enabled);
+        TMenuItem item = addItemInternal(id, label, key, enabled);
+        item.setCheckable(checkable);
+        return item;
     }
 
     /**