GuidoScript scripts/geologyutilities.tcl
global geology_table
global geology_tbl
global geology_fld
global geology_position
global geology_offset
global geology_size
GuidoPanel geology_panelb {
-layout BoxLayout Y_AXIS
GuidoFiller attributes_filler_1 {
-height 1
}
GuidoPanel borderLayout {
-layout borderlayout
GuidoScrollPane scroller {
-width 33
GuidoTable geology_table {
-instances 1 0 200
-interactive true "insert|remove|add"
-position centre
GuidoDatabaseTableBrowser geology_tbl {
-display_length 5
-label "Table"
-database dbHandle
-action valueChanged {[updateTableName $geology_fld $geology_tbl]}
-table_types "interval | point"
-null true
-exclusive true
-tip DB_GEOLOGY_TBL_TIP
}
GuidoTableFieldBrowser geology_fld {
-display_length 5
-label "Field"
-format string
-null false
-exclusive true
-database dbHandle
-tip DB_GEOLOGY_FLD_TIP
-dependency {"[$geology_tbl getCurrentValue]" > ""}
}
GuidoComboBox geology_position {
-label "Position"
-display_length 3
-exclusive true
-null false
-max_length 6
-value_in left right centre
-default right
-tip DB_GEOLOGY_POSITION_TIP
}
GuidoField geology_offset {
-label "Offset"
-decimals 1
-display_length 3
-format double
-max_length 8
-null false
-default 0.0
-dependency {"[$geology_position getCurrentValue]" != "centre"}
-tip DB_GEOLOGY_OFFSET_TIP
}
GuidoField geology_size {
-label "Width"
-decimals 1
-display_length 3
-format double
-max_length 8
-null false
-default 1.0
-tip DB_GEOLOGY_WIDTH_TIP
}
}
}
}
}
$geology_panel add [eval "\$geology_panelb getObject"]
$geology_fld setDependency {[updateTableName $geology_fld $geology_tbl]}
$geology_fld setActionCallback focusGained {[ updateTableName $geology_fld $geology_tbl ]}
$geology_fld setValidationCallback {[validateTableFieldPair $geology_tbl $geology_fld]}
set databuf [ GuidoExecServer GetHoleGeology {} ]
set status [GuidoGetParamBufferValue $databuf status]
if {$status >= 0} {
set num_rows [GuidoGetParamBufferValue $databuf "num_rows"]
if {$num_rows > 0} {
$geology_table setInitialRows $num_rows 0 200
} else {
$geology_fld setInputAllowed 0 false
}
for {set i 0} {$i < $num_rows} {incr i} {
$geology_tbl setCurrentValue $i [GuidoGetParamBufferValue $databuf "tbl($i)"]
$geology_fld setCurrentValue $i [GuidoGetParamBufferValue $databuf "fld($i)"]
$geology_position setCurrentValue $i [GuidoGetParamBufferValue $databuf "position($i)"]
$geology_size setCurrentValue $i [GuidoGetParamBufferValue $databuf "size($i)"]
$geology_offset setCurrentValue $i [GuidoGetParamBufferValue $databuf "offset($i)"]
}
}
$geology_tbl updateBrowserList
