Edit Box

Edit control, with functionality to edit single/multiline text. Edit Box example

Property Default Value Description
id empty id (name) of the script data object associated with control
text empty initial text of the control. Will be taken if no variable is bound (variable in dialog storage with name corresponding to id property)
align stretched Alignment of the control
style none Styles of the edit control (can be combined)
required false required property of the control (if control is initial, “positive” buttons will be disabled)
minwidth 0 Minimum width, in characters, of the edit box control
minheight 0 Minimum heights, in characters, of the edit box control. Only relevant for multiline edit box
cuebanner empty Prompt shown in control background if no text is entered
autocomplete empty Autocomplete mode
Style Description
none Default mode
password Characters are hidden under asterisk symbols (used for password fields)
lowercase Characters are auto converted to lower case
uppercase Characters are auto converted to UPPER case
number Control allows only decimal digits (0-9) to be entered
readonly Control is grayed and displayed text is not editable
multiline Editor allows to show multiline text (height may be controlled with minheight property)
wantreturn Editor accepts Enter keystroke for inserting new line
wordwrap Editor does a word wrap of lines, if it does not fit into control width and horizontal scrolling is disabled
vscroll Control shows vertical scroll bar (in multiline mode only)
hscroll Control shows horizontal scroll bar (in multiline mode only)
edit_ctrl.hejs
var dialog_template = 
'@<dialog title="Edit Test dialog" resizing="both" id="test2"> \
   <edit id="text2" text="Sample text"/> \
   <edit id="text1" cuebanner="Enter here something"/> \
   <edit id="text3" text="password" style="password"/> \
   <edit id="text4" text="123abc" style="number"/> \
   <edit id="text5" text="readonly" style="readonly"/> \
   <edit id="text6" text="UppER" style="uppercase"/> \
   <columnbreak/> \
   <edit id="text7" cuebanner="Enter URL" autocomplete="url"/> \
   <paragraph id="label1" text="Required field:" style="required"/> \
   <edit id="text8" text="required" required="true"/> \
   <edit id="user_val" cuebanner="Enter here something" style="multiline|wordwrap|wantreturn|vscroll" minheight="5"/> \
   <group uniform="true" align="right"> \
	   <button title="&amp;OK" returnval="ok" default="true"/> \
	   <button title="&amp;Cancel" returnval="cancel"/> \
   </group> \
</dialog>@';
dialog(dialog_template);