no message
parent
f2a1dbeba7
commit
3a1fc0bbfe
|
@ -89,18 +89,21 @@ func RangeWidget(p *Widget ) string{
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
ret := ""
|
ret := ""
|
||||||
ret += p.Class + "#" + p.Name + " \r\n{\r\n}\r\n"
|
parent := ""
|
||||||
|
tmp := p
|
||||||
|
for ;tmp != nil;tmp = tmp.Parent{
|
||||||
|
parent = tmp.Class + " #" + tmp.Name + " " + parent
|
||||||
|
}
|
||||||
|
ret += parent + " \r\n{\r\n}\r\n"
|
||||||
|
|
||||||
if(p.Childs.Len() > 0){
|
if(p.Childs.Len() > 0){
|
||||||
wid := p.Childs.Front()
|
wid := p.Childs.Front()
|
||||||
for ;wid != nil;wid = wid.Next(){
|
for ;wid != nil;wid = wid.Next(){
|
||||||
output := ""
|
|
||||||
tmp := wid.Value.(*Widget)
|
tmp := wid.Value.(*Widget)
|
||||||
for ;tmp != nil;tmp = tmp.Parent{
|
ret += RangeWidget(tmp)
|
||||||
output = tmp.Class + " #" + tmp.Name + " " + output
|
|
||||||
}
|
|
||||||
ret += output + "\r\n{\r\n}\r\n"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// log.Print(ret)
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +118,6 @@ func GetUifrom(path io.Reader) string{
|
||||||
switch startElement := token.(type) {
|
switch startElement := token.(type) {
|
||||||
case xml.StartElement:
|
case xml.StartElement:
|
||||||
if(startElement.Name.Local == "widget"){
|
if(startElement.Name.Local == "widget"){
|
||||||
// log.Print(startElement.Name.Local)
|
|
||||||
if(list.Len() == 0){
|
if(list.Len() == 0){
|
||||||
ins := new(Widget)
|
ins := new(Widget)
|
||||||
ins.Class = getAttr("class",startElement.Attr)
|
ins.Class = getAttr("class",startElement.Attr)
|
||||||
|
@ -126,7 +128,6 @@ func GetUifrom(path io.Reader) string{
|
||||||
ins := new(Widget)
|
ins := new(Widget)
|
||||||
ins.Class = getAttr("class",startElement.Attr)
|
ins.Class = getAttr("class",startElement.Attr)
|
||||||
ins.Name = getAttr("name",startElement.Attr)
|
ins.Name = getAttr("name",startElement.Attr)
|
||||||
// log.Print(list.Back().Value.(*Widget))
|
|
||||||
ins.Parent = list.Back().Value.(*Widget)
|
ins.Parent = list.Back().Value.(*Widget)
|
||||||
list.Back().Value.(*Widget).Childs.PushBack(ins)
|
list.Back().Value.(*Widget).Childs.PushBack(ins)
|
||||||
list.PushBack(ins)
|
list.PushBack(ins)
|
||||||
|
|
Loading…
Reference in New Issue