Skip to content
Snippets Groups Projects
Select Git revision
  • dailybuild_linux-x64
  • dailybuild_win32
  • master default protected
  • sqlite
  • rip_abstraction
  • dailybuild_macos-armv8
  • dd_file_lister_filanem_in_desc_color
  • mode7
  • dd_msg_reader_are_you_there_warning_improvement
  • c23-playing
  • syncterm-1.3
  • syncterm-1.2
  • test-build
  • hide_remote_connection_with_telgate
  • 638-can-t-control-c-during-a-file-search
  • add_body_to_pager_email
  • mingw32-build
  • cryptlib-3.4.7
  • ree/mastermind
  • new_user_dat
  • sbbs320d
  • syncterm-1.6
  • syncterm-1.5
  • syncterm-1.4
  • sbbs320b
  • syncterm-1.3
  • syncterm-1.2
  • syncterm-1.2rc6
  • syncterm-1.2rc5
  • push
  • syncterm-1.2rc4
  • syncterm-1.2rc2
  • syncterm-1.2rc1
  • sbbs319b
  • sbbs318b
  • goodbuild_linux-x64_Sep-01-2020
  • goodbuild_win32_Sep-01-2020
  • goodbuild_linux-x64_Aug-31-2020
  • goodbuild_win32_Aug-31-2020
  • goodbuild_win32_Aug-30-2020
40 results

lightbar.js

Blame
    • deuce's avatar
      23e149c2
      Fix hotkey functionality. · 23e149c2
      deuce authored
      Make spaces between horizontal options the default attribute.
      Rename uber-function to lightbar_func.
      Add object support.  Create a new Lightbar object with:
      var lb=new Lightbar();
      Or optionally specify items like so:
      var lb=new Lightbar([{text:"Option1",retval:"1"},{text:"Option2",retval:"2"}]);
      Add a new option to the end of the items like this:
      lb.add(text, retval [, width]);
      Clear the items array using:
      lb.clear();
      Execute the lightbar with:
      lb.getval([currentindex]); // Returns the retval for the selected item
      
      Properties are:
        xpos: Horizontal position of lightbar menu (1-based)
        xpos: Vertical position of lightbar menu (1-based)
        items: an array of objects each having the following properties:
               text - The displayed text.  A | prefixes a hotkey
               retval - The value to return if this is selected
             OPTIONAL Properties:
               width - The width of this item.  If not specified, is the width of
                       the text.  Otherwise, the text is truncated or padded with
                       spaces to fit the width.
        direction: 0 for vertical, 1 for horizontal.
                   Horizontal menus always have one space of padding added between
                   items.
        fg: Foreground colour of a non-current item
        bg: Background colour of a non-current item
        hfg: Foreground colour of a current item
        hbg: Background colour of a current item
        kfg: Hotkey forground colour for non-current item
        khfg: Hotkey foreground colour for current item
        current: Index of currently highlighted item (ToDo: This should be passed by reference (how?)!)
        align: If width is greater than the text length, a zero indicates the text
               should be left-aligned, a 1 indicates it should be right-aligned, and
               a 2 indicates it should be centered.
      
      The Lightbar object will display a list of options and prompt the user for
      a selection if lightbar_func() returns NULL.
      
      Still todo... make the current value stay at the last selected one.
      23e149c2
      History
      Fix hotkey functionality.
      deuce authored
      Make spaces between horizontal options the default attribute.
      Rename uber-function to lightbar_func.
      Add object support.  Create a new Lightbar object with:
      var lb=new Lightbar();
      Or optionally specify items like so:
      var lb=new Lightbar([{text:"Option1",retval:"1"},{text:"Option2",retval:"2"}]);
      Add a new option to the end of the items like this:
      lb.add(text, retval [, width]);
      Clear the items array using:
      lb.clear();
      Execute the lightbar with:
      lb.getval([currentindex]); // Returns the retval for the selected item
      
      Properties are:
        xpos: Horizontal position of lightbar menu (1-based)
        xpos: Vertical position of lightbar menu (1-based)
        items: an array of objects each having the following properties:
               text - The displayed text.  A | prefixes a hotkey
               retval - The value to return if this is selected
             OPTIONAL Properties:
               width - The width of this item.  If not specified, is the width of
                       the text.  Otherwise, the text is truncated or padded with
                       spaces to fit the width.
        direction: 0 for vertical, 1 for horizontal.
                   Horizontal menus always have one space of padding added between
                   items.
        fg: Foreground colour of a non-current item
        bg: Background colour of a non-current item
        hfg: Foreground colour of a current item
        hbg: Background colour of a current item
        kfg: Hotkey forground colour for non-current item
        khfg: Hotkey foreground colour for current item
        current: Index of currently highlighted item (ToDo: This should be passed by reference (how?)!)
        align: If width is greater than the text length, a zero indicates the text
               should be left-aligned, a 1 indicates it should be right-aligned, and
               a 2 indicates it should be centered.
      
      The Lightbar object will display a list of options and prompt the user for
      a selection if lightbar_func() returns NULL.
      
      Still todo... make the current value stay at the last selected one.