"wordWrap"

The attribute "wordWrap" specifies the different word wrap modes.

Synopsis

this.wordWrap(string w);

Parameter

Parameter Description
shape Name of the object
w

The wrap mode:

  • "NoWrap" = Do not wrap the text.

  • "WidgetWidth" = Wrap the text at the current width of the widget (this is the default). Wrapping is at whitespace by default; this can be changed with "wrapPolicy".

  • "FixedPixelWidth" = Wrap the text at a fixed number of pixels from the widget's left side. The number of pixels is set with "wrapColumnOrWidth".

  • "FixedColumnWidth" = Wrap the text at a fixed number of character columns from the widget's left side. The number of characters is set with "wrapColumnOrWidth".

Description

The attribute "wordWrap" specifies the different word wrap modes.

Example

The code sets the wrap mode to "FixedColumnWidth" and sets the number of characters to 20 using"wrapColumnOrWidth". This means a word-wrap at the 20th character.

main(bool enter)
{
  this.wordWrap = "FixedColumnWidth";
  int wrpW = 20;
  this.wrapColumnOrWidth(wrpW);
}

Assignment

TextEdit