{"name":"CT EDIT","title":"CT EDIT","type":"topic","url":"https://community.bistudio.com/wiki/CT_EDIT","revid":364738,"updated":"2024-06-03T15:11:05Z","aliases":["DialogControls-EditBox"],"markdown":"### Introduction\n\nAn **edit**able text **box**, which allows the user to either enter text himself or to select and copy its content.\n\n#### Related commands & functions\n\n- Commands: General\n- Commands: UI Eventhandlers\n- endl (to insert line breaks)\n\n#### Related User Interface Eventhandlers\n\n- Events: General\n\n### Alphabetical Order\n\n> [!NOTE]\n> TokenNames common to most controls, such as x, y, w, h, text, idc... can be found **here**.\n\n> [!WARNING]\n> 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.\n\n```cpp\n#define CT_EDIT 2\n```\n\n#### A\n\n##### autocomplete\n\n**Type:** String, Number\n\n**Description:** One of:\n\n- \"\" (no autocompletion)\n- \"scripting\" (entered text will automatically be completed with matching script command)\n- \"general\" (autocomplete will use some of the last entered words like the chat does)\n\nString example:\n\n```cpp\nautocomplete = \"\";\n```\n\nNumber example:\n\n```cpp\nautocomplete = 0;\n```\n\n#### C\n\n##### canModify\n\n**Type:** Number\n\n**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\n\n```cpp\ncanModify = 1;\n```\n\n##### colorActive\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorActive[] = {0.23,0.35,0.42,0.9};\n```\n\n##### colorSelection\n\n**Type:** Array\n\n**Description:** The text selection highlight color.\n\n```cpp\ncolorSelection[] = {\"(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};\n```\n\n#### F\n\n##### forceDrawCaret\n\n**Type:** Number\n\n**Description:** When 1, the caret will be drawn even when control has no focus or is disabled.\n\n```cpp\nforceDrawCaret = 1;\n```\n\n#### L\n\n##### linespacing\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nlinespacing = 1;\n```\n\n#### M\n\n##### maxChars\n\n**Type:** Number\n\n**Description:** The limit for how many characters could be displayed or entered, counting new line characters too.\n\n```cpp\nmaxChars = 3;\n```\n\n### Default Classes\n\n> [!NOTE]\n> **Arma 3:** **AddOns:** Classes need to be initialised first with `class SomeClass;`\n>\n> ---\n>\n> **Missions:** Since Arma 3 v2.02 one can use `import SomeClass;` to initialise a class (see the import keyword).\n>\n> In older versions, use `\"Default\" call BIS_fnc_exportGUIBaseClasses;` and paste the result into the description.ext.\n\n#### RscEdit\n\n```cpp\nclass RscEdit\n{\n    deletable = 0;\n    fade = 0;\n    access = 0;\n    type = CT_EDIT;\n    x = 0;\n    y = 0;\n    h = 0.04;\n    w = 0.2;\n    colorBackground[] = {0,0,0,0};\n    colorText[] = {0.95,0.95,0.95,1};\n    colorDisabled[] = {1,1,1,0.25};\n    colorSelection[] =\n    {\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])\",\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])\",\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])\",\n        1\n    };\n    autocomplete = \"\";\n    text = \"\";\n    size = 0.2;\n    style = ST_FRAME; // use ST_NO_RECT to remove the small frame\n    font = \"RobotoCondensed\";\n    shadow = 2;\n    sizeEx = GUI_TEXT_SIZE_MEDIUM;\n    canModify = 1;\n    tooltipColorText[] = {1,1,1,1};\n    tooltipColorBox[] = {1,1,1,1};\n    tooltipColorShade[] = {0,0,0,0.65};\n};\n```","sections":[{"heading":"Introduction","level":3,"markdown":"An **edit**able text **box**, which allows the user to either enter text himself or to select and copy its content."},{"heading":"Related commands & functions","level":4,"markdown":"- Commands: General\n- Commands: UI Eventhandlers\n- endl (to insert line breaks)"},{"heading":"Related User Interface Eventhandlers","level":4,"markdown":"- Events: General"},{"heading":"Alphabetical Order","level":3,"markdown":"> [!NOTE]\n> TokenNames common to most controls, such as x, y, w, h, text, idc... can be found **here**.\n\n> [!WARNING]\n> 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.\n\n```cpp\n#define CT_EDIT 2\n```"},{"heading":"A","level":4,"markdown":""},{"heading":"autocomplete","level":5,"markdown":"**Type:** String, Number\n\n**Description:** One of:\n\n- \"\" (no autocompletion)\n- \"scripting\" (entered text will automatically be completed with matching script command)\n- \"general\" (autocomplete will use some of the last entered words like the chat does)\n\nString example:\n\n```cpp\nautocomplete = \"\";\n```\n\nNumber example:\n\n```cpp\nautocomplete = 0;\n```"},{"heading":"C","level":4,"markdown":""},{"heading":"canModify","level":5,"markdown":"**Type:** Number\n\n**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\n\n```cpp\ncanModify = 1;\n```"},{"heading":"colorActive","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorActive[] = {0.23,0.35,0.42,0.9};\n```"},{"heading":"colorSelection","level":5,"markdown":"**Type:** Array\n\n**Description:** The text selection highlight color.\n\n```cpp\ncolorSelection[] = {\"(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};\n```"},{"heading":"F","level":4,"markdown":""},{"heading":"forceDrawCaret","level":5,"markdown":"**Type:** Number\n\n**Description:** When 1, the caret will be drawn even when control has no focus or is disabled.\n\n```cpp\nforceDrawCaret = 1;\n```"},{"heading":"L","level":4,"markdown":""},{"heading":"linespacing","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\nlinespacing = 1;\n```"},{"heading":"M","level":4,"markdown":""},{"heading":"maxChars","level":5,"markdown":"**Type:** Number\n\n**Description:** The limit for how many characters could be displayed or entered, counting new line characters too.\n\n```cpp\nmaxChars = 3;\n```"},{"heading":"Default Classes","level":3,"markdown":"> [!NOTE]\n> **Arma 3:** **AddOns:** Classes need to be initialised first with `class SomeClass;`\n>\n> ---\n>\n> **Missions:** Since Arma 3 v2.02 one can use `import SomeClass;` to initialise a class (see the import keyword).\n>\n> In older versions, use `\"Default\" call BIS_fnc_exportGUIBaseClasses;` and paste the result into the description.ext."},{"heading":"RscEdit","level":4,"markdown":"```cpp\nclass RscEdit\n{\n    deletable = 0;\n    fade = 0;\n    access = 0;\n    type = CT_EDIT;\n    x = 0;\n    y = 0;\n    h = 0.04;\n    w = 0.2;\n    colorBackground[] = {0,0,0,0};\n    colorText[] = {0.95,0.95,0.95,1};\n    colorDisabled[] = {1,1,1,0.25};\n    colorSelection[] =\n    {\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])\",\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])\",\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])\",\n        1\n    };\n    autocomplete = \"\";\n    text = \"\";\n    size = 0.2;\n    style = ST_FRAME; // use ST_NO_RECT to remove the small frame\n    font = \"RobotoCondensed\";\n    shadow = 2;\n    sizeEx = GUI_TEXT_SIZE_MEDIUM;\n    canModify = 1;\n    tooltipColorText[] = {1,1,1,1};\n    tooltipColorBox[] = {1,1,1,1};\n    tooltipColorShade[] = {0,0,0,0.65};\n};\n```"}],"categories":["Control Types"],"groups":["GUI"]}