proc PrevValue {} {
global ssiforminitialised
global  entity_name
global  location
global  id_range
global  string_range
global  segment_range
set fieldList(0) $entity_name
set fieldList(1) $location
set fieldList(2) $id_range
set fieldList(3) $string_range
set fieldList(4) $segment_range
if {$ssiforminitialised} {
foreach count {0 1 2 3 4} {
set rval [$fieldList($count) getCurrentValueRelative -1]
if {[string length $rval] > 0} {
set currVal [$fieldList($count) getCurrentValue]
if {[string length $currVal] == 0} {
$fieldList($count) setCurrentValue $rval
}
}
}
}
}
set entity_type ""
proc getEntityType {{isLocation false}} {
global entity_name
global entity_type
set entVal [$entity_name getCurrentValue]
set bufVal [GuidoExecServer "GetEntityType" [subst {entityName = "$entVal"}]]
set retVal [GuidoGetParamBufferValue $bufVal entityType]
if {$isLocation == "true" && $entVal == ""} {
set retVal $entity_type
} else {
set entity_type $retVal
}
return $retVal
}
proc updateEntityFile {type} {
global id_range
global location
$location setFileMask "*.*"
switch $type {
"ENTITY_NOTE" {
$location setLink id_range
$location setFileMask "not"
$location setExtension false
}
"ENTITY_IMAGE" {
$location setLink ""
$location setFileMask "gif jpg jpeg tif bmp png"
$location setExtension true
}
"ENTITY_STRING" {
$location setLink id_range
$location setFileMask "str"
$location setExtension false
}
"ENTITY_TABLE" {
$location setLink ""
$location setFileMask "xls xlsx"
$location setExtension true
}
"ENTITY_UNKNOWN" {
$location setLink ""
$location setExtension true
}
}
}
proc updateEntityInfo {} {
set type [getEntityType]
set enable_id true
set enable_str false
set enable_seg false
global ssiforminitialised
global id_range
global string_range
global segment_range
set ssiforminitialised 1
switch $type {
"ENTITY_IMAGE" {
set enable_id false
}
"ENTITY_STRING" {
set enable_str true
set enable_seg true
}
"ENTITY_UNKNOWN" {
set enable_id false
}
}
updateEntityFile type
$id_range setInputAllowed $enable_id
$string_range setInputAllowed $enable_str
$segment_range setInputAllowed $enable_seg
}
GuidoForm frm00230 {
set ssiforminitialised 0
-default_buttons
-label "Define a Map"
-layout BoxLayout Y_AXIS
-tip "00230_TIP_001"
GuidoPanel frm00230_19 {
-layout CentreLineLayout
GuidoField map_name {
-display_length 20
-format none
-input false
-label "Map name"
-max_length 20
-translate none
}
}
GuidoScrollPane frm00230_17 {
-height 13
GuidoTable main {
-instances 1 1 500
-interactive true
-action rowAdded {[PrevValue]}
-action rowInserted {[PrevValue]}
GuidoEntityBrowserField entity_name {
-action initial {[updateEntityInfo]}
-action focusLost {[updateEntityInfo]}
-action focusGained {[updateEntityInfo]}
-action valueChanged {[updateEntityInfo]}
-display_length 15
-exclusive false
-format none
-label Entity
-legacy_validation
-max_length "PLT_OBJECT_NAME_LENGTH"
-tip "00230_TIP_002"
}
GuidoFileBrowserField location {
-action focusGained {[updateEntityFile [getEntityType true]]}
-display_length 18
-file_mask "*.str *.not *.gif *.jpg *.jpeg *.tif *.bmp *.png *.xls *.xlsx"
-keep_extensions "gif jpg jpeg tif bmp png xls xlsx"
-format none
-label Location
-link id_range
-max_length 252
-tip "00230_TIP_003"
-translate none
}
GuidoField id_range {
-display_length 10
-format none
-label "ID range"
-max_length MAX_RNG_LENGTH
-tip "00230_TIP_004"
-translate none
}
GuidoField string_range {
-display_length 10
-format range
-label "String range"
-max_length 32
-tip "00230_TIP_005"
-translate none
}
GuidoField segment_range {
-display_length 10
-format range
-label "Segment range"
-max_length 32
-tip "00230_TIP_006"
-translate none
}
}
}
}
