proc toggle_fields {value} {
global attrib_list
global import
set num_rows [$attrib_list getRowCount]
for {set i 0} {$i < $num_rows} {incr i} {
$import setCurrentValue $i $value
}
}
set count 1
proc loadValues { formHandle } {
global att_name
global att_type
global att_bkgrd
global att_desc
global l_bound
global u_bound
global import
global attrib_list
global modname2
global description
global columns
global count
global tabbed_panel
set num_values "[$formHandle numberInputFields attrib_list]"
$attrib_list setInitialRows $num_values $num_values $num_values
$description setCurrentValue "[$formHandle readInputField description]"
$modname2 setCurrentValue "[$formHandle readInputField modname]"
for {set index 0} {$index < $num_values} {incr index} {
$att_name setCurrentValue $index "[$formHandle readInputField attrib_list($index).att_name]"
$att_type setCurrentValue $index "[$formHandle readInputField attrib_list($index).att_type]"
if { "[$att_type getCurrentValue $index]" == "Character" } {
addPanel $columns $count $formHandle "[$att_name getCurrentValue $index]"
incr count
}
$att_bkgrd setCurrentValue $index "[$formHandle readInputField attrib_list($index).att_bkgrd]"
$att_desc setCurrentValue $index "[$formHandle readInputField attrib_list($index).att_desc]"
$l_bound setCurrentValue $index "[$formHandle readInputField attrib_list($index).l_bound]"
$u_bound setCurrentValue $index "[$formHandle readInputField attrib_list($index).u_bound]"
$import setCurrentValue $index "[$formHandle readInputField attrib_list($index).import]"
}
if { $count == 1 } {
$tabbed_panel setInputAllowed false
}
$formHandle legacyProcessValues true
$formHandle updateFieldList
}
proc actionTabbedPane {} {
global att_name
global import
global attrib_list
global columns
set editingRow [$attrib_list getEditingRow]
set attribName [$att_name getCurrentValue $editingRow]
for {set index 0} {$index < [$columns getTabCount]} {incr index} {
set panelProc [$columns getPaneName $index]
set title [$columns getTitleAt $index]
if {"$attribName" == "$title"} {
global check_array
if {"[$import getCurrentValue $editingRow]" == "YES"} {
$columns setTabbedPane $panelProc true
$check_array([expr $index+1]) setInputAllowed true
} else {
$columns setTabbedPane $panelProc false
$check_array([expr $index+1]) setCurrentValue true
$check_array([expr $index+1]) setInputAllowed false
}
}
}
}
proc addPanel {tab_pane index formHandle att_name} {
global columns
global values_check$index
global check_array
GuidoPanel col$index {
-label $att_name
-layout BoxLayout Y_AXIS
-width 50
GuidoPanel values_check_panel$index {
-layout CentrelineLayout
GuidoCheckBox values_check$index {
-default false
-label "Load all blocks for this attribute?"
-selected_value YES
-tip "Indicate whether this attribute should be loaded into the constrained block model."
-unselected_value NO
}
}
GuidoFiller space {
-height 0.5
}
upvar 0 values_check$index depVal
set check_array($index) $depVal
GuidoScrollPane bounds_scroll$index {
-height 7
-width 20.5
-label "Import blocks containing these values only"
GuidoTable bounds_list$index {
-instances 1 1 100
-interactive true
GuidoField bounds_value$index {
-dependency { "[$depVal getCurrentValue]" == "NO" }
-display_length 15
-label "Value"
-max_length BM_MAX_ATT_NAME_LEN
-null false
-input true
}
}
}
}
upvar 0 col$index newPanel
$tab_pane add [$newPanel getObject]
upvar 0 values_check$index values
set num_values "[$formHandle numberInputFields bounds_list$index]"
upvar 0 bounds_value$index bounds_values
for {set index2 0} {$index2 < $num_values} {incr index2} {
set text "[$formHandle readInputField bounds_list$index\($index2\).bounds_value]"
$bounds_values setCurrentValue $index2 $text
}
}
GuidoForm frm00907 {
-default_buttons
-label "Block Model Load"
-layout BoxLayout Y_AXIS
-tip "00907_TIP_002"
-action initial {[loadValues $frm00907]}
GuidoPanel top_panel {
-layout BorderLayout
GuidoPanel frm00907_74 {
-layout CentreLineLayout
-position West
GuidoLabel frm00907_2 {
-label "Model name"
}
GuidoLabel modname2 {
-font_style bold
}
GuidoLabel frm00907_3 {
-label Description
}
GuidoLabel description {
-font_style bold
}
}
GuidoPanel over_button_panel {
-layout BoxLayout Y_AXIS
-position East
GuidoFiller space {
-height 1
}
GuidoPanel button_panel {
-layout BoxLayout X_AXIS
GuidoButton import_all {
-action valueChanged { [toggle_fields YES]}
-caption  "Import all"
}
GuidoButton import_none {
-action valueChanged { [toggle_fields NO]}
-caption  "Import none"
}
}
}
}
GuidoScrollPane frm00907_59 {
-height 12
-font_style bold
-label "Select Attributes to Import"
-border etched true
GuidoTable attrib_list {
-instances 1 1 100
-row_headings
-interactive false
GuidoLabel att_name {
-display_length 10
-label Name
}
GuidoLabel att_type {
-display_length 7
-label Type
}
GuidoLabel att_bkgrd {
-display_length 6
-label Background
}
GuidoLabel att_desc {
-display_length 15
-label Description/Expression
}
GuidoField l_bound {
-dependency { "[$att_type getCurrentValue]" != "Character" && "[$att_type getCurrentValue]" != "Calculated" }
-display_length 4
-format none
-label Lower
-max_length 20
-tip "00907_TIP_003"
-translate none
}
GuidoField u_bound {
-dependency { "[$att_type getCurrentValue]" != "Character" && "[$att_type getCurrentValue]" != "Calculated" }
-display_length 4
-format none
-label Upper
-max_length 20
-tip "00907_TIP_004"
-translate none
}
GuidoCheckBox import {
-default true
-action valueChanged {[actionTabbedPane]}
-label Import
-selected_value YES
-tip "Indicate whether this attribute should be loaded into the constrained block model."
-unselected_value NO
}
}
}
GuidoFiller space {
-height 0.5
}
GuidoPanel tabbed_panel {
-label "Character attribute bounds"
-border etched true
-layout FlowLayout Left 0 0
GuidoTabbedPane columns {
}
}
$frm00907 legacyProcessValues false
}
