DialogControls-EditBox: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
Line 2: Line 2:
===CT_EDIT=2===
===CT_EDIT=2===
A text box allows the user to either enter text himself, or to select and copy its content.<br>
A text box allows the user to either enter text himself, or to select and copy its content.<br>
*Note that it is illogical to create an edit box with NO valid idc. The engine is quite capable of crashing if it has nowhere to send the text to (idc=-1) and Arrowhead configs specifically prevent this.
**If you wish to have the editbox STYLE, use CT_STATIC with ST_FRAME
{| border="1" cellpadding="3" cellspacing="0" |
{| border="1" cellpadding="3" cellspacing="0" |
! colspan="3" bgcolor="#bbbbff" | Properties
! colspan="3" bgcolor="#bbbbff" | Properties
Line 10: Line 13:
|-
|-
| '''autocomplete'''
| '''autocomplete'''
| string ("scripting")
| string  
| entered text will automatically be completed with matching command
| "", or "scripting" (entered text will automatically be completed with matching command) or "general"
|-
|-
| '''htmlControl'''
| '''htmlControl'''
Line 22: Line 25:
|-
|-
| '''colorSelection'''
| '''colorSelection'''
| color array
| color
|  
|  
|-
|-
| '''size'''
| '''size'''
| float
| float
| possibly a typo, perhaps irrelevant xbox control
| possibly a typo, perhaps irrelevant xbox property
|-
|-
|}<br clear="all">
|}<br clear="all">

Revision as of 10:08, 30 January 2012

TokenNames common to most controls, such as x,y,w,h,text,idc... are not listed here.

CT_EDIT=2

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

  • Note that it is illogical to create an edit box with NO valid idc. The engine is quite capable of crashing if it has nowhere to send the text to (idc=-1) and Arrowhead configs specifically prevent this.
    • If you wish to have the editbox STYLE, use CT_STATIC with ST_FRAME
Properties
Name Type Remark
autocomplete string "", or "scripting" (entered text will automatically be completed with matching command) or "general"
htmlControl boolean if used together with style=ST_MULTI, allows multi-line editable text fields.
lineSpacing float line spacing. Required, if the style was set to ST_MULTI.
colorSelection color
size float possibly a typo, perhaps irrelevant xbox property


  • Example:

class RscEdit { access = 0; type = CT_EDIT; style = ST_LEFT+ST_FRAME; x = 0; y = 0; h = 0.04; w = 0.2; colorBackground[] = {0,0,0,0}; colorText[] = {1,1,1,1}; colorSelection[] = {1,1,1,0.25}; font = "TahomaB"; sizeEx = 0.04; autocomplete = ""; text = ""; size = 0.2; shadow = 0; }; class dialog { class controls { class Value: RscEdit { idc = 120; // otherwise there's not much point x = 0.3025; y = 0.34; text = "whatever"; autocomplete = "scripting"; }; }; };