GuidoSymbolBrowserField
Overview
A GuidoSymbolBrowserField is a special implementation of a GuidoComboBox that is used to select a Symbol for plotting operations from all available Symbols on the system. The drop down list when selected will contain the names of all defined Symbols on your system. The browser field also has access to the Symbol previewer (displayed below) to assist with the selection of the Symbol. The GuidoSymbolBrowserField will understand all the switches that can be used for a GuidoComboBox.
Synopsis
GuidoSymbolBrowserField Name Body
Description
The GuidoSymbolBrowserField command when processed will define a rectangular text entry region on the form with two triangle icons on the right. The down arrow icon allows the drop down list to be displayed when pressed with the mouse, the right arrow icon will popup the Symbol previewer when pressed with the mouse. It accepts any of the standard Guido switches as described for GuidoComboBox.
Arguments
Name Name is a unique identifier that you assign and is used to differentiate this object from other Guido objects in the form definition. The name you assign will become the name of a variable in the Tcl interpreter that will contain the value as entered into the field on the form.
Body The body of the field may contain a number of switches to modify the default behaviour of the field. The body begins with an opening curly brace and ends with a closing curly brace. If there is no required body the curly braces {} are required as a place holder for this argument.
Switches Any switch that can be used on a GuidoComboBox may be applied to the GuidoSymbolBrowserField. See the reference for GuidoComboBox for further information. Common Guido switches reference
Examples
Example 1
The example form below demonstrates using GuidoSymbolBrowserFields to set the required Symbols for various plotting attributes. Note the use of the form procedure setSymbols defined at the top of the form that is required to set the list of available Symbols into the drop down lists. The procedure is invoked via the -action initial switch set on the GuidoSymbolBrowserFields which will populate the drop down lists just prior to the form being displayed on the screen.
This simple example can be copied and pasted to suite, but to gain an understanding of events and actions see the reference on Guido actions events and callbacks.
# GuidoSymbolBrowserField Example 1
# define the form
set formDef {
# form procedure to initialise the symbol browsers
proc setSymbols {symbolField} {
set buffer [ GuidoExecServer GetEntityInformation { attribute = "symbol" } ]
set symbols [ GuidoGetParamBufferValue $buffer symbol ]
foreach symbol $symbols {
$symbolField addItem $symbol
}
}
GuidoForm form {
-label "Using GuidoSymbolBrowserField"
-default_buttons
GuidoSymbolBrowserField collarMarker {
-label "Collar marker"
-width 20
-format none
-null false
-action initial {[setSymbols $collarMarker]}
}
GuidoSymbolBrowserField toeMarker {
-label "Toe marker"
-width 20
-format none
-null false
-action initial {[setSymbols $toeMarker]}
}
GuidoSymbolBrowserField pivotMarker {
-label "Pivot marker"
-width 20
-format none
-null false
-action initial {[setSymbols $pivotMarker]}
}
}
}
# Create and run the form
SclCreateGuidoForm formHandle $formDef {}
$formHandle SclRun {}
puts "Collar marker: $collarMarker"
puts "Toe marker : $toeMarker"
puts "Pivot marker : $pivotMarker"
|