Standard single line input element behavior
that have this behavior applied by default (see master_style_sheet):
<input type=“text” /> - inline single line <widget type=“text”></widget> that this behavior knows about:
value=“text” - initial value of the input elementsize=integer - determines value of (intrinsic and default) width of the element.maxlength=integer - maximum number of characters that this element can contain.filter=“filter-expr” - limits set of characters allowed to input in the field. filter-expr string accepts single characters and character ranges. Example: ”.@0~9a~zA~Z” - all alpha-numeric characters, '.' and '@'. If you just want to exclude some characters then you can prepend filter with '^' sign. So this filter=“^.,-” filter will allow to input any character except '.', ',' and '-'. novalue=“text” - if textbox is empty then it shows text provided by the novalue attribute. You can style this state by using :empty CSS selector.Together with the standard set of events (mouse, keyboard, focus) behavior: button generates:
type json::value::V_STRING, reflects current status of internal editing buffer.
Edit supports following xcall() methods (see dom::element::xcall() function):
xcall(“selectionStart”): int - return selection starting position;xcall(“selectionEnd”): int - return selection ending position;xcall(“setSelection”, start:int, end:int):void - sets position of the selection in the edit field;xcall(“selectionText”): string - returns selected text;xcall(“insertText”, text: string):void - inserts text at caret position;xcall(“appendText”, text: string):void - appends text;xcall(“undo”, false): bool - returns boolean wrapped into json::value, true - if undo is available and false if not;xcall(“undo”, true) - executes undo operation;xcall(“cut”, false): bool - returns true - if cut is available and false if not;xcall(“cut”, true) - executes cut operation - copy selection into the clipboard and deletes selected text;xcall(“copy”, false): bool - returns true - if copy is available and false if not;xcall(“copy”, true) - executes copy operation - copy selection into the clipboard;xcall(“paste”, false): bool - returns true - if paste is available and false if not;xcall(“paste”, true) - executes paste operation - pastes content of the the clipboard;xcall(“selectAll”): bool - returns true if current selection spans the whole document and false otherwise. xcall(“selectAll”, true) - selects whole content of the editor;Note that in Sciter you can access these methods simply as:
var edit = self.select("input[type='text']");
edit.setSelection(0,10);
var selStart = edit.selectionStart;