+ /**
+ * Handle posted menu events.
+ *
+ * @param menu menu event
+ */
+ @Override
+ public void onMenu(final TMenuEvent menu) {
+ switch (menu.getId()) {
+ case TMenu.MID_UNDO:
+ editField.undo();
+ break;
+ case TMenu.MID_REDO:
+ editField.redo();
+ break;
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // TWindow ----------------------------------------------------------------
+ // ------------------------------------------------------------------------
+
+ /**
+ * Draw the window.
+ */
+ @Override
+ public void draw() {
+ // Draw as normal.
+ super.draw();
+
+ // Add the row:col on the bottom row
+ CellAttributes borderColor = getBorder();
+ String location = String.format(" %d:%d ",
+ editField.getEditingRowNumber(),
+ editField.getEditingColumnNumber());
+ int colon = location.indexOf(':');
+ putStringXY(10 - colon, getHeight() - 1, location, borderColor);
+
+ if (editField.isDirty()) {
+ putCharXY(2, getHeight() - 1, GraphicsChars.OCTOSTAR, borderColor);
+ }
+ }
+