proc getDatabaseHandle {} {
set buffer [GuidoExecServer LegacyGetCurrentDatabaseHandle [subst {sessionType = "GeologyDatabase"}]]
return [GuidoGetParamBufferValue $buffer DatabaseHandle]
}
proc updateFieldList { table f} {
upvar $f field
if {[info exists field]} {
$field setTableHandle [$table getCurrentValue]
$field updateBrowserList
}
}
proc decimals_allowed {tableName field_name dp} {
if {$field_name != ""} {
set buffer [GuidoExecServer GetFieldInformation [subst {DatabaseType = "GeologyDatabase" SurpacTableName = "$tableName" SurpacFieldName = $field_name}]]
set FieldType [GuidoGetParamBufferValue $buffer FieldType]
if {$FieldType == "real"} {
if {[$dp getCurrentValue] == ""} {
$dp setCurrentValue 2
}
return 1
}
$dp setCurrentValue ""
return 0
}
$dp setInputAllowed 0 false
return 1
}
GuidoForm frm00691 {
-label "Display discrete samples"
-default_buttons
-help_id 343
-next_focus rescale
-layout BoxLayout Y_AXIS
GuidoPanel displayCriteriaPanel {
-layout CentreLineLayout
GuidoPanel p1 {
-label "Display options"
-border etched true
-layout CentreLineLayout
set databaseHandle [getDatabaseHandle]
GuidoDatabaseTableBrowser table_name {
-label "Discrete sample table"
-null false
-format none
-database_handle $databaseHandle
-table_types discrete_sample
-tip DB_DISCRETE_SAMPLE_TABLE_TIP
-max_length DB_NAME_LENGTH
-display_length 10
}
$table_name updateBrowserList
GuidoCheckBox rescale {
-label "Rescale"
-selected_value Y
-unselected_value N
-tip DB_SAMPLE_DISPLAY_RESCALE_TIP
-next_focus displayTraverseConnections
}
GuidoTableFieldBrowser colourByField {
-label "Field to colour samples by"
-database_handle $databaseHandle
-table_handle [$table_name getCurrentValue]
-display_length 10
-max_length 18
-null true
-tip DB_SAMPLE_DISPLAY_COLOUR_FIELD_TIP
-next_focus defaultColour
}
$colourByField updateBrowserList
$table_name setActionCallback valueChanged {[updateFieldList $table_name colourByField]}
}
GuidoPanel p2 {
-border etched true
-label "Default rendering styles"
-layout CentreLineLayout
GuidoColourBrowserField defaultColour {
-display_length 11
-exclusive false
-label "Colour"
-max_length 32
-tip DB_SET_STYLES_COLOUR_TIP
-null false
-next_focus defaultLineStyle
}
MarkerSymbols defaultMarkerStyle {
-label "Marker style"
-width 11
-tip SRV_STN_DEFAULT_MARKER_TIP
-next_focus fieldName
}
GuidoFiller f1 {
-height .1
}
GuidoFiller f1 {
-height .1
}
}
}
GuidoFiller f0 {
-height 1
}
GuidoScrollPane s0 {
-height 9
-label "Display labels"
-border etched true
GuidoTable styles {
-instances 1 0 9
-interactive true
GuidoTableFieldBrowser fieldName {
-label "Field"
-display_length 10
-database_handle $databaseHandle
-table_handle [$table_name getCurrentValue]
-max_length 18
-exclusive true
-null true
-tip DB_SAMPLE_DISPLAY_LABEL_FIELD_TIP
-next_focus decimals
}
$fieldName updateBrowserList
$table_name setActionCallback valueChanged {[updateFieldList $table_name fieldName]}
GuidoField decimals {
-dependency {"[decimals_allowed [$table_name getCurrentValue] [$fieldName getCurrentValue] $decimals]"}
-label "Decimals"
-display_length 4
-format integer
-max_length 4
-null false
-low_bound 0
-high_bound 5
-tip DB_COLLAR_LABELS_DP_TIP
-next_focus font
}
GuidoFontNameBrowser font {
-label "Font"
-default "Default"
-display_length 10
-max_length 14
-null false
-tip DB_LABELS_FONT_TIP
-next_focus size
}
GuidoField size {
-label "Size"
-display_length 5
-max_length 10
-low_bound 0.01
-null false
-default 0.02
-format real_8
-tip DB_FONT_SIZE_TIP
-next_focus units
}
GuidoComboBox units {
-label "Units"
-display_length 3
-max_length 3
-null false
-value_in "oru" "sru"
-default "sru"
-tip DB_FONT_SIZE_TIP
-next_focus position
}
GuidoComboBox position {
-label "Position"
-display_length 5
-max_length 5
-null false
-value_in "above" "below" "left" "right"
-default  "above"
-tip DB_SAMPLE_DISPLAY_LABEL_POSITION_TIP
}
}
}
GuidoFiller f1 {
-height 1
}
$font updateBrowserList
}
