# Class: MultiLineLabel

### LuxModule: gui

A MultiLineLabel element for displaying longer texts. A text can be marked with a special syntax (see function description at new) which allows creating texts with clickable zones, similiar to a hypertext document.

## Hierarchy

    o-+ Component
      o-+ Label
        o-+ MultiLineLabel

## Methods:

### Method overview:

- addClickZone
- countLines
- createVisibles
- getColor
- new
- onTextChange
- positionUpdate
- setColor
- testForZone
- zoneAction

new (class, int x,y,w,h, text, boolean highlights, align,fontsize)
  returns: (MultiLineLabel)

  creates a labelwith the given dimensions. The align value can be a constant from the MultiLineLabel table (MultiLineLabel_ALIGNRIGHT, ...). If highlights is true, the displayed text is scanned for a special syntax that creates clickable zones on the component. The bounds of the zones are fitted on the marked text passages. The markers are stripped away and are not displayed. A marker can be set by inserting $$link...$$ into the text, where the ... can be just any string. This string is then used as zonedescription. To end a zone, a $$link$$ can be set.

addClickZone (self,x,y,w,h,description,l2d,strstart,strend)
  returns: ()
  Intern function that is used for adding a zone. A zone is an area on the multilinelabel that can receive mouseevents (i.e. for creating hyperlinks). This function is called when the multilinelabel is made visible and the l2d nodes for displaying are created. The last two values are telling the position of the linked textstring.
countLines (MultiLineLabel, text)
  returns: (lines)
  returns number of lines for this text
createVisibles (Component self,l2dnode basel2d)
  returns: ()

  description from overloaded method of Component:

  called when a Component is now displayable (doesn't have to be visible)
getColor (MultiLineLabel)
  returns: (float r,g,b,a)
  returns rgba for basecolor
onTextChange (MultiLineLabel)
  returns: ()
  called if the text changed (ie. by user input)
positionUpdate (Component self,int zindex,Rectangle clip)
  returns: (int newz)

  description from overloaded method of Component:

  called when the component was moved or resized. Overload this method for visual appearance. The zindex is the id to use for zordering the components. Return the newz value, reserving all the values that you require for your visual nodes.
setColor (float r,g,b,[a])
  returns: ()
  sets color for texts
testForZone (self,x,y)
  returns: ([table zone])
  tests if the coordinates (local) are inside a zone - the first hit is returned. The zone contains following value:
  - rect: Rectangle info of size and position of zone
  - description: linkstring info
  - l2d: the l2dtext node where the line is located
  - strstart: position where the linked string starts (including the link)
  - strend: position where the linked string ends (excluding the link)
zoneAction (self,string what,mouseevent,[zone])
  returns: ()
  called on mouseevent action. The 'what' value is either "exit", "moved" or "clicked" and describe the type of action. The zone is the retrieved zone for that mouseposition. If no zone was matched it is nil.

## Inherited Methods:

### From Label

LABEL_ALIGNCENTERED, LABEL_ALIGNLEFT, LABEL_ALIGNRIGHT, createVisibles, deleteVisibles, getAlignment, getText, isFocusable, mouseClicked, new, onGainedFocus, onTextChange, positionUpdate, setAlignment, setText, toString

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