Page tree
Skip to end of metadata
Go to start of metadata

Introduction

A text box allows the user to either enter text himself, or to select and copy its content.

Related commands: ctrlSetText, ctrlText

Demo mission: Dialog Demo.zip

Usage

A text field's content can be set via ctrlSetText, and read via ctrlText.

Properties

Only properties unique to this control type are listed. For general properties, see the Properties page.

Properties
NameTypeRemarkScript
typeIntegermust be 2 (or CT_EDIT, if using constants)-
styleIntegerCan be 0 (ST_LEFT), 1 (ST_RIGHT) or 2 (ST_CENTER) (for alignment options), or 16 (ST_MULTI) for multi-line textboxes.-
autocompleteStringEntered text will automatically be completed with matching command-
colorTextColorColor of text and the control's border. (If the new text & border-specific properties are defined, then they will override this setting for their specific situations, leaving 'colorText' to specify the text color for a control that is enabled, but doesn't have focus.)ctrlSetTextColor
colorTextActive (V3.4+)ColorColor of text when the mouse is hovering over it.-
colorTextFocused (V3.4+)ColorColor of text when the control has focus.-
colorTextDisabled (V3.4+)ColorColor of text when the control is disabled.-
colorBorder (V3.4+)ColorColor of the control's border when control is enabled, but doesn't have focus.-
colorBorderActive (V3.4+)ColorColor of the control's border when control is enabled and the mouse is hovering over it.-
colorBorderFocused (V3.4+)ColorColor of the control's border when the control has focus.-
colorBorderDisabled (V3.4+)ColorColor of the control's border when the control is disabled.-
htmlControlBooleanIf used together with style=ST_MULTI, allows multi-line editable text fields.
A line-break can be inserted via <br>, but an htmlControl does not support Structured_Text!
-
lineSpacingFloatLine spacing. Required, if the style was set to ST_MULTI.-
enableNewLine (V3.9+)IntegerAdds a new line to an ST_MULTI control (0 - cannot add a new line with the press of a key, 1 - add a new line by pressing Enter (the default value for edits with htmlControl set to true), 2 - add a new line by pressing Shift + Enter).-
textStringText to display initially.ctrlSetText

Example

class EDIT {
  idc = -1;
  type = CT_EDIT;
  style = ST_LEFT;
  x = 0;
  y = 0;
  w = .2;
  h = .4;
  sizeEx = .02;
  font = BitStream;
	
  text = "";
  colorText[] = {1,1,1,1};
	
  autocomplete = false;
  colorSelection[] = {0,0,0,1};
};