VWorks User Guide : Creating protocol forms for operators : Adding form controls that allow editing or runtime data display

Adding form controls that allow editing or runtime data display
About this topic
To create or edit forms, you must have VWorks Technician- or Administrator-level access. You should also have an understanding of how to create protocols and define JavaScript variables in the VWorks software.
This topic describes the General Controls in the Form Designer window and how to configure them:
Figure. Form Designer window General Controls and example form
 
For more details on creating forms, see Workflow for creating or editing a form.
About the General Controls
The controls available under General Controls can be assigned JavaScript variables to allow users to edit data or to display runtime data on the form. For example, you might want the form to display the volume dispensed or to allow the form’s user to enter the number of mix cycles. The JavaScript variable assigned to the control must also be assigned to the given task parameter value.
The general controls include the following:
 
In the following figure the Droplist control has an assigned JavaScript variable (BCside) that is also specified in the protocol task parameter for defining the barcode side of the labware.
The Dropdown control in the figure has an assigned JavaScript variable (time) that is also specified in the protocol task parameter for defining the incubation time.
Note: A Static text control provides the caption, Select the protocol file.
Figure. Tabbed pages
Configuring the General Controls
To add a control to the form:
1
Under Available Controls, click General Controls, and then drag the desired control to the Form Canvas area.
An invisible autogrid assists you in aligning the control in the form. To turn off the autogrid, press ALT while dragging the control into position.
2
In the Form Canvas area, click the control that you want to set up, so that a resizing box appears around the border. To resize the control, drag one of the sizing handles.
Note that the corresponding properties appear for the selected control as the following figure shows.
Figure. Form Designer window displaying properties for the selected control
 
Note: Click Preview to display the image that the form’s user will see.
3
Edit the Properties for the control. The properties can include a combination of the following depending on the control:
The Line control does have any properties that you can set.
Note: If you want one control to overlap another control on the form, select the control that you want on top, and then click Bring selected control to front.
Setting properties common to the general controls
The following table lists the properties for all controls. A given control might use only a subset of the properties listed.
 
If the form’s Use global context for variables check box is selected, you can ignore this setting. If the form’s Use global context for variables check box is not selected, specify which context to use for the control’s JavaScript variable:
Global context. Select this check box.
Context of the running protocol. Clear this check box.
FixedSingle. Adds a single line that encloses the control.
Fixed3D. Adds a 3-dimensional effect to the border’s appearance.
Center. Center-aligns the image on the control.
Stretch. Stretches the image to fit the size of the control. The dimensional ratio of the image is not maintained.
Tile. Uses multiple copies of the image to cover the entire control area. The images are in their original sizes and are placed adjacent to one another.
Zoom. Magnifies the image such that the width or length covers the width or length of the control. The dimensional ratio of the image is maintained.
None. You can move the control freely on the canvas. Select None if you want to manually position the control, and you prefer to set the size of the control using the Width and Height properties.
Top. The top side of the control is adjacent to the top of the Form Canvas. The control’s width is increased to match the width of the canvas. Although the width is fixed, you can change the Height value.
Left. The left side of the control is adjacent to the left side of the Form Canvas. The control’s height is increased to match the height of the canvas. Although the height is fixed, you can change the Width value.
Bottom. The bottom side of the control is adjacent to the bottom of the Form Canvas. The control’s width is increased to match the width of the canvas. Although the width is fixed, you can change the Height value.
Right. The right side of the control is adjacent to the right side of the Form Canvas. The control’s height is increased to match the height of the canvas. Although the height is fixed, you can change the Width value.
Fill. The control’s size is increased so that it completely covers the Form Canvas area. The width and height of the control are fixed.
Setting Static text control properties
The Static text control has the following properties in addition to the properties common to the other general controls.
 
To coordinate the Static text control with a protocol task parameter, both the control and the task parameter must use the same JavaScript variable.
To coordinate the Static text control with another control, for example, the slider, both controls must have the same assigned JavaScript variable and both controls must specify the global JavaScript context so that they can communicate with each other.
Setting Droplist and Dropdown properties
The Droplist and Dropdown controls have the following properties in addition to the properties common to the other general controls.
Note: You might want to use these controls in combination with a Static text control to display a caption for your drop-down list or drop-down combo box.
 
