2024-01-17 23:54:19 -06:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"go.wit.com/toolkits/tree"
|
|
|
|
|
|
|
|
"go.wit.com/dev/andlabs/ui"
|
|
|
|
_ "go.wit.com/dev/andlabs/ui/winmanifest"
|
|
|
|
)
|
|
|
|
|
|
|
|
func newTextbox(p, n *tree.Node) {
|
|
|
|
if notNew(n) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
newt := new(guiWidget)
|
|
|
|
|
|
|
|
if n.State.Range.Low == 1 {
|
|
|
|
e := ui.NewEntry()
|
|
|
|
newt.uiEntry = e
|
|
|
|
newt.uiControl = e
|
2024-02-05 15:04:01 -06:00
|
|
|
newt.uiEntry.SetText(n.State.DefaultS)
|
2024-01-17 23:54:19 -06:00
|
|
|
|
|
|
|
e.OnChanged(func(spin *ui.Entry) {
|
2024-02-05 15:04:01 -06:00
|
|
|
n.State.CurrentS = spin.Text()
|
2024-01-19 02:52:57 -06:00
|
|
|
me.myTree.SendUserEvent(n)
|
2024-01-17 23:54:19 -06:00
|
|
|
})
|
|
|
|
} else {
|
|
|
|
e := ui.NewNonWrappingMultilineEntry()
|
|
|
|
newt.uiMultilineEntry = e
|
|
|
|
newt.uiControl = e
|
2024-02-05 15:04:01 -06:00
|
|
|
newt.uiMultilineEntry.SetText(n.State.DefaultS)
|
2024-01-17 23:54:19 -06:00
|
|
|
|
|
|
|
e.OnChanged(func(spin *ui.MultilineEntry) {
|
2024-02-05 15:04:01 -06:00
|
|
|
n.State.CurrentS = spin.Text()
|
2024-01-19 02:52:57 -06:00
|
|
|
me.myTree.SendUserEvent(n)
|
2024-01-17 23:54:19 -06:00
|
|
|
})
|
|
|
|
}
|
|
|
|
n.TK = newt
|
|
|
|
place(p, n)
|
|
|
|
}
|