From 1cadadb36b56694046e52f52d86adbb12cd370b6 Mon Sep 17 00:00:00 2001 From: Eric Oulashin <eric.oulashin@gmail.com> Date: Mon, 21 Apr 2025 13:12:48 -0700 Subject: [PATCH] DD area choosers: F & L keys work again (first & last page). Message area chooser fix for "DisplayMenuHdrWithNumItems is not a function". File area chooser fix to ensure header lines written properly after displaying help. --- xtrn/DDAreaChoosers/DDFileAreaChooser.js | 15 +++++++++++---- xtrn/DDAreaChoosers/DDMsgAreaChooser.js | 14 +++++++++----- xtrn/DDAreaChoosers/readme.txt | 4 ++-- xtrn/DDAreaChoosers/version_history.txt | 6 ++++++ 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/xtrn/DDAreaChoosers/DDFileAreaChooser.js b/xtrn/DDAreaChoosers/DDFileAreaChooser.js index eb38d794f1..d2c6669710 100644 --- a/xtrn/DDAreaChoosers/DDFileAreaChooser.js +++ b/xtrn/DDAreaChoosers/DDFileAreaChooser.js @@ -77,6 +77,10 @@ * 2025-04-10 Eric Oulashin Version 1.42b * Fix: altName wasn't added to items if name collapsing disabled. * Also, start of name collapsing enhancement (no empty names). + * 2025-04-21 Eric Oulashin Version 1.42c + * F & L keys working again on the light bar menu (first & last page). + * Fix to ensure the header lines are written in the proper place after + * showing help. */ // TODO: Failing silently when 1st argument is true @@ -117,8 +121,8 @@ if (system.version_num < 31400) } // Version & date variables -var DD_FILE_AREA_CHOOSER_VERSION = "1.42b Beta"; -var DD_FILE_AREA_CHOOSER_VER_DATE = "2025-04-07"; +var DD_FILE_AREA_CHOOSER_VERSION = "1.42c"; +var DD_FILE_AREA_CHOOSER_VER_DATE = "2025-04-21"; // Keyboard input key codes var CTRL_H = "\x08"; @@ -391,6 +395,8 @@ function DDFileAreaChooser_SelectFileArea(pChooseLib) if (!this.useLightbarInterface || !console.term_supports(USER_ANSI)) numItemsWidth = 5; // Main loop + var writeHdrLines = false; + var writeKeyHelpLine = true; var selectionLoopContinueOn = true; while (selectionLoopContinueOn) { @@ -427,8 +433,6 @@ function DDFileAreaChooser_SelectFileArea(pChooseLib) var lastSearchText = ""; var lastSearchFoundIdx = -1; var drawMenu = true; - var writeHdrLines = false; // Already displayed above - var writeKeyHelpLine = true; // Menu input loop var menuContinueOn = true; while (menuContinueOn) @@ -755,6 +759,7 @@ function DDFileAreaChooser_SelectFileArea(pChooseLib) drawMenu = true; writeHdrLines = true; writeKeyHelpLine = true; + console.clear("\x01n"); } // Quit - Note: This check should be last else if (lastUserInputUpper == "Q" || lastUserInputUpper == KEY_ESC || selectedMenuIdx == null) @@ -887,6 +892,8 @@ function DDFileAreaChooser_CreateLightbarMenu(pDirHeirarchyObj, pHeirarchyLevel, // Add additional keypresses for quitting the menu's input loop so we can // respond to these keys fileDirMenu.AddAdditionalQuitKeys("qQ?/" + CTRL_F); + fileDirMenu.AddAdditionalFirstPageKeys("fF"); + fileDirMenu.AddAdditionalLastPageKeys("lL"); if (this.useLightbarInterface && console.term_supports(USER_ANSI)) { fileDirMenu.allowANSI = true; diff --git a/xtrn/DDAreaChoosers/DDMsgAreaChooser.js b/xtrn/DDAreaChoosers/DDMsgAreaChooser.js index 8695ffeded..32ff558302 100644 --- a/xtrn/DDAreaChoosers/DDMsgAreaChooser.js +++ b/xtrn/DDAreaChoosers/DDMsgAreaChooser.js @@ -86,6 +86,9 @@ * 2025-04-10 Eric Oulashin Version 1.42b * Fix: altName wasn't added to items if name collapsing disabled. * Also, start of name collapsing enhancement (no empty names). + * 2025-04-21 Eric Oulashin Version 1.42c + * F & L keys working again on the light bar menu (first & last page). + * Fix for "this.DisplayMenuHdrWithNumItems is not a function". */ /* Command-line arguments: @@ -123,8 +126,8 @@ if (system.version_num < 31400) } // Version & date variables -var DD_MSG_AREA_CHOOSER_VERSION = "1.42b Beta"; -var DD_MSG_AREA_CHOOSER_VER_DATE = "2025-04-07"; +var DD_MSG_AREA_CHOOSER_VERSION = "1.42c"; +var DD_MSG_AREA_CHOOSER_VER_DATE = "2025-04-21"; // Keyboard input key codes var CTRL_H = "\x08"; @@ -677,9 +680,8 @@ function DDMsgAreaChooser_SelectMsgArea(pChooseGroup, pGrpIdx) // screen (including the header, due to things being moved down one line). if (this.useLightbarInterface && console.term_supports(USER_ANSI)) console.gotoxy(1, 1); - this.DisplayMenuHdrWithNumItems(createMenuRet.itemNumWidth, createMenuRet.descWidth-3, createMenuRet.numItemsWidth, numItemsColLabel); - if (this.useLightbarInterface && console.term_supports(USER_ANSI)) - this.WriteKeyHelpLine(); + writeHdrLines = true; + writeKeyHelpLine = true; continue; // Continue to display the menu again and get the user's choice } } @@ -1102,6 +1104,8 @@ function DDMsgAreaChooser_CreateLightbarMenu(pMsgAreaHeirarchyObj, pHeirarchyLev // Add additional keypresses for quitting the menu's input loop so we can // respond to these keys msgAreaMenu.AddAdditionalQuitKeys("qQ?/" + CTRL_F); + msgAreaMenu.AddAdditionalFirstPageKeys("fF"); + msgAreaMenu.AddAdditionalLastPageKeys("lL"); if (this.useLightbarInterface && console.term_supports(USER_ANSI)) { msgAreaMenu.allowANSI = true; diff --git a/xtrn/DDAreaChoosers/readme.txt b/xtrn/DDAreaChoosers/readme.txt index f82ed39f94..c2318f2c9e 100644 --- a/xtrn/DDAreaChoosers/readme.txt +++ b/xtrn/DDAreaChoosers/readme.txt @@ -1,6 +1,6 @@ Digital Distortion Area Choosers - Version 1.42b - Release date: 2025-04-10 + Version 1.42c + Release date: 2025-04-21 by diff --git a/xtrn/DDAreaChoosers/version_history.txt b/xtrn/DDAreaChoosers/version_history.txt index c9f8bb2380..408bc3c183 100644 --- a/xtrn/DDAreaChoosers/version_history.txt +++ b/xtrn/DDAreaChoosers/version_history.txt @@ -5,6 +5,12 @@ Revision History (change log) ============================= Version Date Description ------- ---- ----------- +1.42c 2025-04-21 F & L keys working again on the light bar menu (first & + last page). + Message area chooser: Fix for + "this.DisplayMenuHdrWithNumItems is not a function". + File area choser: Fix to ensure the header lines are + written in the proper place after showing help. 1.42b 2025-04-10 Fix: altName wasn't added to items if name collapsing disabled. Also, start of name collapsing enhancement (no empty -- GitLab