Skip to content
Snippets Groups Projects
  1. Jan 06, 2006
  2. Jan 04, 2006
  3. Dec 30, 2005
    • deuce's avatar
      Don't even frob console.terminal. · 4cc04dfa
      deuce authored
      4cc04dfa
    • deuce's avatar
      Use a global var rather than diddling terminal. · d2624909
      deuce authored
      d2624909
    • deuce's avatar
      Remove testing code. · 1b4e0297
      deuce authored
      1b4e0297
    • deuce's avatar
      Add force_width property, overrides the per-item and auto widths if set to · 22039a33
      deuce authored
      a non-zero positive number.
      22039a33
    • deuce's avatar
      Add support for separators... any item without a retval can no longer be · 72fca244
      deuce authored
      selected and acts as a seperator.  Pipe-codes still result in highlighting,
      but the "hotkey" isn't.
      72fca244
    • deuce's avatar
      Remove ToDo for pass-by-reference. · bf28e7a7
      deuce authored
      bf28e7a7
    • deuce's avatar
      Remove procedural interface... it's too pug-nasty to use reliably, and · 1f539bc5
      deuce authored
      I can't find a way to pass a single numeric variable by reference.
      
      Oh well, JS is supposed to do objects anyways.  :-)
      1f539bc5
    • deuce's avatar
      Add some ToDo notes. · bf26e98e
      deuce authored
      bf26e98e
    • deuce's avatar
      Make the current item reflect the last retval. · 8e5a9cf2
      deuce authored
      ***NOTE***
      Current is the first item that had the returned retval, NOT necessarily
      the selected item (if the same retval is used by multiple items)
      8e5a9cf2
    • deuce's avatar
      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
    • deuce's avatar
      Basic lightbar function... does horizontal or vertical lightbars. · 2f533beb
      deuce authored
      Currently, there are WAY to many options... this needs a set of simplified
      wrappers and current needs to be passed by reference somehow.
      2f533beb
  4. Dec 29, 2005
  5. Dec 23, 2005
  6. Dec 22, 2005
  7. Dec 21, 2005
Loading