GuidoScript scripts/geologyutilities.tcl
global graphs_table
global graphs_tbl
global graphs_fld
global graphs_position
global graphs_use_styles
global graphs_colour
global graphs_scale
global graphs_maximum
global graphs_type
global graphs_offset
GuidoPanel graphs_panelb {
-layout BoxLayout Y_AXIS
GuidoPanel borderLayout {
-layout borderlayout
GuidoScrollPane scroller {
-width 62
GuidoTable graphs_table {
-instances 1 0 200
-interactive true "insert|remove|add"
-position centre
GuidoDatabaseTableBrowser graphs_tbl {
-display_length 5
-label "Table"
-database dbHandle
-action valueChanged {[updateTableName $graphs_fld $graphs_tbl]}
-table_types "interval | point"
-null true
-exclusive true
-tip DB_GRAPHS_TBL_TIP
}
GuidoTableFieldBrowser graphs_fld {
-display_length 5
-label "Field"
-format string
-null false
-exclusive true
-database dbHandle
-tip DB_GRAPHS_FLD_TIP
-dependency {"[$graphs_tbl getCurrentValue]" > ""}
}
GuidoComboBox graphs_position {
-label "Position"
-display_length 3
-exclusive true
-null false
-max_length 5
-value_in left right
-default right
-tip DB_GRAPHS_POSITION_TIP
}
GuidoField graphs_offset {
-label "Offset"
-decimals 1
-display_length 3
-format double
-max_length 8
-null false
-default 0.0
-tip DB_GRAPHS_OFFSET_TIP
}
GuidoComboBox graphs_type {
-label "Graph type"
-display_length 6
-exclusive true
-null false
-max_length 11
-value_in bar "filled bar" line
-default line
-tip DB_GRAPHS_TYPE_TIP
}
GuidoCheckBox graphs_use_styles {
-default true
-font_style bold
-label "Use styles"
-selected_value false
-unselected_value true
-tip DB_GRAPHS_STYLES_TIP
}
GuidoColourBrowserField graphs_colour {
-label "Colour"
-display_length 6
-exclusive false
-max_length 32
-tip DB_GRAPHS_COLOUR_TIP
-dependency {"[ $graphs_use_styles getCurrentValue]"}
}
GuidoField graphs_scale {
-label "Length/Unit"
-display_length 3
-format double
-max_length 8
-null false
-default 1.0
-tip DB_GRAPHS_SCALE_TIP
}
GuidoField graphs_maximum {
-label "Maximum"
-decimals 1
-display_length 3
-format double
-max_length 8
-null false
-default 50.0
-tip DB_GRAPHS_MAXIMUM_TIP
}
}
}
}
}
$graphs_panel add [eval "\$graphs_panelb getObject"]
$graphs_fld setDependency {[updateTableName $graphs_fld $graphs_tbl]}
$graphs_fld setActionCallback focusGained {[ updateTableName $graphs_fld $graphs_tbl ]}
$graphs_fld setValidationCallback {[validateTableFieldPair $graphs_tbl $graphs_fld]}
set databuf [ GuidoExecServer GetHoleGraphs {} ]
set status [GuidoGetParamBufferValue $databuf status]
if {$status >= 0} {
set num_rows [GuidoGetParamBufferValue $databuf "num_rows"]
if {$num_rows > 0} {
$graphs_table setInitialRows $num_rows 0 200
} else {
$graphs_fld setInputAllowed 0 false
$graphs_colour setInputAllowed 0 false
}
for {set i 0} {$i < $num_rows} {incr i} {
$graphs_tbl setCurrentValue $i [GuidoGetParamBufferValue $databuf "tbl($i)"]
$graphs_fld setCurrentValue $i [GuidoGetParamBufferValue $databuf "fld($i)"]
$graphs_position setCurrentValue $i [GuidoGetParamBufferValue $databuf "position($i)"]
$graphs_colour setCurrentValue $i [GuidoGetParamBufferValue $databuf "colour($i)"]
$graphs_scale setCurrentValue $i [GuidoGetParamBufferValue $databuf "scale($i)"]
$graphs_maximum setCurrentValue $i [GuidoGetParamBufferValue $databuf "maximum($i)"]
$graphs_type setCurrentValue $i [GuidoGetParamBufferValue $databuf "type($i)"]
$graphs_offset setCurrentValue $i [GuidoGetParamBufferValue $databuf "offset($i)"]
if {[GuidoGetParamBufferValue $databuf "colour($i)"] > ""} {
$graphs_use_styles setCurrentValue $i true
$graphs_colour setInputAllowed $i true
} else {
$graphs_use_styles setCurrentValue $i false
$graphs_colour setInputAllowed $i false
}
}
}
$graphs_tbl updateBrowserList
