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 frm00628 {
-label "Insert Text Symbol"
-default_buttons
-tip "CREATE_TEXT_SYM_TIP1"
GuidoScrollPane sp {
-label "Text"
-height 10
-width 40
GuidoTextArea text {
-tip "CREATE_TEXT_SYM_TIP2"
-validation {[maxLineLength $text]}
}
}
GuidoComboBox pen_colour {
-label "Colour"
-max_length 40
-width 25
-null false
-tip "CREATE_TEXT_SYM_TIP3"
}
GuidoLabel font_label {
-label "Font options"
}
GuidoPanel font_panel {
-layout CentreLineLayout
-border etched true
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 "Angle (degrees)"
-max_length 10
-width 10
-format float
-null false
-tip "CREATE_TEXT_SYM_TIP5"
}
$font updateBrowserList
}
