proc calcWords {} {
global scrollblock
global include
global explicit
global implicit
global calc_implicit
global total
global mandatory
global wordCount
set numberOfRows [$scrollblock getRowCount]
set totalWords 0
for { set i 0} {$i < $numberOfRows} {incr i} {
if {[$include getCurrentValue $i]} {
set implicit_val [$implicit getCurrentValue $i]
set explicit_val [$explicit getCurrentValue $i]
if { $implicit_val > 0 && $explicit_val > 0 } {
if {[$calc_implicit getCurrentValue]} {
set totalWords [expr $totalWords+$implicit_val]
} else {
set totalWords [expr $totalWords+$explicit_val]
}
} else {
set totalWords [expr $totalWords+$explicit_val]
}
}
}
set totalWords [expr $totalWords+[$mandatory getCurrentValue]]
$total setCurrentValue $totalWords
$wordCount setCurrentValue $totalWords
}
GuidoForm frm20012 {
-default_buttons
-label "Unable To Save To Datamine Format"
-layout BoxLayout Y_AXIS
-action initial { [calcWords ]}
-tip BM_DATAMINE_TOO_MANY_ATTS_TIP
GuidoFiller space {
-height 0.5
}
GuidoPanel frm20012_16 {
-layout CentreLineLayout
GuidoCheckBox calc_implicit {
-default true
-label "Calculated attributes as Implicit attributes"
-selected_value Y
-unselected_value N
-action mouseClicked { [calcWords ]}
-tip BM_DATAMINE_IMPLICIT_TIP
}
}
GuidoFiller space {
-height 0.5
}
GuidoScrollPane frm20012_14 {
-height 15
GuidoTable scrollblock {
-instances 1 1 100
-interactive false
GuidoField attribute {
-display_length 15
-format none
-input false
-label Attribute
-max_length 16
-null false
-translate none
}
GuidoField explicit {
-display_length 8
-format none
-input false
-label Explicit
-max_length 16
-translate none
}
GuidoField implicit {
-display_length 8
-format none
-input false
-label Implicit
-max_length 16
-translate none
}
GuidoCheckBox include {
-display_length 8
-default true
-label Include?
-selected_value Y
-unselected_value N
-action mouseReleased { [calcWords ]}
-tip "Select this box to include attribute in output model"
}
}
}
GuidoFiller space {
-height 0.5
}
GuidoPanel frm20012_17 {
-layout CentreLineLayout
GuidoField mandatory {
-display_length 4
-format none
-input false
-label "Words used by mandatory fields"
-max_length 16
-translate upper
}
GuidoField max {
-display_length 4
-format none
-input false
-label "Maximum words allowed by Datamine"
-max_length 16
-translate upper
-default 256
}
GuidoField total {
-display_length 4
-format none
-input false
-label "Current number of words in use"
-max_length 16
-translate upper
}
GuidoField wordCount {
-display_length 4
-format none
-max_length 16
-translate upper
-visible false
}
}
GuidoFiller space {
-height 0.5
}
}
