# Class: ListBox

### LuxModule: gui

A scrollable listbox.

## Hierarchy

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

## Methods:

### Method overview:

- addItem
- clearItems
- find
- getSelected
- itemCount
- 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
itemCount (table class)
  returns: (n)
  returns the number of items in the list.
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, doLayout, getComponentAt, getRootContainer, invalidate, isChildOf, isRootContainer, mouseEvent, moveZ, new, onDisplayChange, onVisibilityChange, removeChildren, removeComponent, setBounds, toString, validate

### From Component

acceptSkinBounds, addKeyListener, addMouseListener, addTooltipListener, clipinsets, colors, contains, createVisibles, delete, deleteVisibles, fadeTo, focus, focuscolors, getBottom, getBounds, getClipRect, getFocusComponentAt, getFocusElement, getFocusIndex, getHeight, getLocation, getMinSize, getMouseLock, getMouseLockPos, getParent, getRight, getSize, getSkin, getTooltip, 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, removeTooltipListener, setBounds, setClip, setColor, setDefaultUI, setDisabled, setDisplayable, setFont, setLocation, setSize, setSkin, setTooltip, setVisibility, showTooltipInformation, showVisibles, skinnames.defaultskin, skinnames.focusedskin, skinnames.hoveredskin, skinnames.pressedskin, think, toString, transferFocus, transferFocusOnArrows, transferFocusOnTab, unlockMouse, updateSkin, validate, validateFocus, white, world2local, zorderoffset