summaryrefslogtreecommitdiff
path: root/redo/controls_windows.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-07-26 06:57:11 -0400
committerPietro Gagliardi <[email protected]>2014-07-26 06:57:11 -0400
commit4515849e22e36caade729243879b7a81a4e5b5d5 (patch)
treef7bcdab100c59936d39d04a41ed05a1efeb86e5c /redo/controls_windows.go
parent52e75e6ccea69025eb807c82beec700f827b7dba (diff)
Implemented TextField on Windows.
Diffstat (limited to 'redo/controls_windows.go')
-rw-r--r--redo/controls_windows.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/redo/controls_windows.go b/redo/controls_windows.go
index 68ea05b..3d9da3e 100644
--- a/redo/controls_windows.go
+++ b/redo/controls_windows.go
@@ -125,3 +125,35 @@ func checkboxToggled(data unsafe.Pointer) {
c.clicked.fire()
println("checkbox toggled")
}
+
+type textField struct {
+ *widgetbase
+}
+
+var editclass = toUTF16("EDIT")
+
+func startNewTextField(style C.DWORD) *textField {
+ w := newWidget(editclass,
+ style | C.ES_LEFT | C.ES_NOHIDESEL | C.WS_BORDER | C.WS_TABSTOP,
+ C.WS_EX_CLIENTEDGE)
+ C.controlSetControlFont(w.hwnd)
+ return &textField{
+ widgetbase: w,
+ }
+}
+
+func newTextField() *textField {
+ return startNewTextField(0)
+}
+
+func newPasswordField() *textField {
+ return startNewTextField(C.ES_PASSWORD)
+}
+
+func (t *textField) Text() string {
+ return t.text()
+}
+
+func (t *textField) SetText(text string) {
+ t.settext(text)
+}