2024-01-18 00:05:54 -06:00
|
|
|
package tree
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"go.wit.com/log"
|
2024-01-18 04:08:11 -06:00
|
|
|
"go.wit.com/widget"
|
2024-01-18 00:05:54 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
// makes a JSON version to pass to the toolkits ?
|
|
|
|
// probably this should be in gui/toolkits/tree
|
|
|
|
/*
|
|
|
|
{"widget": {
|
|
|
|
"debug": "on",
|
|
|
|
"window": {
|
|
|
|
"title": "Sample Konfabulator Widget",
|
|
|
|
"name": "main_window",
|
|
|
|
"width": 500,
|
|
|
|
"height": 500
|
|
|
|
},
|
|
|
|
"image": {
|
|
|
|
"src": "Images/Sun.png",
|
|
|
|
"name": "sun1",
|
|
|
|
"hOffset": 250,
|
|
|
|
"vOffset": 250,
|
|
|
|
"alignment": "center"
|
|
|
|
},
|
|
|
|
"text": {
|
|
|
|
"data": "Click Here",
|
|
|
|
"size": 36,
|
|
|
|
"style": "bold",
|
|
|
|
"name": "text1",
|
|
|
|
"hOffset": 250,
|
|
|
|
"vOffset": 100,
|
|
|
|
"alignment": "center",
|
|
|
|
"onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
*/
|
|
|
|
|
|
|
|
func (n *Node) Json() []string {
|
|
|
|
var all []string
|
|
|
|
switch n.WidgetType {
|
|
|
|
case widget.Checkbox:
|
|
|
|
case widget.Button:
|
|
|
|
case widget.Combobox:
|
|
|
|
case widget.Dropdown:
|
|
|
|
case widget.Textbox:
|
|
|
|
case widget.Spinner:
|
|
|
|
case widget.Slider:
|
|
|
|
case widget.Window:
|
|
|
|
tmp := fmt.Sprint("{ WidgetType :", n.WidgetType, "}")
|
|
|
|
all = append(all, tmp)
|
2024-02-07 07:41:35 -06:00
|
|
|
log.Log(TREEWARN, tmp)
|
2024-01-18 00:05:54 -06:00
|
|
|
return all
|
|
|
|
default:
|
2024-01-21 10:25:41 -06:00
|
|
|
log.Log(TREE, "doUserEvent() type =", n.WidgetType)
|
2024-01-18 00:05:54 -06:00
|
|
|
}
|
|
|
|
return all
|
|
|
|
}
|