Synchronet v3.19b-Win32 (install) has been released (Jan-2022).

You can donate to the Synchronet project using PayPal.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
module:ddlightbarmenu.js [2018/03/26 10:19] – Updated the description of the GetVal() method nightfoxmodule:ddlightbarmenu.js [2018/03/26 13:12] – Added borderEnabled to the list of properties nightfox
Line 4: Line 4:
 The user can navigate the list using the up & down arrows, PageUp, PageDown, Home, and End keys.  The enter key selects an item.  The ESC key will exit the menu and return null.  This menu library requires the use of an ANSI terminal.  By default, this menu library does not display a border around the menu.  If you want this library to draw a border around the menu, you can set the borderEnabled property to true.  Without a border, the menu gains 2 characters of width and 2 lines of height. The user can navigate the list using the up & down arrows, PageUp, PageDown, Home, and End keys.  The enter key selects an item.  The ESC key will exit the menu and return null.  This menu library requires the use of an ANSI terminal.  By default, this menu library does not display a border around the menu.  If you want this library to draw a border around the menu, you can set the borderEnabled property to true.  Without a border, the menu gains 2 characters of width and 2 lines of height.
  
-This script provides a class, DDLightbarMenu.  To create a new DDLightbarMenu object: new DDLightbarMenu(width, height);+This script provides a class, DDLightbarMenu.  To create a new DDLightbarMenu object: new DDLightbarMenu(x, y, width, height);
  
 **DDLightbarMenu methods** **DDLightbarMenu methods**
 ^ Name                          ^ Returns          ^ Usage                                        ^ Description^ ^ Name                          ^ Returns          ^ Usage                                        ^ Description^
-| Add                           | void    | DDLightbarMenu.Add(text, retval, hotkey)     | Adds an item to the menu with a given item text, return value, and hotkey for the item |+| Add                           | void    | DDLightbarMenu.Add(text, retval, hotkey)     | Adds an item to the menu with a given item text, return value, and hotkey for the item.  If the ampersandHotkeysInItems property is set to true before this method is called, then a & can be used in the item text just before the hotkey you want to enable for the item.  For example, "Item &1" would display the text "Item 1" with "1" being the hotkey for the item. |
 | Remove                        | void    | DDLightbarMenu.Remove(idx)                   | Removes an item from the menu by its index | | Remove                        | void    | DDLightbarMenu.Remove(idx)                   | Removes an item from the menu by its index |
 | RemoveAllItems                | void    | DDLightbarMenu.RemoveAllItems()              | Removes all items from the menu | | RemoveAllItems                | void    | DDLightbarMenu.RemoveAllItems()              | Removes all items from the menu |
Line 31: Line 31:
 ^ Name                          ^ Type    ^ Description^ ^ Name                          ^ Type    ^ Description^
 | colors                       | object | An object that contains color codes (as strings) for various things.  Contains the following properties: itemColor, selectedItemColor, itemTextCharHighlightColor, borderColor | | colors                       | object | An object that contains color codes (as strings) for various things.  Contains the following properties: itemColor, selectedItemColor, itemTextCharHighlightColor, borderColor |
 +| borderEnabled                | boolean | Whether or not to draw a border around the menu items |
 | wrapNavigation               | boolean | Whether or not to wrap around to the beginning/end when using the down/up arrows.  Defaults to true. | | wrapNavigation               | boolean | Whether or not to wrap around to the beginning/end when using the down/up arrows.  Defaults to true. |
 | hotkeyCaseSensitive          | boolean | Whether or not hotkeys are case-sensitive.  Defaults to false. | | hotkeyCaseSensitive          | boolean | Whether or not hotkeys are case-sensitive.  Defaults to false. |