proc prepareIDNumberValue { formHandle } {
set rValue "[$formHandle readInputField IDNumber]"
return $rValue;
}
proc prepareLabelValue { formHandle } {
set lValue "[$formHandle readInputField label]"
return $lValue;
}
proc prepareEntityValue { formHandle } {
set lValue "[$formHandle readInputField entity]"
return $lValue;
}
proc prepareMethodValue { formHandle } {
set mValue "[$formHandle readInputField method]"
return $mValue;
}
proc prepareStringValue { formHandle } {
set sValue "line_colour~[$formHandle readInputField line_colour]!"
append sValue "line_weight~[$formHandle readInputField line_weight]!"
append sValue "line_pattern~[$formHandle readInputField line_pattern]!"
append sValue "line_join~[$formHandle readInputField line_join]!"
append sValue "line_end~[$formHandle readInputField line_end]"
return $sValue
}
proc prepareMarkerValue {formHandle } {
set mValue "marker_symbol~[$formHandle readInputField marker_symbol]!"
append mValue "marker_size~[$formHandle readInputField marker_size]"
return $mValue
}
proc prepareTextValue {formHandle } {
if {[string match {* *} [$formHandle readInputField size]]} {
scan [$formHandle readInputField size] {%s %s} size units
} else {
scan [$formHandle readInputField size] {%g%s} size units
}
scan [$formHandle readInputField text_path] {%s %s %s} path1 path2 path3
set tValue "text_font_name~[$formHandle readInputField text_font_name]!"
append tValue "size~$size!"
append tValue "units~$units!"
append tValue "slant~[$formHandle readInputField slant]!"
append tValue "text_path~$path1,$path2,$path3"
return $tValue
}
proc preparePolygonValue {formHandle } {
set transmissionColor [$formHandle readInputField transmission]
if {$transmissionColor == ""} {
set transmissionColor "none"
}
set pValue "face_colour~[$formHandle readInputField face_colour]!"
append pValue "edge_weight~[$formHandle readInputField edge_weight]!"
append pValue "edge_pattern~[$formHandle readInputField edge_pattern]!"
append pValue "specular~[$formHandle readInputField specular]!"
append pValue "transmission~$transmissionColor!"
append pValue "gloss~[$formHandle readInputField gloss]!"
append pValue "face_pattern~[$formHandle readInputField face_pattern]"
return $pValue
}
proc setupFields {formHandle} {
global IDNumber
global stringLabel
global entity
global method
global s
global m
global t1
global p
global t
$IDNumber setCurrentValue [prepareIDNumberValue $formHandle ]
$stringLabel setCurrentValue [prepareLabelValue $formHandle ]
$entity setCurrentValue [prepareEntityValue $formHandle ]
$method setCurrentValue [prepareMethodValue $formHandle ]
$s setCurrentValue [prepareStringValue $formHandle ]
$m setCurrentValue [prepareMarkerValue $formHandle ]
$t1 setCurrentValue [prepareTextValue $formHandle ]
$p setCurrentValue [preparePolygonValue $formHandle ]
}
proc writeNormalValues {formHandle value} {
set valueList [split $value ~!]
for {set index 0 } {$index < [llength $valueList]} {incr index 2} {
set listKey [lindex $valueList $index]
if {[string compare $listKey "transmission"] ==  0} {
if {[string compare [lindex $valueList [expr $index +1]] "none"] ==  0} {
set listValue ""
} else {
set listValue [lindex $valueList [expr $index +1] ]
}
} else {
set listValue [lindex $valueList [expr $index +1] ]
}
$formHandle writeOutputField "$listKey" $listValue
}
}
proc writeTextValues {formHandle value} {
set textList [split $value ~!]
set size "0.2"
set units "sru"
set sizeFieldName size
for {set index 0 } {$index < [llength $textList]} {incr index 2} {
set textKey [lindex $textList $index]
set textValue [lindex $textList [expr $index +1] ]
switch -exact -- $textKey {
size { set size $textValue }
units { set units $textValue }
text_path {set textValue [join [split $textValue ,] ]
$formHandle writeOutputField "$textKey" $textValue }
default {$formHandle writeOutputField "$textKey" $textValue}
}
}
$formHandle writeOutputField "$sizeFieldName" "$size $units"
}
proc writeOutFields {formHandle} {
global IDNumber
global stringLabel
global entity
global method
global s
global m
global t1
global p
global t
if { [string compare [$formHandle getStatus] "legacy preprocess apply"] ==  0 } {
$formHandle preprocessInit
set labelName label
set methodName method
set entityName entity
$formHandle writeOutputField "$labelName" [$stringLabel getCurrentValue ]
$formHandle writeOutputField "$entityName" [$entity getCurrentValue ]
$formHandle writeOutputField "$methodName" [$method getCurrentValue ]
writeNormalValues $formHandle [$s getCurrentValue ]
writeNormalValues $formHandle [$m getCurrentValue ]
writeNormalValues $formHandle [$p getCurrentValue ]
writeTextValues $formHandle [$t1 getCurrentValue ]
$formHandle finishedWritingFields
}
}
GuidoForm frm00575 {
-help_id 1281
-layout CentreLineLayout
-action initial {[setupFields $frm00575]}
-action stateChanged {[writeOutFields $frm00575 ]}
-label "String Drawing Properties"
-default_buttons
-tip STYLES_ONE_STRING_TIP
GuidoLabel l1 {
-label "String number"
}
GuidoField IDNumber {
-display_length 5
-format none
-height 1
-input false
}
GuidoFiller f0 {
-height 1
}
GuidoFiller f0 {
-height 1
}
GuidoField stringLabel {
-display_length 5
-label Label
-format none
-tip STYLES_LABEL_TIP
}
GuidoFiller f1 {
-height .2
}
GuidoFiller f1 {
-height .2
}
GuidoEntityBrowserField entity {
-display_length 15
-label Entity
-populate
-null true
-exclusive true
-tip STYLES_ENTITY_TIP
}
GuidoFiller f1 {
-height .2
}
GuidoFiller f1 {
-height .2
}
GuidoComboBox method {
-label "Drawing Method"
-default ""
-exclusive false
-height 1
-null allowed
-value_in "arrow" "line" "polygon" "marker" "x" "y" "z" "d1" "d2" "d3" "label" "#label" "#string-no" "#string-segment-no" "layer-point-no" "none" "marker,z" "line,z/200/5" "line,arrow/100/5"  "#string-segment-no,line,marker" "#string-segment-no,line,marker,arrow/100/5"
-tip STYLES_DRAW_METHOD_TIP
}
GuidoFiller f1 {
-height .2
}
GuidoFiller f1 {
-height .2
}
StringLineStyles s {
-label Line
-tip STYLES_STRING_TIP
}
GuidoFiller f1 {
-height .2
}
GuidoFiller f1 {
-height .2
}
MarkerSymbols m {
-label Markers
-tip STYLES_MARKER_TIP
}
GuidoFiller f1 {
-height .2
}
GuidoFiller f1 {
-height .2
}
TextStyles t1 {
-label Text
-tip STYLES_TEXT_TIP
}
GuidoFiller f1 {
-height .2
}
GuidoFiller f1 {
-height .2
}
PolygonStyles p {
-label Polygon
-tip STYLES_POLYGON_TIP
}
$frm00575 legacyProcessValues false
}
