set oldvalue ""
set focusmaintained 0
proc firstcallback { } {
global attributes
global attribute
global dp
set numberOfRows [$attributes getRowCount]
for {set row 0} {$row < $numberOfRows} {incr row} {
if {"[$attribute getCurrentValue $row]" == "hole length" ||
"[$attribute getCurrentValue $row]" == "top of charge" ||
"[$attribute getCurrentValue $row]" == "bottom of charge" ||
"[$attribute getCurrentValue $row]" == "charged length" ||
"[$attribute getCurrentValue $row]" == "stemming length" ||
"[$attribute getCurrentValue $row]" == "delay" ||
"[$attribute getCurrentValue $row]" == "explosive mass"} {
$dp setInputAllowed $row true
} else {
$dp setInputAllowed $row false
}
}
}
proc attributecallback { attribute dp} {
set currentValue "[ $attribute getCurrentValue ]"
if {"$currentValue" != "hole length" &&
"$currentValue" != "top of charge" &&
"$currentValue" != "bottom of charge" &&
"$currentValue" != "charged length" &&
"$currentValue" != "stemming length" &&
"$currentValue" != "delay" &&
"$currentValue" != "explosive mass"} {
$dp setCurrentValue 0
$dp setInputAllowed false
} else {
$dp setInputAllowed true
}
}
proc remembervalue {attribute} {
global oldvalue
global focusmaintained
if {!"$focusmaintained"} {
set oldvalue "[ $attribute getCurrentValue ]"
}
set focusmaintained 1
}
proc checkvaluechanged {attribute title} {
global oldvalue
global focusmaintained
set newvalue "[ $attribute getCurrentValue ]"
if {"$oldvalue" != "$newvalue"} {
$title setCurrentValue $newvalue
}
set focusmaintained 0
}
GuidoForm frm70055 {
-default_buttons
-help_id 55
-label "Blasting Report"
-layout BoxLayout Y_AXIS
-tip "70038_TIP_001"
-action initial {[firstcallback]}
GuidoLabel frm70055_2 {
-label "Select the hole attributes to be included in the note file:"
}
GuidoScrollPane frm70055_39 {
-height 12
GuidoTable attributes {
-instances 1 1 50
-interactive true
-row_headings 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21
GuidoComboBox attribute {
-display_length 13
-exclusive false
-format none
-label Attribute
-max_length 17
-tip "70055_TIP_002"
-value_in number letter "hole length" "top of charge" "bottom of charge" "charged length" "stemming length" "explosive name" "explosive mass" "sequence number" delay pipe stope drive
}
GuidoField title {
-display_length 13
-format none
-label Title
-max_length 31
-tip "RD_REPORT_TITLE"
-translate none
}
GuidoField dp {
-default 0
-display_length 3
-format integer
-low_bound 0
-label "Dec. Places"
-max_length 16
-null false
-tip "RD_REPORT_DECIMAL_PLACES"
-translate none
}
$attribute setActionCallback valueChanged {[attributecallback $attribute $dp]}
$attribute setActionCallback focusGained {[remembervalue $attribute]}
$attribute setActionCallback focusLost {[checkvaluechanged $attribute $title]}
}
}
GuidoPanel blast_id_panel {
-layout CentreLineLayout
GuidoField blast_ids {
-display_length 16
-format range
-label RD_BLAST_ID_RANGE_LABEL
-max_length 32
-null false
-tip RD_BLAST_ID_RANGE_HELP
-translate none
}
}
}
