# Class: ListBox

### LuxModule: gui

A scrollable listbox.

## Hierarchy

    o-+ Component
      o-+ Container
        o-+ ListBox

## Methods:

### Method overview:

- addItem
- clearItems
- find
- getSelected
- new
- onSelected
- removeItem
- renameItem
- select

new (table class, int x,y,w,h,[Skin2D skin])
  returns: (ListBox)
  creates a listbox at the given coordinates with the given skin.
addItem (ListBox, string caption, [string cmd,[icon, iconskinselection] ])
  returns: ()
clearItems (ListBox)
  returns: ()
  deletes all items in the list
find (ListBox, id, string what)
  returns: ([index,caption,command])
  returns index of element in list that matches the search. If what is 'command', id is compared with the commands, if what is 'caption', the id is compared with the captions.
getSelected (ListBox)
  returns: ([int indx, string caption, command])
  returns the currently selected item
onSelected (ListBox,int index, string caption, string command)
  returns: ()
  this function can be overloaded without calling this function. It is called each time the user selects an item - which does not have to be different from the previously selected item.
removeItem (ListBox, int index, [string what])
  returns: ()
  removes item at given index. If what is 'command' then the index is searched of an item whichs command is equal to id, if what is 'caption' the id is compared with the caption.
renameItem (ListBox, int index, [caption],[command],[icon],[iconname])
  returns: ()
  renames an item at the given index
select (ListBox, string/int something, [boolean iscommand])
  returns: (int selected)
  selects the specified item by its name, number or commandstring

## Inherited Methods:

### From Container

add, components, delete, deleteChilds, getComponentAt, getForegroundContainer, getRootContainer, invalidate, isChildOf, isRootContainer, mouseEvent, new, onDisplayChange, onVisibilityChange, removeChilds, removeComponent, toString, validate

### From Component

acceptSkinBounds, addKeyListener, addMouseListener, clipinsets, colors, contains, createVisibles, delete, deleteVisibles, focus, focuscolors, getBounds, getClipRect, getFocusComponentAt, getFocusElement, getFocusIndex, getHeight, getLocation, getMinSize, getMouseLock, getParent, getSize, getSkin, getWidth, getX, getY, hasFocus, hideVisibles, index, invalidate, isClipped, isDisplayedFlag, isFocusable, isMouseLocker, isVisible, isVisibleFlag, keyEvent, keylisteners, local2world, lockMouse, mouseClicked, mouseEntered, mouseEvent, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheeled, mouselisteners, moveToRect, new, newFocusOrder, onDestroy, onDisplayChange, onGainedFocus, onLostFocus, onVisibilityChange, positionUpdate, remove, removeKeyListener, removeMouseListener, setBounds, setClip, setColor, setDisplayable, setFont, setLocation, setSize, setSkin, setVisibility, showVisibles, skinnames.defaultskin, skinnames.focusedskin, skinnames.hoveredskin, skinnames.pressedskin, think, toString, transferFocus, transferFocusOnArrows, transferFocusOnTab, unlockMouse, updateSkin, validate, white, world2local, zorderoffset