Skip to content

Commit e19d3b0

Browse files
committed
initial implementation of text field
1 parent eadc666 commit e19d3b0

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

lib/ui/core.jsx

+29
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,35 @@ class Button extends Control {
535535

536536
class TextField extends Control {
537537

538+
// FIXME KAZUHO circular reference
539+
var _node = web.dom.document.createElement("INPUT") as web.HTMLInputElement;
540+
541+
function constructor() {
542+
}
543+
544+
function constructor(text : string) {
545+
this._node.value = text;
546+
}
547+
548+
function getValue() : string {
549+
return this._node.value;
550+
}
551+
552+
function setValue(text : string) : void {
553+
this._node.value = text;
554+
}
555+
556+
override function _toElement() : web.HTMLElement {
557+
var element = super._toElement(); // <div>
558+
559+
element.appendChild(this._node);
560+
561+
var style = this._node.style;
562+
style.width = "100%";
563+
564+
return element;
565+
}
566+
538567
}
539568

540569

0 commit comments

Comments
 (0)