-
- Downloads
Fix hotkey functionality.
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.
Please register or sign in to comment