proc maxLineLength {txt} {
set valid 1
set content [$txt getCurrentValue]
set len [string length $content]
if {$len > 9999} {
GuidoMessage warning CREATE_TEXT_SYM_TIP7
$txt setCurrentValue [string range $content 0 9998]
set len 9999
}
if {$len > 0} {
set newLineCnt 0
set newContent ""
for {set i 0} {$i < $len} {incr i} {
set c [string index $content $i]
if { "$c" == "\n"} {
set newLineCnt 0
}
incr newLineCnt
if {!($newLineCnt % 251)} {
append newContent "\n"
set newLineCnt 1
set valid 0
}
append newContent "$c"
}
if {!$valid} {
GuidoMessage warning CREATE_TEXT_SYM_TIP6
$txt setCurrentValue $newContent
}
}
return $valid
}
GuidoForm frm50152 {
-default_buttons
-label "Define Label Parameters"
-tip "50152_TIP_0"
-layout BoxLayout Y_AXIS
GuidoPanel form_panel {
-layout BoxLayout Y_AXIS
GuidoPanel form_panel {
-layout CentreLineLayout
GuidoComboBox pen_colour {
-display_length 25
-format none
-label "Label Colour"
-max_length 40
-null false
-tip "50152_TIP_1"
}
GuidoScrollPane sp {
-label "Text"
-height 10
-width 29
GuidoTextArea text {
-tip "CREATE_TEXT_SYM_TIP2"
-validation {[maxLineLength $text]}
}
}
}
GuidoPanel font_panel {
-layout CentreLineLayout
-border etched true
-label "Font options"
GuidoFontNameBrowser font {
-label "Name"
-null false
-allowDefault true
-display_length 12
-format none
-max_length 50
-next_focus bold_font
-tip "PLT_FONT_NAME_TIP"
}
GuidoCheckBox bold_font {
-label "FONT_STYLE_BOLD"
-selected_value Y
-tip "FONT_STYLE_BOLD_TIP"
-unselected_value N
-next_focus italic_font
}
GuidoCheckBox italic_font {
-label "FONT_STYLE_ITALIC"
-selected_value Y
-tip "FONT_STYLE_ITALIC_TIP"
-unselected_value N
-next_focus underline_font
}
GuidoCheckBox underline_font {
-label "FONT_STYLE_UNDERLINE"
-selected_value Y
-tip "FONT_STYLE_UNDERLINED_TIP"
-unselected_value N
-next_focus height
}
GuidoField height {
-label "Height (cm)"
-max_length 10
-width 10
-format float
-low_bound 0.01
-null false
-tip "CREATE_TEXT_SYM_TIP4"
}
GuidoField angle {
-label "Text Angle (degrees)"
-max_length 10
-width 10
-format float
-null false
-tip "CREATE_TEXT_SYM_TIP5"
}
}
$font updateBrowserList
GuidoPanel lower_panel {
-layout BoxLayout X_AXIS
GuidoPanel start_panel {
-layout CentreLineLayout
-border etched true
-label "Start of line Symbol"
GuidoLabel start_sym_label {
-label "Symbol"
}
GuidoSymbolBrowserField start_symbol_name {
-display_length 10
-format none
-max_length 8
-tip "Choose the name of the special symbol from the list attached to this field."
}
GuidoLabel start_height_label {
-label "Size (cm)"
}
GuidoField start_sym_height {
-default 1
-decimals 2
-display_length 10
-format double
-low_bound .01
-max_length 10
-tip "00627_TIP_004"
-translate upper
}
GuidoLabel start_fill_label {
-label "Fill Symbol?"
}
GuidoCheckBox start_sym_fill {
-default false
-selected_value Yes
-tip "00627_TIP_006"
-unselected_value No
}
}
GuidoFiller fill1 {
-width .5
}
GuidoPanel end_panel {
-layout CentreLineLayout
-border etched true
-label "End of line Symbol"
GuidoLabel end_sym_label {
-label "Symbol"
}
GuidoSymbolBrowserField end_symbol_name {
-display_length 10
-format none
-max_length 8
-tip "Choose the name of the special symbol from the list attached to this field."
}
GuidoLabel end_height_label {
-label "Size (cm)"
}
GuidoField end_sym_height {
-default 1
-decimals 2
-display_length 10
-format double
-low_bound .01
-max_length 10
-tip "00627_TIP_004"
-translate upper
}
GuidoLabel end_fill_label {
-label "Fill Symbol?"
}
GuidoCheckBox end_sym_fill {
-default false
-selected_value Yes
-tip "00627_TIP_006"
-unselected_value No
}
}
}
}
}
