# 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
- getPreferredSize
- new
- onTextChange
- positionUpdate
- setAlign
- 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 for the current dimension of the textfield
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
getPreferredSize (MultiLineLabel)
  returns: (w,h)
  returns the preferred size, which is the longest line in width and the sum of all lineheights in height
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.
setAlign (MultiLineLabel,align)
  returns: ()
  Sets the alignment of the text
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:
  1. rect: Rectangle info of size and position of zone
  2. description: linkstring info
  3. l2d: the l2dtext node where the line is located
  4. strstart: position where the linked string starts (including the link)
  5. 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_ALIGNBOTTOM, LABEL_ALIGNCENTERED, LABEL_ALIGNLEFT, LABEL_ALIGNRIGHT, LABEL_ALIGNTOP, createVisibles, deleteVisibles, getAlignment, getMaxLines, getTabWidth, getText, isFocusable, maxLineCount, mouseClicked, new, onGainedFocus, onTextChange, positionUpdate, setAlignment, setFontColor, setTabWidth, setText, textDimensions, toString, wrapLine

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