Figure. Dropdown Properties example
 
Setting Slider properties
The Slider control has the following properties in addition to the properties common to the other general controls.
 
Horizontal. The scale reads from left to right, Min value to Max value.
Vertical. The scale reads from bottom to top, Min value to Max value.
You can use the Slider control in combination with the:
To coordinate the slider setting with a Static text control or Edit control and the protocol task parameter setting:
If the slider’s Data Entry property is not selected, the slider will move according to the current value of the underlying JavaScript variable. The behavior of the slider is undefined if the JavaScript variable does not have a numeric value, or if the variable’s value is outside the slider's range.
Setting Progress bar properties
The Progress bar control has the following properties in addition to the properties common to the other general controls.
Note: You might want to use this control in combination with a Static text control to create the progress bar caption.
 
Optional. To change the color, click the field, and then click the that appears.
The progress bar moves according to the current value of the underlying JavaScript variable. All progress bars are horizontal.
Setting Pushbutton control properties
The Pushbutton control can execute any JavaScript code that you specify. You provide the script in the Pushbutton Properties, as the following figure shows.
Figure. Workflow to create a pushbutton
 
In addition to the properties common to the general controls, the Pushbutton control has the following properties. For an example of how to set up a pushbutton using a script, see Example: Creating a scripted Pushbutton control in a form.
 
Global context. Select the check box to use the global context. For example, if the button is to be pressed while no protocol is running, you must use the global context.
Context of the running protocol. Clear the check box to use the protocol’s private context.
Optional. To select an image to use as an icon in addition to the button caption, click the field, and then click the button that appears.
Setting File Browsing properties
The File Browsing control has the properties that are common to the other general controls. No additional properties are provided.
For an example of how to set up a File Browsing control, see Example: Creating a scripted Pushbutton control in a form.
Setting Checkbox properties
The Checkbox control has the following properties in addition to the properties common to the general controls.
 
The Checkbox control is binary. When the check box on the form is selected, a 1 is written to the associated JavaScript variable. When the check box is cleared (unchecked), a 0 is written to the associated JavaScript variable.
Note: If the JavaScript variable's numeric value is anything other than 0, the check box will display as checked.
Setting Radio Button properties
The Radio Button control has the following properties in addition to the properties common to the other general controls.
 
The Radio Button control is binary. When the button on the form is selected, a 1 is written to the associated JavaScript variable. When the button is cleared, a 0 is written to the associated JavaScript variable.
Note: If the JavaScript variable's numeric value is anything other than 0, the option will display as selected.
Setting Image (static) control properties
The Image control has the following properties in addition to the properties common to the other general controls.
 
Setting Date and Time properties
The Date and Time control has the properties common to the other general controls. However, if you provide a default value, it must be in the following format. If you do not provide a default value, the software uses the current date and time from the computer.
 
If you select the Data entry property for this control, the user can enter:
Time. The user can edit the default values.
Date. The user can click the drop-down list to select the date from a calendar.
Setting Group Box properties
The Group Box control has the following properties in addition to the properties common to the other general controls.
 
Controls that you drag inside the group box become part of the group box. The group box may need to be resized to ensure that all the controls within the group box borders are clearly visible.
Setting Tab Control properties
The Tab Control has the following properties in addition to the properties common to the other general controls.
 
Normal. Each tab is sized to fit its name.
Fixed. The longest tab name determines the size of all the tabs.
FillToRight. The longest tab name determines the size of all the tabs, and the tabs are flush with the right and left margins of the control.
IMPORTANT The Dock selection overrides the values you specify for the Width and Height properties. For example, if you dock the control at the top of the canvas, the software increases the width of the control and updates the Width value. To return to the previously set Width and Height values, set the Dock property to None. For more information about docking tabbed pages, see Setting properties common to the general controls.
Each tabbed page contains the following properties in addition to the properties common to the other general controls.
 
Setting Panel properties
The Panel control has properties that are common to the other general controls. See Setting properties common to the general controls.
Related information