---
name: "CT EDIT"
type: topic
aliases: ["DialogControls-EditBox"]
source: https://community.bistudio.com/wiki/CT_EDIT
revid: 364738
updated: 2024-06-03T15:11:05Z
---

# CT EDIT

### Introduction

An **edit**able text **box**, which allows the user to either enter text himself or to select and copy its content.

#### Related commands & functions

- Commands: General
- Commands: UI Eventhandlers
- [endl](../commands/endl.md) (to insert line breaks)

#### Related User Interface Eventhandlers

- [Events: General](../topics/User_Interface_Event_Handlers.md#generic-events)

### Alphabetical Order

> [!NOTE]
> TokenNames common to most controls, such as x, y, w, h, text, idc... can be found [**here**](../topics/Arma~3A_GUI_Configuration.md#common-properties).

> [!WARNING]
> Not all of the listed attributes might have an effect nor might the list be complete. All attributes were gathered with [this](https://github.com/7erra/BIKI.VR/blob/master/fnc/generateCTPage.sqf) config crawler.

```cpp
#define CT_EDIT 2
```

#### A

##### autocomplete

**Type:** String, Number

**Description:** One of:

- "" (no autocompletion)
- "scripting" (entered text will automatically be completed with matching script command)
- "general" (autocomplete will use some of the last entered words like the chat does)

String example:

```cpp
autocomplete = "";
```

Number example:

```cpp
autocomplete = 0;
```

#### C

##### canModify

**Type:** Number

**Description:** When 0, only (optionally combined with <kbd>⇧ Shift</kbd>) <kbd>←</kbd>, <kbd>→</kbd>, <kbd>HOME</kbd>, <kbd>END</kbd> and <kbd>Ctrl</kbd> + <kbd>C</kbd> can be used

```cpp
canModify = 1;
```

##### colorActive

**Type:** Array

**Description:** n/a

```cpp
colorActive[] = {0.23,0.35,0.42,0.9};
```

##### colorSelection

**Type:** Array

**Description:** The text selection highlight color.

```cpp
colorSelection[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])",1};
```

#### F

##### forceDrawCaret

**Type:** Number

**Description:** When 1, the caret will be drawn even when control has no focus or is disabled.

```cpp
forceDrawCaret = 1;
```

#### L

##### linespacing

**Type:** Number

**Description:** n/a

```cpp
linespacing = 1;
```

#### M

##### maxChars

**Type:** Number

**Description:** The limit for how many characters could be displayed or entered, counting new line characters too.

```cpp
maxChars = 3;
```

### Default Classes

> [!NOTE]
> **Arma 3:** **AddOns:** Classes need to be initialised first with `class SomeClass;`
>
> ---
>
> **Missions:** Since Arma 3 v2.02 one can use `import SomeClass;` to initialise a class (see the [import](../topics/import_~28Config~29.md) keyword).
>
> In older versions, use `"Default" call BIS_fnc_exportGUIBaseClasses;` and paste the result into the [description.ext](../topics/Description.ext.md).

#### RscEdit

```cpp
class RscEdit
{
    deletable = 0;
    fade = 0;
    access = 0;
    type = CT_EDIT;
    x = 0;
    y = 0;
    h = 0.04;
    w = 0.2;
    colorBackground[] = {0,0,0,0};
    colorText[] = {0.95,0.95,0.95,1};
    colorDisabled[] = {1,1,1,0.25};
    colorSelection[] =
    {
        "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])",
        "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])",
        "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])",
        1
    };
    autocomplete = "";
    text = "";
    size = 0.2;
    style = ST_FRAME; // use ST_NO_RECT to remove the small frame
    font = "RobotoCondensed";
    shadow = 2;
    sizeEx = GUI_TEXT_SIZE_MEDIUM;
    canModify = 1;
    tooltipColorText[] = {1,1,1,1};
    tooltipColorBox[] = {1,1,1,1};
    tooltipColorShade[] = {0,0,0,0.65};
};
```

<sub>Source: [BI Community Wiki — CT EDIT](https://community.bistudio.com/wiki/CT_EDIT) (revision 364738).</sub>
