Label

Label is derived from Control class.

[lide.widgets] ^1.0 lide.classes.controls.label 1.0

A static text control displays one or more lines of read-only text.

Label supports the three classic text alignments, label ellipsization i.e. replacing parts of the text with the ellipsis (“…”) if the label doesn’t fit into the provided space and also formatting markup with Label:SetLabelMarkup()


Constructor

Label class has a complex constructor:

object Label:new {
               number ID, string Name,
               object Parent, Text = 'My Label'
       }

Events

The following events are emitted by this class:

Event name Description
Widget.onEnter When the mouse moves onto this widget.
Widget.onLeave When the mouse moves out to this widget.

Inherited Methods

These methods are inherited from its super classes:

Class Method Description
Object:getID Returns object’s identifier.
Object:setID Sets the object identifier.
Object:getName Returns object’s name.
Object:setName Sets the object name.
Widget:getParent Returns object’s parent.
Widget:setParent Sets the object parent.
Widget:getPosX Returns object’s position related to X.
Widget:setPosX Sets the object position related to X.
Widget:getPosY Returns object’s position related to Y.
Widget:setPosY Sets the object position related to Y.
Widget:getWidth Returns object’s width.
Widget:setWidth Sets the object width.
Widget:getHeight Returns object’s height.
Widget:setHeight Sets the object height.
Widget:getBind Returns the wxWidgets object.

Label:getText

Returns the Label’s text, as it was passed to setText()

Note that the returned string may contains mnemonics (“&” characters) if they were passed to the setText() function; use getText(false) if they are undesired.

Also note that the returned string is always the string which was passed to setText().

Reimplemented from wxWindow.

string Label:getText( bool bMnemonics = true )

Label:setText

Sets the control’s label.

All “&” characters in the label are special and indicate that the following character is a mnemonic for this control and can be used to activate it from the keyboard (typically by using Alt key in combination with it). To insert a literal ampersand character, you need to double it, i.e. use “&&”. If this behaviour is undesirable, use setText(text, false) instead.

bool Label:setText( string sNewText, bMnemonics = true )