CT EDIT: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Redirected page to DialogControls-EditBox)
 
(page overhaul)
Tag: Removed redirect
Line 1: Line 1:
#REDIRECT [[DialogControls-EditBox]]
{{CT|intro
|macro = CT_EDIT
|value = 2
|description =
An '''edit'''able text '''box''', which allows the user to either enter text himself or to select and copy its content.<br>
[[Image:CT_EDIT.jpg|500px]]
|commands =
|events =
}}
 
{{CT|abc start}}
=== A ===
{{CT|attribute
|name=autocomplete
|type1=String
|value1=""
|type2=Number
|value2=0
|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)
}}
 
=== C ===
{{CT|attribute
|name=canModify
|type1=Number
|value1=1
|description=When 0, only LEFT/RIGHT/HOME/END, CTRL + C, SHIFT + LEFT/RIGHT/HOME/END keys are allowed
}}
 
{{CT|attribute
|name=colorActive
|type1=Array
|value1={0.23,0.35,0.42,0.9}
|description=
}}
 
{{CT|attribute
|name=colorSelection
|type1=Array
|value1={"(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}
|description=The text selection highlight color.
}}
 
=== F ===
{{CT|attribute
|name=forceDrawCaret
|type1=Number
|value1=1
|description=When 1, the caret will be drawn even when control has no focus or is disabled.
}}
 
=== L ===
{{CT|attribute
|name=linespacing
|type1=Number
|value1=1
|description=
}}
 
=== M ===
{{CT|attribute
|name=maxChars
|type1=Number
|value1=3
|description=The limit for how many characters could be displayed or entered, counting new line characters too.
}}
 
{{CT|abc end}}
 
{{CT|examples}}
=== RscEdit ===
<syntaxhighlight lang="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;
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};
};
</syntaxhighlight>

Revision as of 13:09, 29 November 2020

Introduction

An editable text box, which allows the user to either enter text himself or to select and copy its content.
CT EDIT.jpg


Related commands & functions

Related User Interface Eventhandlers

Alphabetical Order

TokenNames common to most controls, such as x, y, w, h, text, idc... can be found here.
Not all of the listed attributes might have an effect nor might the list be complete. All attributes were gathered with this config crawler.
#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:

autocomplete = "";

Number example:

autocomplete = 0;


C

canModify

Type
Number
Description
When 0, only LEFT/RIGHT/HOME/END, CTRL + C, SHIFT + LEFT/RIGHT/HOME/END keys are allowed
canModify = 1;


colorActive

Type
Array
Description
n/a
colorActive[] = {0.23,0.35,0.42,0.9};


colorSelection

Type
Array
Description
The text selection highlight color.
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.
forceDrawCaret = 1;


L

linespacing

Type
Number
Description
n/a
linespacing = 1;


M

maxChars

Type
Number
Description
The limit for how many characters could be displayed or entered, counting new line characters too.
maxChars = 3;



Default Classes

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 keyword).

In older versions, use "Default" call BIS_fnc_exportGUIBaseClasses; and paste the result into the description.ext.

RscEdit

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;
	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};
};