Top  | Previous | Next

SQLTags Drag-n-Drop

Components can also be created by simply dragging a SQLTag onto a container. Depending on the datatype of the tag, you will get a popup menu prompting you to select an appropriate type of component to display or control that tag.

 

For example, suppose you have an Int4 type tag, If you drag the tag from the SQLTags Browser panel onto a component, you will be prompted either to display or control the tag with a variety of labels, level indicators, numeric entry fields, and control buttons.

 

This technique is great for beginners and for rapid application design. By dropping a SQLTag into a container and choosing a component type, a few steps are happening:

 

The component that you chose is created at the position you dropped it.
A variety of property bindings are created automatically. The bindings depend on what kind of tag was dropped and what kind of component was created. For example, lets suppose you have a Float8 point that represents a setpoint, and you want to set it. Drop the tag onto a container and choose to control it with a Numeric Text Field. The following bindings will be set up automatically
oThe text field's doubleValue property gets a bidirectional tag binding to the tag's Value property.
oThe text field's minimum and maximum properties get tag bindings to the tag's EngLow and EngHigh properties, respectively.
oThe text field's decimalFormat property gets a tag binding to the tag's FormatString property.
oThe text field's toolTipText property gets a tag binding to the tag's Tooltip property

 

It is important to realize that multiple property bindings are created when creating components this way. These bindings not only use the tag's value, but much of the tag's metadata as well. Using the tags metadata in this way can greatly improve a project's maintainability. For example, if you decide that the setpoint needs 3 decimal places of precision, you can simply alter the tag's FormatString to be #,##0.000, and anywhere you used that tag will start displaying the correct precision because of the metadata bindings.

 

See also:

Property Binding Overview

SQLTag Metadata Properties