Skip to content
reduz edited this page Apr 10, 2014 · 10 revisions

Label

####Inherits: Range ####Category: Core

Brief Description

Control that displays formatted text.

Member Functions

Numeric Constants

  • ALIGN_LEFT = 0 - Align rows to the left (default).
  • ALIGN_CENTER = 1 - Align rows centered.
  • ALIGN_RIGHT = 2 - Align rows to the right (default).
  • ALIGN_FILL = 3 - Expand row whitespaces to fit the width.
  • VALIGN_TOP = 0 - Align the whole text to the top.
  • VALIGN_CENTER = 1 - Align the whole text to the center.
  • VALIGN_BOTTOM = 2 - Align the whole text to the bottom.
  • VALIGN_FILL = 3 - Align the whole text by spreading the rows.

Description

Label is a control that displays formatted text, optionally autowrapping it to the Control area. It inherits from range to be able to scroll wrapped text vertically.

Member Function Description

  • void set_align ( int align )

Set the alignmend mode to any of the ALIGN_* enumeration values.

  • int get_align ( ) const

Return the alignmend mode (any of the ALIGN_* enumeration values).

  • void set_text ( String text )

Set the label text. Text can contain newlines.

Return the label text. Text can contain newlines.

  • void set_autowrap ( bool enable )

Set autowrap mode. When enabled, autowrap will fit text to the control width, breaking sentences when they exceed the available horizontal space. When disabled, the label minimum width becomes the width of the longest row, and the minimum height large enough to fit all rows.

  • bool has_autowrap ( ) const

Return the state of the autowrap mode (see set_autowrap).

  • int get_line_height ( ) const

Return the height of a line.

  • int get_line_count ( ) const

Return the amount of lines.

Clone this wiki locally