proc changePatternOps {} {
global use_pattern_ops
global preview
$preview setOperationOn "patternFill" [$use_pattern_ops getCurrentValue]
}
proc changePatternValues {} {
global pattern_name
global pattern_lookup_file
global pattern_style
global pattern_option
global pattern_scale
global pattern_rotation_angle
global pattern_pen
global pattern_allow_pen_mods
global preview
set buffer [subst { pattern_name = "[$pattern_name getCurrentValue]"
pattern_lookup_file = "[$pattern_lookup_file getCurrentValue]"
pattern_style = "[$pattern_style getCurrentValue]"
pattern_option = "[$pattern_option getCurrentValue]"
pattern_scale = "[$pattern_scale getCurrentValue]"
pattern_rotation_angle = "[$pattern_rotation_angle getCurrentValue]"
pattern_pen = "[$pattern_pen getCurrentValue]"
pattern_allow_pen_mods = "[$pattern_allow_pen_mods getCurrentValue]" } ]
$preview loadBuffer "patternFill" $buffer
}
proc set_nulls { pattern_name pattern_lookup_field } {
set val [$pattern_name getCurrentValue]
if {[string length $val] == 0} {
$pattern_lookup_field setNullAllowed false
return true
} else {
$pattern_lookup_field setNullAllowed true
return false
}
}
GuidoPanel _main_main_23b {
global pfill_fields
for {set idx 0} {$idx < [array size pfill_fields]} {incr idx} {
global "pattern_$pfill_fields($idx)"
}
global use_pattern_ops
-layout BoxLayout Y_AXIS
GuidoPanel pattern_fill_ops_p1 {
-layout CentreLineLayout
GuidoLabel use_pattern_fill_ops_label {
-font_style bold
-label "Use pattern fill"
}
GuidoCheckBox use_pattern_ops {
-selected_value Y
-tip PLT_PATTERN_OP_TIP
-unselected_value N
-action mouseClicked {[changePatternOps]}
}
}
GuidoPanel pattern_ops_main {
-dependency { "[ $use_pattern_ops getCurrentValue ]" == "Y" }
-layout BoxLayout Y_AXIS
GuidoPanel pattern_or_lookup_panel {
-layout CentreLineLayout
GuidoLabel frm00227_197 {
-label "Use a"
}
GuidoLabel pattern_name_label {
-label "Pattern name or lookup file"
}
GuidoPatternBrowserField pattern_name {
-label "Pattern name"
-display_length 14
-format none
-max_length 16
-tip PLT_PATTERN_OP_PATTERN_TIP
-translate lower
-null allowed
-action valueChanged {[changePatternValues]}
-action focusGained {[changePatternValues]}
}
GuidoField pattern_lookup_file {
-dependency {"[$pattern_name getCurrentValue]" == "" &&
"[ $use_pattern_ops getCurrentValue ]" == "Y"}
-display_length 10
-format none
-label "Lookup file"
-max_length 40
-tip PLT_PATTERN_OP_LOOKUP_TIP
-translate upper
-action valueChanged {[changePatternValues]}
}
GuidoField pattern_lookup_field {
-dependency {"[ set_nulls $pattern_name $pattern_lookup_field]"}
-dependency {"[ $use_pattern_ops getCurrentValue ]" == "Y"}
-default D1
-display_length 5
-format string_field
-label "Lookup field"
-max_length 5
-tip PLT_PATTERN_OP_LOOKUP_FIELD_TIP
-translate upper
}
}
GuidoFiller pattern_ops_main_2 {
-height 1
}
GuidoPanel pattern_ops_main_3 {
-label "Pattern options"
-layout CentreLineLayout
-border etched true
GuidoPanel frm00227_213 {
-label "Hatching style"
-layout BoxLayout X_AXIS
-tip PLT_PATTERN_OP_HATCHING_TIP
GuidoButtonGroupPanel pattern_style {
-layout BoxLayout X_AXIS
GuidoRadioButton frm00227_210 {
-caption normal
-default true
-selected_value normal
-action mouseClicked {[changePatternValues]}
}
GuidoRadioButton frm00227_211 {
-caption outermost
-selected_value outermost
-action mouseClicked {[changePatternValues]}
}
GuidoRadioButton frm00227_212 {
-caption ignore
-selected_value ignore
-action mouseClicked {[changePatternValues]}
}
}
}
GuidoPanel frm00227_217 {
-label "Apply to a"
-layout BoxLayout X_AXIS
-tip PLT_PATTERN_OP_OBJECT_TIP
GuidoButtonGroupPanel pattern_option {
-layout BoxLayout X_AXIS
GuidoRadioButton frm00227_215 {
-caption segment
-selected_value segment
-action mouseClicked {[changePatternValues]}
}
GuidoRadioButton frm00227_216 {
-caption string
-default true
-selected_value string
-action mouseClicked {[changePatternValues]}
}
}
}
GuidoField pattern_scale {
-default 500
-display_length 10
-format double
-high_bound 999999.000000
-label "Pattern scale"
-low_bound 0.010000
-max_length 10
-null false
-tip PLT_PATTERN_OP_HATCHING_SCALE_TIP
-translate upper
-action valueChanged {[changePatternValues]}
}
GuidoField pattern_rotation_angle {
-default 0
-display_length 3
-format double
-high_bound 360.000000
-label "Rotation angle"
-low_bound 0.000000
-max_length 5
-null false
-tip PLT_PATTERN_OP_HATCHING_ROTATION_TIP
-translate upper
-action valueChanged {[changePatternValues]}
}
GuidoField pattern_pen {
-default 1
-display_length 3
-format integer
-high_bound 999
-label "Pen number"
-low_bound 0
-max_length 3
-null false
-tip PLT_PATTERN_OP_PEN_NUMBER_TIP
-translate upper
-action valueChanged {[changePatternValues]}
}
GuidoCheckBox pattern_allow_pen_mods {
-label "PLT_LABEL_ALLOW_PEN_MODS"
-selected_value Y
-unselected_value N
-default true
-tip "PLT_ALLOW_PEN_MODIFIERS"
}
GuidoField pattern_priority {
-default 0
-display_length 3
-format integer
-high_bound 125
-label Priority
-low_bound 0
-max_length 3
-null false
-tip PLT_PATTERN_OP_PRIORITY_TIP
-translate upper
}
}
}
}
$_main_main_23 add [eval "\$_main_main_23b getObject"]
global frm00227
$use_pattern_ops setCurrentValue 1
$use_pattern_ops setCurrentValue 0
$use_pattern_ops setCurrentValue [$frm00227 readInputField use_pattern_ops]
$pattern_name removeAllItems
set buffer [ GuidoExecServer GetPatternNames { } ]
set num_values [ GuidoGetParamBufferValue $buffer num_values ]
set attributeList ""
for {set idx 0} {$idx < $num_values} {incr idx} {
set attributeList "$attributeList [ GuidoGetParamBufferValue $buffer value_$idx ]"
}
eval [concat {$pattern_name} {setValues} $attributeList ]
if {[$frm00227 readInputField use_pattern_ops] == "Y"} {
global pfill_fields
for {set idx 0} {$idx < [array size pfill_fields]} {incr idx} {
global "pattern_$pfill_fields($idx)"
}
for {set idx 0} {$idx < [array size pfill_fields]} {incr idx} {
set val [$frm00227 readInputField pattern_$pfill_fields($idx)]
if {$val > ""} {
eval "\$pattern_$pfill_fields($idx) setCurrentValue \"\""
eval "\$pattern_$pfill_fields($idx) setCurrentValue \"$val\""
} else {
eval "\$pattern_$pfill_fields($idx) setCurrentValue \"\""
}
}
}
