DialogControls-EditBox: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "{{Informative|TokenNames common to most controls, such as x, y, w, h, text, idc... are not listed here.}}" to "{{Informative|TokenNames common to most controls, such as x, y, w, h, text, idc... can be found [[Arma:_GUI_Configuration...)
m (linked data types)
Line 12: Line 12:
|-
|-
| '''autocomplete'''
| '''autocomplete'''
| string
| [[String]]
| "" or "scripting" (entered text will automatically be completed with matching script command)
| "" or "scripting" (entered text will automatically be completed with matching script command)
|-
|-
| '''canModify'''
| '''canModify'''
| boolean
| [[Boolean]]
| Optional. Default: true. When false, only LEFT/RIGHT/HOME/END, CTRL + C, SHIFT + LEFT/RIGHT/HOME/END keys are allowed
| Optional. Default: true. When false, only LEFT/RIGHT/HOME/END, CTRL + C, SHIFT + LEFT/RIGHT/HOME/END keys are allowed
|-
|-
| '''maxChars'''
| '''maxChars'''
| integer
| [[Integer]]
| Optional. Default: 2147483647. The limit for how many characters could be displayed or entered, counting new line characters too
| Optional. Default: 2147483647. The limit for how many characters could be displayed or entered, counting new line characters too
|-
|-
| '''forceDrawCaret'''
| '''forceDrawCaret'''
| boolean
| [[Boolean]]
| Optional. Default: false. When true, the caret will be drawn even when control has no focus or is disabled
| Optional. Default: false. When true, the caret will be drawn even when control has no focus or is disabled
|-
|-
| '''colorSelection'''
| '''colorSelection'''
| color
| [[Color]]
| The text selection highlight color
| The text selection highlight color
|-
|-
| '''colorText'''
| '''colorText'''
| color
| [[Color]]
| The color of the text, caret and border
| The color of the text, caret and border
|-
|-
| '''colorDisabled'''
| '''colorDisabled'''
| color
| [[Color]]
| The color of the text, caret and border when control is disabled
| The color of the text, caret and border when control is disabled
|-
|-
| '''colorBackground'''
| '''colorBackground'''
| color
| [[Color]]
| The color of the edit box background
| The color of the edit box background
|-
|-
| '''font'''
| '''font'''
| string
| [[String]]
| Font name
| Font name
|-
|-
| '''sizeEx'''
| '''sizeEx'''
| float
| [[Number]]
| Font size
| Font size
|-
|-

Revision as of 10:45, 30 March 2020

TokenNames common to most controls, such as x, y, w, h, text, idc... can be found here.

CT_EDIT=2

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

Properties
Name Type Remark
autocomplete String "" or "scripting" (entered text will automatically be completed with matching script command)
canModify Boolean Optional. Default: true. When false, only LEFT/RIGHT/HOME/END, CTRL + C, SHIFT + LEFT/RIGHT/HOME/END keys are allowed
maxChars Integer Optional. Default: 2147483647. The limit for how many characters could be displayed or entered, counting new line characters too
forceDrawCaret Boolean Optional. Default: false. When true, the caret will be drawn even when control has no focus or is disabled
colorSelection Color The text selection highlight color
colorText Color The color of the text, caret and border
colorDisabled Color The color of the text, caret and border when control is disabled
colorBackground Color The color of the edit box background
font String Font name
sizeEx Number Font size


Example output
  • Example Config:
class MyEdit
{
	idc = -1;
	type = 2;
	style = "16 + 512"; // multi line + no border
	x = 0;
	y = 0;
	h = 0.2;
	w = 1;
	font = "PuristaMedium";
	sizeEx = 0.04;
	autocomplete = "";
	canModify = true; 
	maxChars = 100; 
	forceDrawCaret = false;
	colorSelection[] = {0,1,0,1};
	colorText[] = {0,0,1,1};
	colorDisabled[] = {1,0,0,1}; 
	colorBackground[] = {0,0,0,0.5}; 
	text = __EVAL("Line 1" + endl + "Line 2" + endl + "Line 3"); // how to output multiline
};
class MyDialog
{
	idd = -1;
	class Controls
	{
		class Enabled: MyEdit
		{
			style = 16;
			colorBackground[] = {0,0,0,0};
		};
		class Disabled: MyEdit
		{
			onLoad = "_this select 0 ctrlEnable false";
			y = 0.3;
			maxChars = 18;
			forceDrawCaret = true;
		};
	};
};

createDialog "MyDialog";