identify widgets in tables
This commit is contained in:
parent
d141b4d308
commit
308543c02c
4
find.go
4
find.go
|
@ -10,6 +10,10 @@ func FindWidgetId(id int) *Node {
|
|||
return treeRoot.FindWidgetId(id)
|
||||
}
|
||||
|
||||
func FindWidgetById(id int) *Node {
|
||||
return treeRoot.FindWidgetId(id)
|
||||
}
|
||||
|
||||
// searches the binary tree for a WidgetId
|
||||
func (n *Node) FindWidgetId(id int) *Node {
|
||||
if n == nil {
|
||||
|
|
2
init.go
2
init.go
|
@ -68,7 +68,7 @@ func (t *TreeInfo) ConfigFind(n string) (string, error) {
|
|||
if n == r.Name {
|
||||
return r.Value, nil
|
||||
}
|
||||
log.Info("toolkit config", r.Plugin, r.Name, r.Value, n)
|
||||
// log.Info("toolkit config no-match on", r.Plugin, r.Name, r.Value, n)
|
||||
}
|
||||
return "", fmt.Errorf("toolkit config %s not found", n)
|
||||
}
|
||||
|
|
13
table.go
13
table.go
|
@ -307,6 +307,19 @@ func (me *TreeInfo) addTableRow(t *guipb.Table, grid *Node, name string, w int)
|
|||
return false
|
||||
}
|
||||
|
||||
// returns true if widget is in a table
|
||||
func (n *Node) InTable() bool {
|
||||
// log.Info("InTable() parent id =", n.ParentId)
|
||||
grid := FindWidgetById(int(n.ParentId))
|
||||
if grid != nil {
|
||||
if grid.WidgetType == widget.Grid {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func dumpTable(t *guipb.Table) {
|
||||
for i, o := range t.Order {
|
||||
log.Info("got order:", t.Title, i, o)
|
||||
|
|
Loading…
Reference in New Issue