"wrapPolicy"

The attribute "wrapPolicy" specifies where text (of a textEdit) can be wrapped in word wrap mode.

Synopsis

this.wrapPolicy(string w);

Parameter

Parameter Description
shape Name of the object
w

Word-wrap:

  • Anywhere - Break anywhere, including within words.

  • AtWordBoundary - Break lines at word boundaries, e.g. spaces or newlines.

  • AtWordOrDocumentBoundary - Break lines at whitespace, e.g. spaces or newlines if possible. Break it anywhere otherwise.

Description

The attribute "wrapPolicy" specifies where text can be wrapped in word wrap mode.

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. The wrap policy is set to "Anywhere". This means break anywhere, including within the words.(the 20th character is written on the new line and not the whole word).

main(bool enter)
{
  this.wordWrap = "FixedColumnWidth";
  int wrpW = 20;
  this.wrapColumnOrWidth(wrpW);
  this.wrapPolicy = "Anywhere" /* break anywhere, including within the words*/
}

Assignment

TextEdit