PtMultiText

Gamma/Photon: Using Gamma™ with the Photon microGUIŽ, Version 4.0
Prev |  | Next

# `PtMultiText`

`PtMultiText` -- A text box that supports multiple lines and various text styles.

## Synopsis

    class PtMultiText PtContainer
    {
        multitext_bottom_line;          // long  (Pt_ARG_MULTITEXT_BOTTOM_LINE)
        multitext_flags;                // flag  (Pt_ARG_MULTITEXT_FLAGS)
        multitext_line_spacing;         // short  (Pt_ARG_MULTITEXT_LINE_SPACING)
        multitext_num_lines;            // integer  (Pt_ARG_MULTITEXT_NUM_LINES)
        multitext_num_lines_visible;    // short  (Pt_ARG_MULTITEXT_NUM_LINES_VISIBLE)
        multitext_rows;                 // long  (Pt_ARG_MULTITEXT_ROWS)
        multitext_top_line;             // long  (Pt_ARG_MULTITEXT_TOP_LINE)
        multitext_wrap_flags;           // flag  (Pt_ARG_MULTITEXT_WRAP_FLAGS)
        multitext_x_scroll_pos;         // short  (Pt_ARG_MULTITEXT_X_SCROLL_POS)
        multitext_y_scroll_pos;         // long  (Pt_ARG_MULTITEXT_Y_SCROLL_POS)
    }

## Base Classes

`PtWidget` <-- `PtBasic` <-- `PtContainer` <-- `PtMultiText`

## Description

This widget is a text box that offers basic word-processing capabilities such as multiple lines, wrapping, cut/copy/paste, range selection, tabs, multiple fonts and so on.

| For detailed information, please refer to PtMultiText in the Photon documentation.

## Instance Variables

multitext_bottom_line

  A number. Setting this variable to any value, including nil, puts the bottom line of the text at the bottom of the widget display.

multitext_flags

  This instance variable controls the behavior and display of the widget, and may be a combination of zero or more of the following flags:

  Constant | Description
  --- | ---
  `Pt_EMT_AUTOINDENT` | Indents a new line to match previous line.
  `Pt_EMT_FULL_LINES` | The line of text requires sufficient space for ascenders and descenders.
  `Pt_EMT_FORCED_SCROLL` | Forces scrolling when a blank space follows text at the end of the widget.
  `Pt_EMT_SCROLL_TO_CURSOR` | Scrolling tracks cursor movements.
  `Pt_DEFAULT_COLOR` | Internal informational bit.
  `Pt_INHERIT_COLOR` | Internal informational bit.
  `Pt_DEFAULT_FONT` | Internal informational bit.
  `Pt_INHERIT_FONT` | Internal informational bit.
  `Pt_MERGE_PREV` | Internal informational bit.
  `Pt_MERGE_NEXT` | Internal informational bit.

multitext_line_spacing

  A number specifying how many pixels to separate each line of text. Default is `0`.

multitext_num_lines

  A read-only number that indicates the total number of lines in the text of the widget.

multitext_num_lines_visible

  A read-only number that indicates the number of lines of text that are visible in the display.

multitext_rows

  A number of rows that you wish to have visible in the display. This value resizes the widget as necessary, but is applied only once. If the font size changes, the widget won't resize itself automatically; you must assign this variable again to the same value if you wish to keep the same number of rows visible.

multitext_top_line

  A number indicating which line of text is at the top of the display. The lines are numbered consecutively starting with 1.

multitext_wrap_flags

  Flags that control how text is wrapped. The default value is `Pt_EMT_WORD` | `Pt_EMT_NEWLINE`, which applies standard word wrapping.

  This instance variable may be a combination of zero or more of the following flags:

  Constant | Description
  --- | ---
  `Pt_EMT_WORD` | The text wraps at spaces between words.
  `Pt_EMT_CHAR` | The text wraps at the ends of lines.
  `Pt_EMT_NEWLINE` | The text wraps at carriage returns.

multitext_x_scroll_pos

  A number indicating the horizontal scroll position in pixels.

multitext_y_scroll_pos

  A number indicating which line of text at the top of the display.

## Associated Classes

`PtMultiTextAttributes`

## Convenience Functions

### Arguments

`widget` | A PtMultiText widget.
`start` | The start of the selected text.
`end` | The end of the selected text.
`insert_pos` | The point for insertion of text.
`text` | The source of the text to be inserted.
`length` | The number of characters to be inserted.
`attrs` | `PtMultiTextAttributes`
`attributes_mask` |

### Functions

These functions are extensions of QNX Photon functions. You can refer to the PtMultiText function documentation in QNX Helpviewer for more information about them.

`PtMultiTextModifyAttributes` `(widget, start, end, attrs, attributes_mask)` -- applies attributes to the selected range of characters in the `widget`, from `start` to `end`. The attributes are taken from `PtMultiTextAttributes`, but only the attributes specified in `attributes_mask` are applied.

Returns t.

`PtMultiTextModifyText` `(widget, start, end, insert_pos, text, length, attrs, attributes_mask)` -- modifies the contents and attributes of a `PtMultiText` widget. If `start` and `end` are equal, `length` characters are inserted from `text` at the `insert_pos`. If `start` and `end` are not equal, the selected text is deleted and `length` characters are inserted from `text`.

Returns t.

Prev | Home | Next
`PtMessage` | Up | `PtNumeric`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.