UIIndex.gif Previous-2.gif Next-3.gif

UItext


Synopsis

input or output a text string

UIprimitive UItext {
width = 100;
height = 30;

string+OPort2 text;
int rows;
int columns;
int resizeToText;
int multiLine;
int outputOnly;
int updateMode;
int showLastPosition<NEvisible=0>=0;

omethod+notify_inst+notify update<NEvisible=0,interruptable=0,lang="cxx"> = "UItextUpdate";
};

Description

UItext is a widget for entering text strings, or for displaying text strings that the user cannot alter.

Note : Use UIfield instead for numeric input/output.

•      See UIdynamic_toggle

Subobjects

message

UIprimitive class attribute.

x; y;
width =100;
height =30;

UIgeom class attributes.

* parent;
grouptoParent;
&cursor;
events <Not visible in Network Editor>;

UIwindow class attributes

shellParent <Not visible in Network Editor>;
canHaveChildren <Not visible in Network Editor>

UIConnection class attributes inherited from UIwindow.

&visible=0;
&active;
pixmap;
color;
fontAttribute;
fontlist <No longer used. Not visible in Network Editor>;
cxxhandle <Internal Object. Not visible in Network Editor>;
handle <Internal Object. Not visible in Network Editor> + Oport2;
window_resources <No longer used. Not visible in Network Editor>;
motif_resources <No longer used. Not visible in Network Editor>;
layout <No longer used. Not visible in Network Editor>

Attributes inherited from UIcore class through UIwindow.

text

String. OPort2. The text that the user enters. Or, if outputOnly is set, the text to display to the user.

This subobject is read/write.

rows;
columns

Integers. Set the number of visible rows and columns to display.

There are interactions between UItext's rows/columns and other subobjects, including its base class UIwindow's width/height, and its own resizeToText and multiLine subobjects.

With UIwindow:

•      Whichever was set last (width/height or rows/columns) prevails.

•      "Setting" includes automatic resizes to this widget that occur when a parent UIapp or UIshell is resized. In this case, width/height always reflects the current size. However, width/height reflect the current size only if the Layout Editor is on.

•      width/height are rounded down to match an explicitly set rows/columns.

With resizeToText:

•      If resizeToText is on, rows/columns and width/height are automatically reset to match the current state of the text field.

With multiLine:

•      If rows > 1, multiLine is automatically turned on.

•      If multiLine is on, when the text acquires a new line, rows is automatically updated.

resizeToText

Integer. When on (any value except 0, the default):

•      If multiLine is on, the text automatically wraps when the columns value is reached.

•      If multiLine is off, the window grows wider if the columns value is exceeded.

When off:

•      If multiLine is off, the user must scroll up/down with the arrow keys when the text exceeds the single row.

•      The usermust scroll left/right with the arrow keys when the text exceeds the columns value.

multiLine

Integer. When on (any value other than 0), the user can enter multiple lines of text. rows > 1 automatically turns on multiLine. Otherwise, the default is off.

To enter multiple lines:

•      Conclude each line with Ctrl-Enter.

•      Conclude the entire entry with Enter.

outputOnly

Integer. When on (any value other than 0), the UItext text "typein" window becomes a read-only window that the user cannot alter. The default is off.

updateMode

Integer. Specifies the user action that will apply the current string value in the widget to the text subobject. Valid values for updateMode (which can be OR'ed to produce combinations of actions) are:

•      0 -- The widget value is not updated under any circumstances.

•      1 (the default) -- The widget value is applied when the user presses Enter (or Ctrl-Enter, in the case of a multiline text widget).

•      2 -- The widget value is applied when the the widget loses keyboard focus.

•      4 -- The widget value is applied when the the widget loses pointer focus.

showLastPosition

Integer. The default is 0.

Example

Main.Filters.data_math
v/modules.v
Examples.Applications.UIApp
examples/ui_samp.v

File

v/UI.v

See Also

Related modules:

•      UIdynamic_toggle

•      UIwindow

•      UItextTypein

 



UIIndex.gif Previous-2.gif Next-3.gif