proc losingFocus {planes_tree} {
if {"[$planes_tree getSelectedNode]" != ""} {
if {"[[$planes_tree getSelectedNode] getLabelText]" == ""} {
$planes_tree setSelectedNode [$::empty getCurrentValue]
}
} else {
$planes_tree setSelectedNode [$::empty getCurrentValue]
}
}
GuidoForm frmlistPlane {
-default_buttons
-label "Select Plane"
-tip "FRM_LISTPLANE_1"
-layout BorderLayout
GuidoScrollPane scroll {
-height 15
GuidoTree planes_tree {
-label ""
-editable false
-no_mlt
-multiple_selection false
set buffer [GuidoExecServer PlaneTreeStructure [subst {type = "$::containerName"}]]
set nSeries "[GuidoGetParamBufferValue $buffer nSeries ]"
set editPlane "[GuidoGetParamBufferValue $buffer editPlane ]"
set rootNode [$planes_tree getRootNode]
for {set i 0} {$i < $nSeries} {incr i} {
set pname "[GuidoGetParamBufferValue $buffer series_$i]"
GuidoTreeBranch branch_$i {
-label_no_mlt "$pname"
set nPlanes "[GuidoGetParamBufferValue $buffer nPlanes_$i]"
for {set j 0} {$j < $nPlanes} {incr j} {
set name [GuidoGetParamBufferValue $buffer "plane\_$i\_$j"]
set useName $pname/$name
GuidoTreeLeaf leaf\_$i\_$j {
-menu_enabled false
-default $name
-label $name
-no_mlt
set leaf "\$leaf\_$i\_$j"
-action focusGained {[$::empty setLabel [subst $leaf]
$::plane setCurrentValue $useName]}
-action focusLost {[losingFocus $planes_tree]}
}
}
-action focusGained {[$planes_tree setSelectedNode [$::empty getCurrentValue]]}
}
}
}
for {set i 0} {$i < $nSeries} {incr i} {
set child [$rootNode getChildAt $i]
set d [$child getChildCount]
for {set j 0} {$j < $d} {incr j} {
set grandChild [$child getChildAt $j]
}
$planes_tree setSelectedNode $child
set name [GuidoGetParamBufferValue $buffer "plane\_$i\_0"]
$planes_tree expandPath "$::containerName\\$pname\\$name"
}
$planes_tree setTreeIcons $iconFile $iconFile $iconFileZ
}
GuidoPanel bottom {
-position South
GuidoField plane {
-visible false
}
GuidoLabel empty {
-visible false
}
}
if {$nSeries > 0} {
set child [$rootNode getChildAt 0]
set grandChild [$child getChildAt 0]
$planes_tree setSelectedNode $grandChild
$::empty setLabel $grandChild
$::plane setCurrentValue [$child getLabelText]/[$grandChild getLabelText]
}
}
