proc ValidateDescriptionLength { } {
global scroll
global attribute
set total_length 0
set buffer [GuidoExecServer get_SWA_MAX_DESCRIPTION_LENGTH_PROC {}]
set SWA_MAX_DESCRIPTION_LENGTH [GuidoGetParamBufferValue $buffer SWA_MAX_DESCRIPTION_LENGTH]
set numberOfRows [$scroll getRowCount]
for {set row 0} {$row < $numberOfRows} {incr row} {
set descriptionTxt [$attribute getCurrentValue $row]
set row_length [string length $descriptionTxt]
set total_length [expr {$total_length + $row_length}]
}
set final_length [expr {$total_length + $numberOfRows -1}]
if {$final_length > $SWA_MAX_DESCRIPTION_LENGTH} {
GuidoMessage warning DESCRIPTION_TEXT_LEN_EXCEEDED $SWA_MAX_DESCRIPTION_LENGTH
return 0
} else {
return 1
}
}
GuidoForm frm00105 {
-default_buttons
-label "Enter/edit a point"
-layout BoxLayout Y_AXIS
-tip "00105_TIP_001"
GuidoPanel panel1 {
-layout CentreLineLayout Vertical Left
GuidoLabel function_label {
-label Function
}
GuidoLabel function {
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoLabel istr_label {
-label String
}
GuidoLabel istr {
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoField ynew {
-display_length 16
-format double
-decimals 3
-label "Y value"
-max_length 16
-null false
-tip "You may enter a new Y co-ordinate or change the existing one."
-translate upper
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoField xnew {
-display_length 16
-format double
-decimals 3
-label "X value"
-max_length 16
-null false
-tip "You may enter a new X co-ordinate or change the existing one."
-translate upper
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoField znew {
-display_length 16
-format double
-decimals 3
-label "Z value"
-max_length 16
-null false
-tip "You may enter a new Z value or change the existing one."
-translate upper
}
}
GuidoPanel panel2 {
-label "Descriptions"
GuidoScrollPane frm00105_1 {
-height 7
GuidoTable scroll {
-instances 1 1 100
-interactive true
-row_headings D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 D14 D15 D16 D17 D18 D19 D20 D21 D22 D23 D24 D25 D26 D27 D28 D29 D30 D31 D32 D33 D34 D35 D36 D37 D38 D39 D40 D41 D42 D43 D44 D45 D46 D47 D48 D49 D50 D51 D52 D53 D54 D55 D56 D57 D58 D59 D60 D61 D62 D63 D64 D65 D66 D67 D68 D69 D70 D71 D72 D73 D74 D75 D76 D77 D78 D79 D80 D81 D82 D83 D84 D85 D86 D87 D88 D89 D90 D91 D92 D93 D94 D95 D96 D97 D98 D99 D100
GuidoField attribute {
-display_length 16
-validation {[ValidateDescriptionLength]}
-format none
-label "Description"
-input true
-max_length SWA_MAX_DESCRIPTION_LENGTH
-translate none
-tip "00105_TIP_005"
}
}
}
}
}
