# Class: Checkbox

### LuxModule: gui

A Checkbox component. Basicly it is a slightly modified Button and works in the same ways like the Button. The checkbox class is using the icon to display the checkbox next to the text.

You can create and use a checkbox in this way:

     ck = Checkbox:new(10,90,200,24,"Check me out!")
     function ck:onClicked(state)
       if (state) then print("I am checked")
       else print("I am unchecked") end
     end
     Container.getRootContainer():add(ck)

The following skinssurface names are used by the checkbox class:

1. checkedcheckbox_pressed
2. checkedcheckbox
3. checkedcheckbox_hovered
4. checkedcheckbox_hovered_pressed
5. checkedcheckbox_focused
6. checkedcheckbox_focused_hovered
7. checkedcheckbox_focused_pressed
8. checkedcheckbox_focused_hovered_pressed

9. checkbox_pressed
10. checkbox
11. checkbox_hovered
12. checkbox_hovered_pressed
13. checkbox_focused
14. checkbox_focused_hovered
15. checkbox_focused_pressed
16. checkbox_focused_hovered_pressed

## Hierarchy

    o-+ Component
      o-+ Button
        o-+ Checkbox

## Methods:

new (class, float x,y,w,h, string caption, [Skin2D skin,Icon] ])
  returns: (Checkbox)

  Creates a checkbox at given location and with given size. The caption is automaticly set to be aligned left on the skin and vertically centered. It also activates the autowidth parameter of the skin and makes the button it was derived from pushable.

skinnameschecked
  {[table]} - skinnames in case the element is checked
skinnamesunchecked
  {[table]} - skinnames in case the element is not checked

## Inherited Methods:

### From Button

actionListeners, addActionListener, clicked, dataButton, dataButton.isFocusable, dataButton.mouseover, dataButton.pressed, dataButton.pressedMouseButton, dataButton.pressedSince, deleteVisibles, getDoubleClickTriggerOnly, hideVisibles, isFocusable, isPushButton, isPushed, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, new, onAction, onClicked, positionUpdate, removeActionListener, setCustomL2d, setDisplayable, setDoubleClickTriggerOnly, setIcon, setPushState, setPushable, setText, setVisibility, toString

### 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, 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