proc blockAttributeList { formHandle } {
global attributeList
global attributeFormatList
global columns
set buffer [ GuidoExecServer GetReportAttributeValueList {} ]
set attributeList [ GuidoGetParamBufferValue $buffer attribute ]
set allValuesList [ GuidoGetParamBufferValue $buffer allValues ]
set list_length [llength $attributeList]
for { set count 0} {$count < $list_length} {incr count} {
set allValuesStr [lindex $allValuesList $count]
if { $allValuesStr == "YES"} {
addPanel $columns [expr $count + 1] [lindex $attributeList $count] true 0
} else {
upvar 0 boundsValue$count bounds
set stringList [ GuidoGetParamBufferValue $buffer boundsValue$count ]
addPanel $columns [expr $count + 1] [lindex $attributeList $count] false $stringList
}
}
$formHandle updateFieldList
}
proc fill_tables {} {
global columns
set n [$columns getTabCount]
set attNames ""
for {set i 1} {$i <= $n} {incr i} {
global bounds_value$i
upvar 0 bounds_value$i listCombo
set attName [$columns getTitleAt [expr $i -1]]
if {$i == 1} {
set attNames $attName
} else {
set attNames "$attNames;$attName"
}
}
if { [string length $attNames] > 0 } {
set buffer [GuidoExecServer GetAllValuesOfABlockModelAttribute [subst {attribute = $attNames}]]
for {set i 1} {$i <= $n} {incr i} {
global bounds_value$i
upvar 0 bounds_value$i listCombo
set attName [$columns getTitleAt [expr $i -1]]
set numValues ""
if {$n > 1} {
set numValues "num_values_$attName"
} else {
set numValues "num_values"
}
set num_values [GuidoGetParamBufferValue $buffer $numValues]
if {$num_values > 0} {
set attValName ""
if {$n > 1} {
set attValName "attribute_value_$attName"
} else {
set attValName "attribute_value"
}
set attributeList [GuidoGetParamBufferValue $buffer $attValName]
eval [concat {$listCombo} {setValues} $attributeList ]
}
}
}
}
proc checkChanged {index} {
global bounds_list$index
global values_check$index
upvar 0 bounds_list$index scroll
upvar 0 values_check$index check
if { [$check getCurrentValue] == "YES" } {
$scroll setInputAllowed false
} else {
$scroll setInputAllowed true
fill_tables
}
}
proc addPanel {tab_pane index att_name all_values stringList} {
global values_check$index
global bounds_scroll$index
global bounds_list$index
global bounds_value$index
global scrollPanel$index
global scroll_label$index
global right_panel_20194
$right_panel_20194 setInputAllowed true
GuidoPanel col$index {
-layout BoxLayout Y_AXIS
-width 24
GuidoPanel values_check_panel$index {
-layout CentrelineLayout
GuidoCheckBox values_check$index {
-default $all_values
-label "Report all values for this attribute?"
-selected_value YES
-tip "Do you wish to report on all string values for this attribute?"
-unselected_value NO
-action valueChanged { [checkChanged $index] }
}
}
GuidoFiller space {
-height 0.5
}
GuidoPanel scrollPanel$index {
-layout BoxLayout Y_AXIS
GuidoLabel scroll_label$index {
-label "Report grouped on these values only"
}
GuidoScrollPane bounds_scroll$index {
-height 12
-width 22
GuidoTable bounds_list$index {
-instances 1 1 100
-interactive true
GuidoComboBox bounds_value$index {
-display_length 15
-label "Value"
-max_length 30
-null allowed
-no_mlt
-input true
-exclusive false
-tip "Enter the string values to be grouped on in the output report"
}
}
}
}
}
checkChanged $index
upvar 0 col$index newPanel
$tab_pane add [$newPanel getObject]
$tab_pane setTitleAt [expr $index -1] $att_name
if { $stringList != 0 } {
upvar 0 bounds_value$index boundsval
set list_length [llength $stringList]
upvar 0 bounds_list$index boundslist
$boundslist setInitialRows $list_length
for { set count 0} {$count < $list_length} {incr count} {
set valueString [lindex $stringList $count]
$boundsval setCurrentValue $count $valueString
}
}
}
GuidoForm frm20194 {
-default_buttons
-label "Define String Groups"
-layout BoxLayout Y_AXIS
-action initial {[blockAttributeList $frm20194]}
GuidoButton get_values {
-caption "Populate browsers"
-action valueChanged {[fill_tables]}
-height 1
}
GuidoPanel right_panel_20194 {
-label "Grouping character attributes"
-border etched true
-layout FlowLayout Left 0 0
GuidoTabbedPane columns {
-height 17
}
GuidoFiller space {
-height 1
}
}
}
