User Interface Controls > Common Properties > Layout > Types > Edittext |
An edittext control is used to place an editable text field where the user can type and edit text.
edittext <name> [<caption>] [text:<string>] [fieldWidth:<integer>] [height:<integer>] [bold:<boolean>] [labelOnTop:<boolean>] [readOnly:<boolean>] [toolTip:<string>]
The default alignment of edittext items is #left .
The text string in the edit box. To specify a multiline text as parameter, both carriage return \r and new line \n sequences should be specified, for example "First Line \r\nSecond Line".
The width in pixels of the edit box. By default, the width is set to be from just after the caption text to the right margin of the rollout.
If an explicit height: parameter is supplied on an editText item definition that specifies a pixel height greater than one line of text (18 pixels), that editText item becomes a multi-line edit box, allowing multiple lines of text to be entered.
WARNING!!! |
---|
If you specify the height of the edittext to be 18 pixels or more, the on entered event handler will not be called since the edittext will be in multi-line mode! |
If set to true , the text string in the edit box is displayed in bold format, if set to false , in normal, non-bold format. The default value is false .
If set to true , the caption is placed above the edit text box. If false or not specified, the caption is placed to the left of the edit text box.
When set to true , the user cannot copy and paste or enter text in the editText control. When false or not specified, the user can enter, copy and paste text in the editText control.
toolTip:
Provides text for a tooltip for the EditText; no tooltip if unsupplied. Available in in 3ds Max 2017 and higher.
The text in the edit box. To specify a multiline text as parameter, both carriage return \r and new line \n sequences should be specified, for example "First Line \r\nSecond Line".
The text of the optional caption next to the edit box.
If true , the text is displayed in bold format, if false , in normal, non-bold format.
Get/set the width of the edittext window in pixels.
Get/set the height of the edittext window in pixels.
When set to true , the user cannot copy and paste or enter text in the editText control. When false or not specified, the user can enter, copy and paste text in the editText control.
Called each time the user changes the text in the edit box; the <arg> argument will contain the new text in the edit box.
Called when the user enters text in the edit box and then presses ENTER or TAB to move the cursor out of the field. The <arg> argument will contain the new text in the edit box.
In single-line mode (default height, or less than18 pixels), if you enter a string in the edit box and then press ENTER, the on changed handler is called once per character and once for the ENTER. The on entered handler is just called once, for the ENTER.
When in multi-line mode, ENTER keystrokes no longer cause the 'on entered' handler to be called, but are inserted into the edit box as new lines.
They do, of course, cause 'on changed' handlers to be called. These are called on every keystroke.
For multi-line editText items, 'on entered' handlers are called when the edit box loses keyboard focus, such as if you tab or click out of the edit box.
Since 3ds Max 2015, pressing the ESC key will switch focus away from the editText control to its parent window.